/* ======================================================
   Behdad - Base Styles (Complete & Cleaned)
   Includes: Reset, Header, Navigation, Footer, Modal, Common components
   ====================================================== */
/* ======================================================
   Force Vazirmatn Font Everywhere
   ====================================================== */
html, body,
button, input, select, textarea,
h1, h2, h3, h4, h5, h6,
p, a, span, li, label, td, th {
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
}

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

body {
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
    background: linear-gradient(to bottom, #f9f9f9, #fff0f5);
    color: #333;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ====================== HEADER ====================== */
.header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    flex-wrap: wrap;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #FF69B4;
}

.logo-text {
    font-size: 1.4rem;
}

/* ====================== NAVIGATION ====================== */
.main-nav {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: center;
}

    .main-nav a {
        text-decoration: none;
        color: #333;
        font-weight: 500;
        transition: color 0.3s;
    }

        .main-nav a:hover {
            color: #FF69B4;
        }

/* ====================== HAMBURGER ====================== */
.hamburger {
    display: none;
    font-size: 1.9rem;
    cursor: pointer;
    color: #FF1493;
    padding: 8px;
    z-index: 1300;
}

@media (max-width: 992px) {
    .hamburger {
        display: block;
    }
}

/* ====================== MOBILE NAV (Clean & Strong) ====================== */
@media (max-width: 992px) {
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 25px rgba(0,0,0,0.25);
        padding: 90px 20px 40px;
        flex-direction: column;
        gap: 8px;
        overflow-y: auto;
        overflow-x: hidden;
        transition: right 0.4s ease;
        z-index: 1200;
    }

        .main-nav.active {
            right: 0;
        }

        .main-nav a {
            padding: 14px 15px;
            font-size: 1.1rem;
            border-bottom: 1px solid #f0f0f0;
        }

        /* ===== MOBILE SUBMENU FIX (Strong Override) ===== */
        .main-nav .menu-item-with-submenu,
        .main-nav .dashboard-parent {
            position: static !important;
            display: flex;
            flex-direction: column;
            width: 100%;
        }

        .main-nav .submenu,
        .main-nav .nested-submenu {
            position: static !important;
            display: none !important;
            width: 100% !important;
            max-width: 100% !important;
            margin: 6px 0 6px 18px !important;
            margin-inline-start: 22px !important;
            padding: 4px 0;
            background: #fdf4f8;
            border: 1px solid #f8d0e0;
            border-radius: 12px;
            box-shadow: none;
            overflow: hidden;
            transition: all 0.25s ease;
        }

            .main-nav .submenu.active,
            .main-nav .nested-submenu.active {
                display: block !important;
            }

            .main-nav .submenu a,
            .main-nav .nested-submenu a {
                padding: 13px 18px;
                font-size: 1.02rem;
                border-bottom: 1px solid #f5d6e6;
                display: flex;
                align-items: center;
                gap: 12px;
                color: #333;
            }

                .main-nav .submenu a:last-child,
                .main-nav .nested-submenu a:last-child {
                    border-bottom: none;
                }

        .main-nav .nested-submenu {
            margin-inline-start: 38px !important;
            width: calc(100% - 55px) !important;
            background: #fff9fc;
        }

        .main-nav .nested-parent::after {
            content: "›";
            margin-right: auto;
            font-size: 1.5rem;
            color: #FF1493;
            font-weight: bold;
        }

    .user-header-row {
        padding: 8px 0;
        flex-wrap: nowrap;
    }
}

/* ====================== DESKTOP SUBMENU ====================== */
.menu-item-with-submenu {
    position: relative;
}

.dashboard-parent {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.submenu-arrow {
    margin-right: auto;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.dashboard-parent.active .submenu-arrow {
    transform: rotate(180deg);
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 12px 0;
    min-width: 230px;
    z-index: 1100;
    margin-top: 8px;
    flex-direction: column;
    border: 1px solid #f0f0f0;
}

    .submenu.active {
        display: flex;
    }

.nested-submenu {
    position: absolute;
    top: 0;
    right: 100%;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    display: none;
    z-index: 1200;
    margin-right: 8px;
}

    .nested-submenu.active {
        display: flex;
    }

    .submenu a,
    .nested-submenu a {
        padding: 10px 20px;
        white-space: nowrap;
        text-decoration: none;
        color: #333;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .submenu a:hover,
        .nested-submenu a:hover {
            background: #fff0f5;
            color: #FF1493;
        }

.nested-parent::after {
    content: "›";
    margin-right: auto;
    font-size: 1.3rem;
}

/* ====================== HEADER ACTIONS ====================== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-login {
    background: #FF69B4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

    .btn-login:hover {
        background: #FF1493;
        transform: scale(1.05);
    }

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 1.4rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FF1493;
    color: white;
    font-size: 0.7rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====================== USER PROFILE (Logged-in Header) ====================== */
.user-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

    .user-profile-link:hover {
        color: #FF1493;
    }

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FF69B4;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(255, 105, 180, 0.3);
}

.user-name-text {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    white-space: nowrap;
}

/* ====================== TRUST BAR ====================== */
.trust-bar {
    background: white;
    padding: 40px 0;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    margin-bottom: 55px;
    border-radius: 16px;
}

.trust-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 35px;
    text-align: center;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
    transition: all 0.3s ease;
}

    .trust-item:hover {
        transform: translateY(-6px);
    }

    .trust-item i {
        font-size: 2.8rem;
        color: #FF1493;
        width: 60px;
        flex-shrink: 0;
    }

    .trust-item div h4 {
        font-size: 1.15rem;
        margin-bottom: 6px;
        color: #222;
        font-weight: 600;
    }

    .trust-item div p {
        font-size: 0.97rem;
        color: #555;
        margin: 0;
    }


/* ====================== HERO SLIDER ====================== */
.hero {
    position: relative;
    height: 480px;
    min-height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.9s ease-in-out;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center 30%;
}

    .hero-slide.active {
        opacity: 1;
        visibility: visible;
    }

    /* گرادینت تیره روی سمت راست (برای خوانایی متن) */
    .hero-slide::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient( to left, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.18) 100% );
        z-index: 1;
    }

/* محتوا سمت راست */
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    justify-content: flex-start; /* در RTL = سمت راست */
    align-items: center;
    height: 100%;
}

/* کارت شیشه‌ای زیبا دور متن */
.hero-text {
    max-width: 460px;
    background: rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 32px 36px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

    .hero-text h1 {
        font-size: clamp(1.75rem, 4.8vw, 2.55rem);
        margin-bottom: 12px;
        color: #ffffff;
        font-weight: 700;
        text-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
        line-height: 1.3;
    }

    .hero-text h2.highlight {
        font-size: clamp(1.9rem, 5.5vw, 2.7rem);
        color: #FF1493;
        margin-bottom: 14px;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    }

    .hero-text p {
        font-size: clamp(1rem, 2.8vw, 1.15rem);
        margin-bottom: 24px;
        color: rgba(255, 255, 255, 0.95);
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
        line-height: 1.6;
    }

    /* دکمه داخل اسلایدر */
    .hero-text .btn-primary {
        background: #FF1493;
        color: white;
        border: none;
        padding: 15px 38px;
        border-radius: 50px;
        font-size: 1.15rem;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 12px 30px rgba(255, 20, 147, 0.45);
        transition: all 0.35s ease;
        display: inline-block;
    }

        .hero-text .btn-primary:hover {
            transform: translateY(-5px) scale(1.04);
            box-shadow: 0 18px 40px rgba(255, 20, 147, 0.55);
            background: #ff0080;
        }

/* کنترل‌های اسلایدر */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 1.9rem;
    color: #FF1493;
    border: none;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

    .slider-btn:hover {
        background: white;
        transform: translateY(-50%) scale(1.12);
    }

    .slider-btn.prev {
        left: 25px;
    }

    .slider-btn.next {
        right: 25px;
    }

.slider-dots {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

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

    .dot.active {
        background: #FF1493;
        border-color: white;
        transform: scale(1.35);
    }

/* ========== موبایل ========== */
@media (max-width: 768px) {
    .hero {
        height: 320px !important;
        min-height: 280px;
    }

    .hero-slide {
        background-position: center 42% !important;
    }
    /*
    .hero-content {
        justify-content: center;
        align-items: flex-start;
        padding: 0;
    }
*/
    .hero-content {
        justify-content: center;
        align-items: flex-end; /* ← شد پایین */
        padding: 0 0 18px 0; /* فاصله از پایین */
    }

    /* نوار یک‌خطی زیبا بالای اسلایدر */
    .hero-text {
        width: 100%;
        max-width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 11px 14px;
        background: rgba(0, 0, 0, 0.72);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 0;
        border: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        white-space: nowrap;
        overflow: hidden;
    }

    /*    .hero-slide::before {
        background: linear-gradient( to bottom, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.35) 35%, rgba(0, 0, 0, 0.1) 100% );
    }*/
    .hero-slide::before {
        background: linear-gradient( to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.45) 40%, rgba(0, 0, 0, 0.1) 100% );
    }
    /* عنوان */
    .hero-text h1 {
        font-size: 0.95rem;
        margin: 0;
        font-weight: 700;
        color: #fff;
        flex-shrink: 0;
    }

    /* توضیح */
    .hero-text p {
        font-size: 0.8rem;
        margin: 0;
        color: rgba(255, 255, 255, 0.9);
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* دکمه */
    .hero-text .btn-primary {
        padding: 7px 14px;
        font-size: 0.8rem;
        border-radius: 50px;
        flex-shrink: 0;
        white-space: nowrap;
        box-shadow: 0 4px 12px rgba(255, 20, 147, 0.4);
    }

    .slider-btn {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
        opacity: 0.9;
    }

        .slider-btn.prev {
            left: 10px;
        }

        .slider-btn.next {
            right: 10px;
        }

    .slider-dots {
        bottom: 14px;
    }
}

@media (max-width: 480px) {
    .hero {
        height: 270px !important;
    }

    .hero-text {
        padding: 9px 12px;
        gap: 8px;
    }

        .hero-text h1 {
            font-size: 0.85rem;
        }

        .hero-text p {
            font-size: 0.75rem;
        }

        .hero-text .btn-primary {
            padding: 6px 12px;
            font-size: 0.75rem;
        }

    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 1.15rem;
    }
}
/* ====================== FOOTER ====================== */
.footer {
    background: #222;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer h4 {
    color: white;
    margin-bottom: 15px;
}

.footer a {
    color: #ccc;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
    transition: color 0.3s;
}

    .footer a:hover {
        color: #FF69B4;
    }

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    margin-top: 30px;
    border-top: 1px solid #444;
    font-size: 0.9rem;
}

/* ====================== GENERAL BUTTON ====================== */
.btn-primary {
    background: #FF1493;
    color: white;
    border: none;
    padding: 16px 52px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(255, 20, 147, 0.4);
    transition: all 0.4s ease;
}

    .btn-primary:hover {
        transform: translateY(-6px) scale(1.05);
        box-shadow: 0 18px 35px rgba(255, 20, 147, 0.5);
    }

/* ====================== MODAL SYSTEM (Behdad - بدون تداخل با Bootstrap) ====================== */
.behdad-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .behdad-modal.hidden {
        display: none !important;
    }

.behdad-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
    backdrop-filter: blur(4px);
}

.behdad-modal-dialog {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 22px;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    margin: 15px;
}

.behdad-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid #f0e0e8;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .behdad-modal-header h3 {
        margin: 0;
        font-size: 1.3rem;
        font-weight: 700;
        color: #222;
    }

.behdad-modal-close-btn {
    background: none;
    border: none;
    font-size: 2.1rem;
    color: #777;
    cursor: pointer;
    line-height: 1;
    padding: 0 10px;
    transition: color .2s;
}

    .behdad-modal-close-btn:hover {
        color: #FF1493;
    }

.behdad-modal-body {
    padding: 24px 28px;
}

/* Login inside modal optimization */
#modal-body .login-page {
    padding: 5px 0;
    min-height: auto;
    background: transparent;
    display: block;
}

#modal-body .login-container {
    box-shadow: none;
    border: 1px solid #f0e0e8;
    max-width: 100%;
}

/* ====================== AUTH BUTTONS ====================== */
.auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-register {
    background: transparent;
    color: #FF1493;
    border: 2px solid #FF69B4;
    padding: 9px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

    .btn-register:hover {
        background: #FF69B4;
        color: white;
        transform: scale(1.05);
        box-shadow: 0 4px 15px rgba(255, 105, 180, 0.3);
    }

.dashboard-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

    .dashboard-link:hover {
        color: #FF69B4;
    }

.submenu-toggle {
    cursor: pointer;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: #FF1493;
}

    .submenu-toggle:hover {
        background: #fff0f5;
    }
/* ====================== LOGO IMAGE ====================== */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #FF69B4;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

    .logo:hover {
        opacity: 0.85;
    }

.logo-img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #FF69B4;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.3);
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.4rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .logo-img {
        width: 36px;
        height: 36px;
    }

    .logo-text {
        font-size: 1.2rem;
    }
}