/* ====================================================================
   فونت‌های فارسی - وزیر (محلی)
   ==================================================================== */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.woff2') format('woff2'),
         url('../fonts/Vazir.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Bold.woff2') format('woff2'),
         url('../fonts/Vazir-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir-Light.woff2') format('woff2'),
         url('../fonts/Vazir-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* ====================================================================
   1. تنظیمات پایه و ریست (Base & Reset)
   ==================================================================== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

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

/* اعمال فونت وزیر به تمام عناصر */
body, button, input, textarea, select {
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    font-size: 15px;
}

a { text-decoration: none; color: var(--primary-color); }
img { max-width: 100%; height: auto; display: block; }

/* ====================================================================
   2. Layout & Containers
   ==================================================================== */
.container {
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    min-height: 100vh;
    box-shadow: var(--shadow);
}

.content-padding {
    padding: 20px;
}

/* ====================================================================
   3. Typography & Prices - با فونت وزیر
   ==================================================================== */
h1, h2, h3, h4, h5, h6,
.page-title,
.card-title,
.btn,
.final-price,
.old-price,
.price-currency,
.slogan-bar,
.sticky-timer,
footer,
footer a {
    font-family: 'Vazir', 'Tahoma', sans-serif;
}

.page-title {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-main);
}

.price-box {
    background: #f0fdf4;
    border: 1px dashed var(--success-color);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    margin: 20px 0;
}

.old-price {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.final-price {
    color: var(--success-color);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
}

.price-currency {
    font-size: 0.9rem;
    font-weight: normal;
    margin-right: 5px;
}

/* ====================================================================
   4. Components
   ==================================================================== */
.card {
    background: #f9fafb;
    border-right: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.card-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.card-title span { margin-left: 8px; font-size: 1.2rem; }

.btn {
    display: block;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn:active { transform: scale(0.98); }

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-group input, 
.form-group textarea, 
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    direction: rtl;
    transition: border-color 0.2s;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ====================================================================
   5. Header & Footer & Timer
   ==================================================================== */

/* شعار محوری - داخل container */
.slogan-bar {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    text-align: center;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.5s ease-out;
    width: 100%;
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .slogan-bar {
        font-size: 0.95rem;
        padding: 10px;
    }
}

/* تایمر بزرگ و جذاب */
.sticky-timer {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    text-align: center;
    padding: 15px 10px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    animation: pulse-timer 2s infinite;
    border-bottom: 3px solid #fbbf24;
}

.timer-text {
    background: rgba(255, 255, 255, 0.25);
    padding: 5px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    direction: ltr;
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    letter-spacing: 2px;
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes pulse-timer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes glow {
    from { box-shadow: 0 0 5px rgba(255, 255, 255, 0.3); }
    to { box-shadow: 0 0 20px rgba(255, 255, 255, 0.6); }
}

footer {
    background: #1f2937;
    color: #d1d5db;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    line-height: 2;
}

footer a { color: #93c5fd; }

.enamad-container {
    margin: 15px auto;
    display: flex;
    justify-content: center;
}

/* ====================================================================
   6. گالری تصاویر - معماری جدید با transform
   ==================================================================== */
.image-gallery-container {
    position: relative;
    background: #f3f4f6;
    height: 300px;
    overflow: hidden; /* فقط روی گالری، نه کل صفحه */
    margin-bottom: 20px;
    border-radius: 8px;
}

.image-gallery {
    display: flex;
    height: 100%;
    transition: transform 0.4s ease-out; /* انیمیشن نرم */
    will-change: transform; /* بهینه‌سازی عملکرد */
}

.image-gallery img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
}

/* نشانگرهای اسلاید */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.slider-dot.active {
    background: white;
    transform: scale(1.3);
    border-color: var(--primary-color);
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* دکمه‌های ناوبری - با فاصله مناسب */
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s;
    z-index: 10;
}

.slider-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.slider-nav.prev {
    right: 20px; /* فاصله از لبه */
}

.slider-nav.next {
    left: 20px; /* فاصله از لبه */
}

/* مخفی کردن دکمه‌ها در موبایل */
@media (max-width: 480px) {
    .slider-nav {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }
    
    .slider-nav.prev {
        right: 10px;
    }
    
    .slider-nav.next {
        left: 10px;
    }
    
    .image-gallery-container {
        height: 280px;
    }
}

/* ====================================================================
   7. تایمر - معماری جدید بدون reflow
   ==================================================================== */
.timer-text {
    background: rgba(255, 255, 255, 0.25);
    padding: 5px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    direction: ltr;
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 900;
    margin: 0 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    letter-spacing: 2px;
    min-width: 140px; /* عرض ثابت برای جلوگیری از پرش */
    text-align: center;
}

/* هر digit جداگانه */
.timer-digit {
    display: inline-block;
    min-width: 0.6em;
    text-align: center;
}

.timer-separator {
    display: inline-block;
    margin: 0 2px;
}