/* تنظیمات کلی */
html {
    scroll-behavior: smooth;
    /* جلوگیری از اسکرول افقی ناخواسته */
    overflow-x: hidden; 
}

body {
    font-family: 'Vazirmatn', sans-serif;
    overflow-x: hidden; /* اطمینان مضاعف */
    background-color: transparent !important;
    line-height: 1.8; /* افزایش فاصله خطوط برای خوانایی بهتر */
    letter-spacing: 0.02em; /* کمی فاصله بین حروف برای حس لوکس */
    text-rendering: optimizeLegibility; /* بهبود کیفیت رندر فونت */
    -webkit-font-smoothing: antialiased; /* نرم کردن فونت در مک */
    animation: pageFadeIn 0.8s ease-out; /* انیمیشن لود صفحه */
}



/* انیمیشن لود صفحه */
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- ۱. استایل انتخاب متن (Selection) --- */
::selection {
    background-color: #D4AF37;
    color: #ffffff;
}

/* رنگ پس‌زمینه پایه */
html {
    background-color: #faf9f6;
}
html.dark {
    background-color: #050505;
}

/* --- ۲. اسکرول بار لوکس --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent; 
}
body.dark ::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #D4AF37, #AA8C2C);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #C5A028; 
}

/* --- ۳. پس‌زمینه مرمر سلطنتی --- */
.gold-leaf-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    opacity: 1 !important;
    transition: background 0.5s ease;
    background-color: #faf9f6;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.15) 0%, transparent 70%),
        linear-gradient(135deg, rgba(212, 175, 55, 0.05) 25%, transparent 25%),
        linear-gradient(225deg, rgba(212, 175, 55, 0.05) 25%, transparent 25%),
        linear-gradient(45deg, rgba(212, 175, 55, 0.05) 25%, transparent 25%),
        linear-gradient(315deg, rgba(212, 175, 55, 0.05) 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 100% 100%, 60px 60px, 60px 60px, 60px 60px, 60px 60px;
}

body.dark .gold-leaf-bg {
    background-color: #050505;
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.25) 0%, transparent 70%),
        linear-gradient(135deg, rgba(212, 175, 55, 0.08) 25%, transparent 25%),
        linear-gradient(225deg, rgba(212, 175, 55, 0.08) 25%, transparent 25%),
        linear-gradient(45deg, rgba(212, 175, 55, 0.08) 25%, transparent 25%),
        linear-gradient(315deg, rgba(212, 175, 55, 0.08) 25%, transparent 25%);
    background-position: 10px 0, 10px 0, 0 0, 0 0;
    background-size: 100% 100%, 60px 60px, 60px 60px, 60px 60px, 60px 60px;
    opacity: 1 !important;
}

/* --- ۴. ذرات معلق --- */
.particles-container {
    overflow: hidden;
}
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.8);
    animation: floatUp linear infinite;
    bottom: -10px;
}
.p1 { width: 6px; height: 6px; left: 10%; animation-duration: 15s; opacity: 0.5; }
.p2 { width: 8px; height: 8px; left: 25%; animation-duration: 25s; animation-delay: 2s; opacity: 0.3; }
.p3 { width: 4px; height: 4px; left: 50%; animation-duration: 18s; animation-delay: 5s; opacity: 0.6; }
.p4 { width: 10px; height: 10px; left: 70%; animation-duration: 30s; animation-delay: 1s; opacity: 0.4; }
.p5 { width: 5px; height: 5px; left: 90%; animation-duration: 20s; animation-delay: 8s; opacity: 0.5; }

@keyframes floatUp {
    0% { transform: translateY(0) translateX(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(50px) rotate(360deg); opacity: 0; }
}

/* --- ۵. جداکننده‌های منحنی --- */
.custom-shape-divider-bottom svg { display: block; }
.custom-shape-divider-bottom path { fill: rgba(255, 255, 255, 0.3); }
body.dark .custom-shape-divider-bottom path { fill: rgba(0, 0, 0, 0.3); }
.custom-shape-divider-top path { fill: #ffffff; }
body.dark .custom-shape-divider-top path { fill: #000000; }

/* --- ۶. تنظیمات اسلایدر HERO (Super Slider) --- */
.hero-swiper {
    width: 100%;
    /* پدینگ خیلی کم برای صرفه‌جویی در فضا */
    padding-top: 10px; 
    padding-bottom: 25px; 
    overflow: visible;
}

.hero-swiper .swiper-slide {
    background-position: center;
    background-size: cover;
    /* عرض را زیاد کردیم تا در ارتفاع کم، عکس‌ها واضح باشند */
    width: 80%; 
    /* ارتفاع فشرده برای جا شدن در یک صفحه */
    height: 250px; 
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-swiper .swiper-slide .product-card-inner {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    height: 100%;
    transition: all 0.5s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* سایه کمتر */
    overflow: hidden;
    position: relative;
}

/* استایل اسلایدهای عقب */
.hero-swiper .swiper-slide:not(.swiper-slide-active) .product-card-inner {
    transform: scale(0.9) translateY(5px);
    opacity: 0.6;
    filter: blur(1px) grayscale(40%);
}

/* استایل اسلاید فعال */
.hero-swiper .swiper-slide-active .product-card-inner {
    border: 2px solid #D4AF37;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
    transform: scale(1.02) translateY(0);
    z-index: 10;
}

body.dark .hero-swiper .swiper-slide .product-card-inner {
    background: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
body.dark .hero-swiper .swiper-slide-active .product-card-inner {
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* --- تنظیمات دسکتاپ (بدون تغییر) --- */
@media (min-width: 768px) {
    .hero-swiper {
        padding-top: 60px;
        padding-bottom: 70px;
    }
    .hero-swiper .swiper-slide {
        width: 320px;
        height: 480px;
    }
    .hero-swiper .swiper-slide .product-card-inner {
        border-radius: 32px;
    }
    .hero-swiper .swiper-slide:not(.swiper-slide-active) .product-card-inner { 
        filter: blur(2px); opacity: 0.7; transform: scale(0.9); 
    }
    .hero-swiper .swiper-slide-active .product-card-inner { 
        transform: scale(1.1); 
    }
}

.hero-swiper .swiper-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }

.swiper-pagination { bottom: 0 !important; }
.swiper-pagination-bullet { width: 5px; height: 5px; background: rgba(212, 175, 55, 0.3); margin: 0 3px !important; }
.swiper-pagination-bullet-active { width: 15px; height: 5px; border-radius: 10px; background: #D4AF37 !important; }


/* تنظیم نقاط پایین اسلایدر */
.swiper-pagination {
    bottom: 0 !important;
}
.swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: rgba(212, 175, 55, 0.3);
    opacity: 1;
    margin: 0 4px !important;
}
.swiper-pagination-bullet-active {
    width: 24px; /* کشیده‌تر شدن نقطه فعال */
    height: 6px;
    border-radius: 10px;
    background: #D4AF37 !important;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

/* انیمیشن‌ها */
@keyframes slideIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast-enter { animation: slideIn 0.3s ease-out forwards; }

/* افکت دکمه‌ها */
button, a.btn-gold { position: relative; overflow: hidden; cursor: pointer; }
button::after, a.btn-gold::after { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent); transition: 0.6s; }
button:hover::after, a.btn-gold:hover::after { left: 100%; }
button:hover, a.btn-gold:hover { box-shadow: 0 0 20px rgba(212, 175, 55, 0.6); }

/* بهبود فوکوس برای دسترسی‌پذیری */
:focus-visible { outline: 2px solid #D4AF37; outline-offset: 2px; }

nav button { border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; overflow: visible; }
nav button i { font-size: 1.1rem; }
nav button::after { display: none; }

.nav-link { position: relative; text-decoration: none; font-weight: 500; }
.nav-link::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -4px; right: 0; background-color: #D4AF37; transition: width 0.3s ease-out; }
.nav-link:hover::after { width: 100%; }

.fa-shopping-bag + span { font-family: 'Vazirmatn', sans-serif !important; font-feature-settings: "ss01"; padding-top: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.2); border: 2px solid #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 0.7rem; display: flex; align-items: center; justify-content: center; line-height: 1; position: absolute; top: -4px; right: -4px; }
body.dark .fa-shopping-bag + span { border-color: #1a1a1a; }

.swiper-button-next, .swiper-button-prev { color: #D4AF37 !important; text-shadow: 0 0 10px rgba(0,0,0,0.5); }
.swiper-pagination-bullet-active { background-color: #D4AF37 !important; }

/* حل مشکل هم‌پوشانی نام کاربر در نوار ناوبری */
nav .flex.items-center.space-x-2.md\/space-x-4 {
    gap: 1.25rem !important; /* افزایش فاصله بین المان‌ها */
}

@media (min-width: 768px) {
    .nav-link + div.relative.group {
        margin-right: 1.5rem;
    }
}

/* جلوگیری از شکسته شدن نام کاربر */
span.whitespace-nowrap {
    padding: 0 8px;
    display: inline-block;
}

