
/* --- استایل‌های اصلی، ریسپانسیو و فونت وزیرمتن --- */
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Regular.ttf') format('truetype'); font-weight: normal; font-style: normal; }
@font-face { font-family: 'Vazirmatn'; src: url('../fonts/Vazirmatn-Bold.ttf') format('truetype'); font-weight: bold; font-style: normal; }
body { font-family: 'Vazirmatn', Tahoma, sans-serif; background-color: #f4f4f9; color: #333; margin: 0; padding-bottom: 80px; }
.container { max-width: 1200px; margin: 20px auto; padding: 0 15px; }
h1 { text-align: center; color: #0056b3; padding: 20px 0; border-bottom: 2px solid #ddd; margin-bottom: 20px; }

/* هدر سکشن‌ها */
.section-header { background-color: #e9ecef; padding: 15px; cursor: pointer; border: 1px solid #ccc; border-radius: 5px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; font-weight: bold; }
.header-title-wrap { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.section-price-display { font-size: 0.9em; color: #0056b3; font-weight: bold; background: #eef7ff; padding: 4px 10px; border-radius: 5px; border: 1px dashed #0056b3; }
.section-content { border: 1px solid #eee; padding: 15px; margin-bottom: 20px; border-radius: 5px; background-color: #fff; display: none; }
.section-content.open { display: block; }
.arrow { font-size: 1.2em; transition: transform 0.3s; }

/* کادربندی پیج‌ها و زبان‌ها */
.primary-page-item, .dynamic-language-item { padding: 15px; border: 2px solid #ffc107; margin-bottom: 20px; border-radius: 8px; background-color: #fffdf2; box-shadow: 0 4px 8px rgba(0,0,0,0.05); position: relative; }
.page-title-row { display: flex; align-items: center; background-color: #fff; padding: 8px 12px; border-radius: 5px; border-right: 4px solid #0056b3; border-bottom: 1px solid #eee; margin-bottom: 15px; }
.page-badge { font-weight: bold; color: #0056b3; margin-left: 10px; white-space: nowrap; }
.page-desc-input { flex: 1; height: 32px !important; margin-top: 0 !important; font-size: 13px !important; border: 1px dashed #ccc !important; background-color: transparent; }
.page-desc-input:focus { background-color: #fff; border: 1px solid #0056b3 !important; }

/* فرم‌ها و اعداد */
input[type="text"], select { width: 100%; height: 45px; padding: 5px 10px; margin-top: 5px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-family: 'Vazirmatn', Tahoma, sans-serif; font-size: 15px; direction: rtl; }
textarea { width: 100%; padding: 10px; border: 1px dashed #ccc; border-radius: 4px; font-family: 'Vazirmatn'; font-size: 14px; margin-top: 5px; background: #fafafa; resize: vertical; min-height: 80px;}
textarea:focus { border: 1px solid #0056b3; background: #fff; outline: none; }

.spinner-box { display: flex; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; background: #fff; height: 45px; align-items: center; }
.spinner-box input { flex: 1; border: none !important; margin: 0 !important; border-radius: 0 !important; text-align: center !important; padding: 0 5px !important; height: 100% !important; outline: none !important; }
.spinner-btn { width: 35px; height: 100%; background-color: #f8f9fa; border: none; cursor: pointer; font-size: 18px; font-weight: bold; color: #495057; display: flex; justify-content: center; align-items: center; transition: background 0.2s; padding: 0; margin: 0; }
.spinner-btn:hover { background-color: #e2e6ea; }

/* سوئیچ‌ها و چک‌باکس‌ها */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: #28a745; }
input:checked + .slider:before { transform: translateX(20px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px; background: #fff; border: 1px solid #eee; border-radius: 5px; margin-bottom: 8px; }

/* استایل‌های کمکی */
.price-display, .lang-price-display { font-weight: bold; color: #28a745; margin-right: 5px; }
.info-icon { cursor: pointer; color: #007bff; font-weight: bold; margin-left: 5px; border: 1px solid #007bff; border-radius: 50%; width: 20px; height: 20px; text-align: center; line-height: 18px; display: inline-block; }
.hidden-subtitle-box { display: none; padding: 12px; background: #f8fbff; border: 1px solid #cce5ff; border-radius: 5px; margin-bottom: 8px; margin-top: -5px; color: #333; }
.hint-text { font-size: 0.85em; color: #6c757d; font-weight: normal; margin-right: 10px;}

.sub-options { background: #fff; border: 1px solid #e9ecef; border-right: 3px solid #007bff; padding: 10px; margin-top: 5px; margin-bottom: 10px; border-radius: 4px; display: none; }
.checkbox-item { display: flex; align-items: center; margin-bottom: 10px; }
.checkbox-item input[type="checkbox"] { margin-left: 10px; width: 18px; height: 18px; cursor: pointer;}
.checkbox-item label { margin-bottom: 0; cursor: pointer; font-weight: normal;}

/* فوتر و دکمه‌ها */
.sticky-footer { position: fixed; bottom: 0; left: 0; right: 0; background-color: #343a40; color: white; padding: 12px 20px; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); display: flex; justify-content: space-between; align-items: center; z-index: 1000; }
.footer-price-wrap { font-weight: bold; font-size: 1.1em; }
#totalPriceDisplay { font-size: 1.5em; color: #ffc107; }
.footer-buttons-wrap { display: flex; gap: 10px; }
.action-btn { padding: 8px 15px; border: none; border-radius: 5px; cursor: pointer; font-weight: bold; font-family: inherit; display: flex; align-items: center; gap: 5px; transition: 0.2s; position: relative; }
.action-btn:hover { opacity: 0.8; }

/* پاپ‌آپ‌ها */
.modal-popup { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: white; padding: 25px; border: 2px solid #007bff; z-index: 2000; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.2); width: 90%; max-width: 600px; max-height: 85vh; overflow-y: auto; }
.modal-popup h3 { margin-top: 0; color: #0056b3; font-size: 1.3em; border-bottom: 1px solid #eee; padding-bottom: 10px; margin-bottom: 15px; text-align: center; }
.modal-popup p { font-size: 0.95em; line-height: 1.7; margin-bottom: 12px; }
.modal-popup button.close-btn { margin-top: 15px; background-color: #6c757d; color: white; padding: 8px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; display: block; margin-left: auto; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1999; }

/* موبایل */
@media (max-width: 768px) {
    body:not(.force-desktop) .sticky-footer { padding: 10px 15px; }
    body:not(.force-desktop) .footer-price-wrap { font-size: 0.9em; }
    body:not(.force-desktop) #totalPriceDisplay { font-size: 1.3em; }
    body:not(.force-desktop) .action-btn .desktop-text { display: none; }
    body:not(.force-desktop) .header-title-wrap { flex-direction: column; align-items: flex-start; gap: 5px; }
    /* اصلاح سایز پاپ آپ در موبایل */
    .modal-popup { padding: 15px; width: 85%; }
    .modal-popup h3 { font-size: 1.1em; margin-bottom: 10px; }
    .modal-popup p { font-size: 0.85em; line-height: 1.5; margin-bottom: 10px; text-align: justify; }
    .modal-popup button.close-btn { padding: 6px 15px; font-size: 0.9em; margin-top: 10px; }
}

/* خروجی PDF */
.force-desktop { width: 1200px !important; max-width: none !important; margin: 0 auto !important; overflow-x: hidden !important; }
.force-desktop .container { width: 1170px !important; max-width: 1170px !important; }
.force-desktop * { animation: none !important; transition: none !important; }
.force-desktop .hidden-subtitle-box, .force-desktop .sub-options { color: #000 !important; opacity: 1 !important; }

/* --- Header Styles --- */
body {
padding-top: 75px; 
}

.acoa-header {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(10px);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
z-index: 1000;
direction: rtl;
border-bottom: 1px solid #eaeaea;
}

.header-container {
display: flex;
justify-content: space-between;
align-items: center;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
height: 65px; 
}

/* Logo and Text */
.header-logo {
display: flex;
flex-direction: column;
align-items: center; 
justify-content: center;
}
.acoa-logo {
height: 40px; 
width: auto;
object-fit: contain;
margin-bottom: 2px;
}
.logo-subtext {
font-size: 10px;
color: #666;
font-weight: 500;
white-space: nowrap;
letter-spacing: -0.3px;
}

/* Navigation Buttons (Desktop) */
.header-nav {
display: flex;
gap: 10px;
align-items: center;
}

.nav-btn {
display: flex;
align-items: center;
gap: 5px;
padding: 7px 14px;
border-radius: 6px;
font-family: inherit;
font-size: 12.5px;
font-weight: bold;
text-decoration: none;
cursor: pointer;
border: 1px solid transparent;
transition: all 0.3s ease;
}

.nav-btn svg {
margin-left: 2px;
}

.btn-orange { background-color: #fff4ed; color: #ff7a00; border-color: #ffd6b8; }
.btn-orange:hover { background-color: #ff7a00; color: #fff; }

.btn-purple { background-color: #f5f0ff; color: #8b5cf6; border-color: #ddd0f8; }
.btn-purple:hover { background-color: #8b5cf6; color: #fff; }

.btn-blue { background-color: #f0f7ff; color: #007aff; border-color: #cce4ff; }
.btn-blue:hover { background-color: #007aff; color: #fff; }

/* --- Hamburger Menu --- */
.hamburger-btn {
display: none;
flex-direction: column;
justify-content: space-between;
width: 28px;
height: 20px;
background: transparent;
border: none;
cursor: pointer;
z-index: 1001;
}

.hamburger-btn .bar {
height: 3px;
width: 100%;
background-color: #333;
border-radius: 10px;
transition: all 0.3s ease;
}

/* =======================================================
استایل‌های پاپ‌آپ ویدئو (مخصوص ویدئو عمودی)
این بخش باید خارج از رسپانسیو موبایل باشد
======================================================== */
.video-modal {
display: none; /* در حالت عادی مخفی است */
position: fixed;
z-index: 2000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(5px);
}

.video-modal-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 90%;
/* تغییر مهم: چون ویدئو عمودی است، حداکثر عرض را کم کردیم تا شبیه موبایل شود */
max-width: 400px; 
/* تغییر مهم: جلوگیری از بیرون زدن ویدئو از صفحه دسکتاپ */
max-height: 90vh; 
background: #000;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.close-video {
position: absolute;
top: -4px;
right: 15px;
color: white;
font-size: 35px;
font-weight: bold;
cursor: pointer;
z-index: 2001;
transition: color 0.3s ease;
text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.close-video:hover {
color: #ff7a00;
}

#acoa-video {
width: 100%;
max-height: 90vh; /* تنظیم ارتفاع برای ویدئو عمودی */
display: block;
border-radius: 12px;
object-fit: contain; /* جلوگیری از کشیده شدن تصویر */
}

/* --- Responsive Design (Mobile) --- */
@media screen and (max-width: 850px) {
.header-container {
height: 55px; 
padding: 0 15px;
}

body {
padding-top: 65px;
}

.acoa-logo {
height: 30px; 
margin-bottom: 2px;
}

.logo-subtext {
font-size: 8.5px; 
}

.hamburger-btn {
display: flex;
}

.header-nav {
position: absolute;
top: 55px; 
left: 0;
width: 100%;
background-color: #fff;
flex-direction: column;
padding: 0;
box-shadow: 0 10px 15px rgba(0,0,0,0.1);
border-bottom: 2px solid #ff7a00;
max-height: 0;
overflow: hidden;
transition: max-height 0.4s ease-in-out;
}

.header-nav.active {
max-height: 250px;
padding: 15px 20px;
}

.nav-btn {
width: 100%;
justify-content: center;
padding: 10px;
margin-bottom: 5px;
font-size: 14px;
}

.hamburger-btn.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger-btn.active .bar:nth-child(2) { opacity: 0; }
.hamburger-btn.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}

/* --- حل مشکل بیرون‌زدگی و اسکرول افقی چک‌باکس‌ها در موبایل --- */

/* 1. اجازه شکستن متن‌های طولانی در چک‌باکس‌ها */
.checkbox-item {
    white-space: normal !important; 
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* 2. جلوگیری از بیرون‌زدگی کادر دربرگیرنده چک‌باکس‌های فروشگاهی */
#s5_shop_extras {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
}

/* 3. اگر احیاناً در فایل‌های دیگر CSS به این کادرها flex داده شده، حتماً شکسته شوند */
.checkbox-item, 
#s5_shop_extras {
    flex-wrap: wrap !important;
}

.spinner-box input {
    min-width: 60px;
    text-align: center;
    font-size: 16px;
    padding: 0 8px;
}

@media (max-width: 768px) {
    .spinner-box {
        min-width: 120px !important;
        width: 120px !important;
        flex: 0 0 120px !important;
    }

    .spinner-box input {
        min-width: 48px !important;
        width: 48px !important;
        font-size: 16px !important;
        text-align: center !important;
    }
}
