/* Space buttons — ASAITech birch palette */
@keyframes space-gradient-border {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes space-move-particles1 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        transform: translate(-25px, 15px) rotate(90deg);
    }
    40% {
        transform: translate(20px, -20px) rotate(180deg);
    }
    60% {
        transform: translate(-15px, -25px) rotate(270deg);
    }
    80% {
        transform: translate(25px, 20px) rotate(320deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

@keyframes space-move-particles2 {
    0% {
        transform: translate(0, 0) rotate(20deg);
    }
    25% {
        transform: translate(20px, -15px) rotate(110deg);
    }
    50% {
        transform: translate(-20px, 20px) rotate(200deg);
    }
    75% {
        transform: translate(15px, 15px) rotate(290deg);
    }
    100% {
        transform: translate(0, 0) rotate(380deg);
    }
}

@keyframes space-move-particles4 {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        transform: translate(-30px, 20px) rotate(90deg);
    }
    40% {
        transform: translate(25px, -25px) rotate(180deg);
    }
    60% {
        transform: translate(-20px, -30px) rotate(270deg);
    }
    80% {
        transform: translate(30px, 25px) rotate(320deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

.button-container {
    position: relative;
    display: inline-block;
    padding: 1px;
    border-radius: 10px;
    background: linear-gradient(90deg, #007a6e, #00a896, #00d4c4, #64ffda, #b2fff8, #00e5d4, #00b89a, #007a6e);
    background-size: 400% 400%;
    animation: space-gradient-border 20s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform, filter;
    backdrop-filter: blur(5px);
    max-width: 100%;
}

.button-container:hover {
    filter: brightness(1.18) saturate(1.15);
    box-shadow:
        0 0 28px rgba(0, 0, 0, 0.35),
        0 0 18px rgba(0, 230, 210, 0.45);
    backdrop-filter: blur(8px);
    animation: space-gradient-border 10s ease-in-out infinite;
}

.space-button,
a.space-button,
button.space-button {
    position: relative;
    padding: 9px 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 1);
    background: linear-gradient(45deg, #0a6b60, #00b39a);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(0, 55, 50, 0.5),
        0 0 16px rgba(0, 230, 210, 0.35),
        inset 0 0 12px rgba(0, 255, 235, 0.12);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 1;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: transform;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.35),
        0 0 20px rgba(255, 255, 255, 0.12);
    font-weight: 600;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    line-height: 1.25;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.btn-secondary.space-button {
    background: linear-gradient(45deg, #0f5c52, #14a898);
    box-shadow:
        0 4px 12px rgba(0, 55, 50, 0.45),
        0 0 14px rgba(100, 255, 218, 0.28),
        inset 0 0 12px rgba(178, 255, 245, 0.1);
}

.space-button span {
    position: relative;
    z-index: 5;
    mix-blend-mode: normal;
    font-weight: inherit;
    background: linear-gradient(to right, #ffffff, #ffffff);
    -webkit-background-clip: text;
    background-clip: text;
    color: #fff;
    -webkit-text-fill-color: #fff;
    filter: brightness(1.5) contrast(1.8);
    text-shadow:
        0 0 15px rgba(255, 255, 255, 0.6),
        0 0 30px rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    pointer-events: none;
}

.space-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(1px 1px at 10% 15%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 85% 25%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 75% 85%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 15% 75%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 50% 25%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 25% 50%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(1px 1px at 85% 65%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0));
    animation: space-move-particles1 20s linear infinite;
    opacity: 0.45;
    pointer-events: none;
    will-change: transform;
    z-index: 2;
}

.space-button::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    animation: space-move-particles2 18s linear infinite;
    transform: rotate(25deg);
    opacity: 0.55;
    pointer-events: none;
    will-change: transform;
    z-index: 3;
}

.space-button:hover {
    transform: translateY(-1px) translateZ(0);
    box-shadow:
        0 6px 14px rgba(0, 55, 50, 0.55),
        0 0 22px rgba(0, 245, 225, 0.5),
        inset 0 0 16px rgba(0, 255, 235, 0.18);
    background: linear-gradient(45deg, #0d7a6e, #00d4c4);
    color: #fff;
}

.btn-secondary.space-button:hover {
    background: linear-gradient(45deg, #128878, #00e5d4);
}

.space-button:hover span {
    filter: brightness(1.8) contrast(2);
    text-shadow:
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 255, 255, 0.4),
        0 0 60px rgba(255, 255, 255, 0.2);
}

.space-button:hover::before {
    opacity: 0.65;
}

.space-button:hover::after {
    opacity: 0.75;
}

.space-button:hover .bright-particles {
    opacity: 1;
    filter: blur(0);
}

.space-button .bright-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(2px 2px at 15% 25%, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)),
        radial-gradient(1.8px 1.8px at 85% 15%, rgba(255, 255, 255, 0.98), rgba(0, 0, 0, 0)),
        radial-gradient(2px 2px at 75% 75%, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0)),
        radial-gradient(1.5px 1.5px at 25% 85%, rgba(255, 255, 255, 0.95), rgba(0, 0, 0, 0)),
        radial-gradient(2.2px 2.2px at 65% 35%, rgba(255, 255, 255, 1), rgba(0, 0, 0, 0));
    animation: space-move-particles4 15s linear infinite;
    opacity: 0.85;
    mix-blend-mode: screen;
    pointer-events: none;
    will-change: transform;
    z-index: 4;
    filter: blur(0.3px);
}

.inline-buttons .button-container,
.hero-actions .button-container,
.checkout-step__nav .button-container,
.info-card-actions .button-container {
    vertical-align: middle;
}

.info-card-actions .space-button,
.product-actions .space-button {
    padding: 8px 14px;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.filter-actions .space-button {
    padding: 8px 16px;
    font-size: 11px;
}

.checkout-step__nav .space-button,
.hero-actions .space-button {
    padding: 10px 22px;
    font-size: 12px;
}

.inline-buttons .space-button {
    padding: 8px 16px;
    font-size: 11px;
}

@media (max-width: 520px) {
    .space-button {
        padding: 8px 14px;
        font-size: 11px;
        letter-spacing: 0.5px;
    }
}

[data-theme="dark"] .space-button {
    background: linear-gradient(45deg, #0a4a58, #0d7a8a);
}

[data-theme="dark"] .space-button:hover {
    background: linear-gradient(45deg, #0d6a7a, #00c9e8);
}

[data-theme="dark"] .btn-secondary.space-button {
    background: linear-gradient(45deg, #0c5560, #1098b0);
}

[data-theme="dark"] .btn-secondary.space-button:hover {
    background: linear-gradient(45deg, #1090a8, #2ee8ff);
}

[data-theme="dark"] .button-container {
    box-shadow: 0 0 26px rgba(0, 220, 255, 0.35);
}

[data-theme="dark"] .button-container:hover {
    box-shadow:
        0 0 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 220, 255, 0.5);
}
