/* تنظیمات پایه */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background-color: #f9f9f9;
    color: #333;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    line-height: 1.6;
}

body {
    padding-top: 150px;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

.header-logo img, .main-site-header img {
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
    display: inline-block !important;
}

.site-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin: 15px auto;
}
.page-body img { max-width: 100%; height: auto; }

footer { background: #333; color: #fff; text-align: center; padding: 20px; margin-top: 40px; }

.main-site-header {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
}

.top-banner-bar {
    background: #ef394e;
    color: #fff;
    width: 100%;
    padding: 10px 0;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    display: block;
    text-decoration: none;
}
.banner-content {
    background: #2b7a62;
    padding: 4px 20px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.badge-discount { background: #0056b3; padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.header-middle-row {
    padding: 10px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #fff;
}
.header-logo h1 { font-size: 24px; color: #ef394e; margin: 0; }

.header-search-box {
    width: 400px;
    margin-right: 10px;
    margin-left: auto;
}
.header-search-box form { position: relative; display: flex; align-items: center; width: 100%; }
.header-search-box input {
    width: 100%;
    background: #f0f0f1;
    border: none;
    padding: 10px 45px 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}
.header-search-box .search-icon { position: absolute; right: 15px; color: #707579; }

.header-actions { display: flex; align-items: center; gap: 15px; }
.login-register-btn {
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #3f4064;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}
.action-btn { font-size: 18px; color: #3f4064; text-decoration: none; display: flex; }
.divider-vertical { width: 1px; height: 20px; background: #e0e0e0; }

.header-bottom-row {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 10px 20px;
    display: flex;
    align-items: center;
    border-top: 1px solid #f0f0f1;
    padding-top: 8px;
    background: #fff;
}
.right-nav-links { display: flex; align-items: center; gap: 25px; }
.quick-links ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.quick-links a { text-decoration: none; color: #616161; font-size: 13px; display: flex; align-items: center; gap: 5px; }
.quick-links a:hover { color: #ef394e; }

.categories-dropdown-container { position: relative; }
.categories-dropdown-toggle { font-weight: bold; font-size: 14px; color: #23254e; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 8px 0; }

.categories-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 240px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    display: none;
    opacity: 0;
    visibility: hidden;
    padding: 10px 0;
    border: 1px solid #f0f0f1;
    z-index: 1100;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.categories-dropdown-container:hover .categories-dropdown-menu {
    display: block;
    opacity: 1;
    visibility: visible;
}

.categories-dropdown-menu ul { list-style: none; margin: 0; padding: 0; }
.categories-dropdown-menu li { position: relative; }
.categories-dropdown-menu li a {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
}
.categories-dropdown-menu li a:hover { background: #f9f9f9; color: #ef394e; }
.submenu-arrow { margin-right: auto; font-size: 11px; color: #707579; }

.categories-dropdown-menu .submenu {
    position: absolute;
    top: 0;
    right: 100%;
    width: 220px;
    background: #fff;
    box-shadow: 4px 4px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 10px 0;
    border: 1px solid #f0f0f1;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    transition-delay: 0.2s;
}

.categories-dropdown-menu li.has-submenu:hover > .submenu {
    opacity: 1;
    visibility: visible;
    display: block;
}

/* اسلایدر اصلی دسکتاپ (فاصله ۴ پیکسل از بالا برای خارج شدن از زیر هدر) */
.main-slider-container {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 400px;
    margin-top: 30px; 
    margin-bottom: 30px;
    overflow: hidden;
    background: #fff;
    direction: ltr;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
    transform: translateX(0);
}

.slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    position: relative;
    flex-shrink: 0;
}

.slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-controls-group {
    position: absolute;
    bottom: 15px;
    right: 25px;
    display: flex;
    gap: 5px;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.main-slider-container:hover .slider-controls-group {
    opacity: 1;
    visibility: visible;
}

.slider-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s, transform 0.2s;
}

.slider-btn:hover {
    background: #fff;
    transform: scale(1.05);
}

.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, width 0.3s;
}

.dot.active {
    background: #ef394e;
    width: 22px;
    border-radius: 4px;
}

/* واکنش‌گرا: تبلت (فاصله ۱۰ پیکسل از بالا و نمایش گوشه‌های گرد برای اسلایدها) */
@media screen and (max-width: 1024px) {
    .main-slider-container {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 280px;
        padding: 0 15px;
        box-sizing: border-box;
        overflow: hidden;
        margin-top: 35px !important;
    }
    .slide {
        min-width: 100% !important;
        width: 100% !important;
        padding: 0 5px;
        box-sizing: border-box;
    }
    .slide img {
        border-radius: 12px;
    }
    .slider-controls-group, .slider-dots {
        display: none !important;
    }
}

/* واکنش‌گرا: موبایل (نمایش ثابت لبه‌های کناری) */
@media screen and (max-width: 768px) {
    body { padding-top: 110px; }
    .header-actions, .header-bottom-row, .header-logo { display: none !important; }
    .header-middle-row { flex-direction: column; gap: 5px; padding: 5px; }
    .header-search-box { width: 100%; margin: 0 !important; }
    
    .main-slider-container {
        width: 100vw !important;
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        height: 190px !important;
        margin-top: -5px !important;
        margin-bottom: 20px !important;
        padding: 0 !important;
        border-radius: 0 !important;
        overflow: hidden !important;
        direction: ltr !important; /* مهم برای محاسبه درست فاصله */
    }

    .slider-wrapper {
        display: flex !important;
        /* پدینگ در دو طرف کانتینر برای ایجاد فضای خالی */
        padding: 0 15px !important; 
        box-sizing: border-box !important;
    }

    .slide {
        /* عرض اسلاید رو کمتر از 100 میذاریم (مثلا 85%) تا لبه‌های کناری دیده بشن */
        min-width: 99% !important; 
        width: 99% !important;
        /* فاصله بین اسلایدها */
        padding: 0 3px !important; 
        box-sizing: border-box !important;
        flex-shrink: 0 !important;
    }

    .slide img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 12px !important;
    }
}