@import url('foundation.css');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
    color-scheme: dark;
}

body {
    min-width: 320px;
    overflow-x: hidden;
    padding-bottom: calc(var(--radio-h) + 20px);
    color: var(--text);
    background: var(--bg);
    font-family: var(--font-en);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Lights & Mesh */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: 
        radial-gradient(circle at 80% 10%, rgba(229, 183, 87, 0.07), transparent 35%),
        radial-gradient(circle at 10% 45%, rgba(60, 90, 150, 0.05), transparent 40%),
        radial-gradient(circle at 50% 85%, rgba(229, 183, 87, 0.04), transparent 40%);
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.6;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

[dir="rtl"] body {
    font-family: var(--font-ar);
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Container */
.container {
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
}

section {
    position: relative;
    scroll-margin-top: var(--header-h);
}

[hidden] {
    display: none !important;
}

/* Typography & Section Titles */
.section-title {
    color: var(--text);
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
}

.section-title span {
    color: var(--gold);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    max-width: 580px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    color: var(--gold);
    background: var(--gold-wash);
    border: 1px solid var(--line-gold);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

/* Buttons System */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 28px;
    color: #0c0e12;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border: 1px solid var(--gold);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: 0 8px 24px rgba(229, 183, 87, 0.25);
    overflow: hidden;
    transition: var(--transition);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
    pointer-events: none;
}

.btn:hover::before {
    left: 150%;
}

.btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 40px rgba(229, 183, 87, 0.45), 0 0 24px rgba(229, 183, 87, 0.25);
    background: linear-gradient(135deg, #ffffff, var(--gold-light));
}

.btn i {
    transition: transform 0.3s ease;
}

.btn:hover i {
    transform: scale(1.15) rotate(-5deg);
}

.btn:active {
    transform: translateY(-1px) scale(0.99);
}

.btn.outline {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--line);
    box-shadow: none;
}

.btn.outline:hover {
    color: #0c0e12;
    background: var(--text);
    border-color: var(--text);
    box-shadow: 0 14px 34px rgba(255, 255, 255, 0.2), 0 0 20px rgba(255, 255, 255, 0.1);
}

.btn.btn-sm {
    min-height: 40px;
    padding: 0 16px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn.btn-icon {
    width: 44px;
    height: 44px;
    min-height: auto;
    padding: 0;
    border-radius: 50%;
}

.btn-whatsapp {
    color: #ffffff;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border: 1px solid rgba(37, 211, 102, 0.4);
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #2cf075, #17a694);
    box-shadow: 0 16px 40px rgba(37, 211, 102, 0.4), 0 0 25px rgba(44, 240, 117, 0.3);
}

.btn-cart {
    color: #1a1a2e;
    background: linear-gradient(135deg, #4ecdc4, #44b09e);
    border: 1px solid rgba(78, 205, 196, 0.4);
    box-shadow: 0 8px 24px rgba(78, 205, 196, 0.2);
    transition: all 0.3s ease;
}

.btn-cart:hover {
    color: #1a1a2e;
    background: linear-gradient(135deg, #6ee0d8, #55c4b2);
    box-shadow: 0 16px 40px rgba(78, 205, 196, 0.4), 0 0 25px rgba(110, 224, 216, 0.3);
}

.btn-cart.added {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    border-color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
    transform: scale(1.05);
}
.btn-cart.added i {
    animation: cartPopIn 0.4s ease;
}
@keyframes cartPopIn {
    0% { transform: scale(1); }
    40% { transform: scale(1.4) rotate(-10deg); }
    100% { transform: scale(1); }
}

/* Fly-to-cart particle */
.fly-cart-dot {
    position: fixed;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4ecdc4;
    box-shadow: 0 0 12px rgba(78, 205, 196, 0.7);
    z-index: 9999;
    pointer-events: none;
    animation: flyToCart 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes flyToCart {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(0.6); }
    100% { opacity: 0; transform: scale(0.2); }
}

/* Cart badge bounce */
.cart-badge-count.bounce {
    animation: badgeBounce 0.5s ease;
}
@keyframes badgeBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.5); }
    60% { transform: scale(0.85); }
    100% { transform: scale(1); }
}

/* Avatar cart-hit effect */
.user-profile-btn.cart-hit {
    animation: avatarPulse 0.8s ease;
}
@keyframes avatarPulse {
    0% { box-shadow: 0 0 0 0 rgba(201, 165, 78, 0.7); }
    25% { box-shadow: 0 0 0 12px rgba(201, 165, 78, 0.25); transform: scale(1.12); }
    50% { box-shadow: 0 0 0 6px rgba(201, 165, 78, 0.15); transform: scale(0.95); }
    100% { box-shadow: 0 0 0 0 rgba(201, 165, 78, 0); transform: scale(1); }
}

.btn-buy-contact {
    color: #ffffff;
    background: linear-gradient(135deg, var(--contact-color, #25d366), var(--contact-color-dark, #128c7e));
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-buy-contact:hover {
    color: #ffffff;
    filter: brightness(1.15);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* Keyframes */
@keyframes float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -12px, 0); }
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.5; transform: scale3d(1, 1, 1); }
    50% { opacity: 0.8; transform: scale3d(1.05, 1.05, 1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
