﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d5016;
    --secondary-color: #4caf50;
    --accent-color: #e67e22;
    --danger-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #333;
    --gray-color: #666;
    --border-color: #e0e0e0;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/*------------------------------------------------------------------------- هدر */


.header-action-login-regester {
    display: flex;
    align-items: center;
}

.btn-login-layout {
    background: transparent;
    color: black;
    border: none;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

    .btn-login-layout:hover {
        transform: translateY(-2px);
    }

.btn-register-layout {
    background: transparent;
    color: black;
    border: 1px solid white;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

    .btn-register-layout:hover {
        transform: translateY(-2px);
    }

/*------------------------------------------------------------------------- هدر */


.announcement-bar {
    background: var(--primary-color);
    color: white;
    padding: 8px 0;
    text-align: center;
    font-size: 0.9rem;
}

    .announcement-bar a {
        color: white;
        text-decoration: underline;
    }

header {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/*------------------------------------------------------------------------- لوگو */

.logo {
    display: flex;
    align-items: center;
    justify-content: start;
}

.logo-image {
    width: clamp(100px, 10vw, 300px);
    height: clamp(30px, 10vw, 100px);
    max-height: 100px;
    display: flex;
}

    .logo-image img {
        width: clamp(100px, 10vw, 300px);
        height: 100%;
        aspect-ratio: 16/10;
        min-height :50px;
        max-height: 100px;
        object-fit: contain;
        transition: transform 0.5s ease;
        object-position: center;
    }

    .logo-image:hover .logo-image img {
        transform: scale(1.05);
    }

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-right: 10px;
}

.logo span {
    color: var(--accent-color);
}

.company-name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    line-height: 1.2;
}

    .company-name h3 {
        font-size: 1rem;
        font-weight: 400;
        color: #666;
        margin: 0;
        letter-spacing: -0.5px;
    }

    .company-name h2 {
        font-size: 2rem;
        font-weight: 800;
        color: #222;
        margin: 0;
        letter-spacing: -1px;
    }

        .company-name h2 span {
            color: #d13c3c; /* رنگ تاکیدی – می‌تواند به رنگ برند شما تغییر کند */
            font-weight: inherit;
        }

/*------------------------------------------------------------------------- پایان لگو و نام کمپانی */

.search-box {
    display: flex;
    align-items: center;
    background: var(--light-color);
    border-radius: 30px;
    padding: 8px 15px;
    width: 40%;
}

    .search-box input {
        border: none;
        background: transparent;
        width: 100%;
        padding: 5px 10px;
        outline: none;
    }

    .search-box i {
        color: var(--gray-color);
        cursor: pointer;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    color: var(--dark-color);
    transition: var(--transition);
    position: relative;
}

    .header-action:hover {
        color: var(--primary-color);
    }

    .header-action i {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .header-action span {
        font-size: 0.8rem;
    }

.cart-count {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* منوی حساب کاربری */
.user-menu {
    position: relative;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    width: 200px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1001;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--dark-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

    .user-dropdown a:last-child {
        border-bottom: none;
    }

    .user-dropdown a:hover {
        background: var(--light-color);
        color: var(--primary-color);
    }

.user-dropdown i {
    margin-left: 10px;
    width: 20px;
    text-align: center;
}

nav {
    background: var(--primary-color);
    padding: 10px 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    justify-content: space-between;
}

    .nav-menu li a {
        color: white;
        text-decoration: none;
        padding: 8px 15px;
        border-radius: 5px;
        transition: var(--transition);
    }

        .nav-menu li a:hover {
            background: rgba(255, 255, 255, 0.1);
        }

.mobile-nav {
    display: none;
    background: white;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    list-style: none;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--dark-color);
    text-decoration: none;
    font-size: 0.8rem;
}

    .mobile-nav-item i {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

/* فوتر */
footer {
    background: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

    .footer-column h3:after {
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        width: 40px;
        height: 2px;
        background: var(--accent-color);
    }

.footer-links {
    list-style: none;
}

    .footer-links li {
        margin-bottom: 10px;
    }

    .footer-links a {
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        transition: var(--transition);
    }

        .footer-links a:hover {
            color: white;
            padding-right: 5px;
        }

.footer-about p {
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.social-links {
    display: flex;
    gap: 15px;
}

    .social-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        color: white;
        transition: var(--transition);
    }

        .social-links a:hover {
            background: var(--accent-color);
            transform: translateY(-3px);
        }

.newsletter p {
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.newsletter-form {
    display: flex;
    margin-bottom: 15px;
}

    .newsletter-form input {
        flex: 1;
        padding: 12px 15px;
        border: none;
        border-radius: 5px 0 0 5px;
        outline: none;
    }

    .newsletter-form button {
        background: var(--accent-color);
        color: white;
        border: none;
        padding: 0 20px;
        border-radius: 0 5px 5px 0;
        cursor: pointer;
        transition: var(--transition);
    }

        .newsletter-form button:hover {
            background: #d35400;
        }

.trust-badges {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.trust-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* دکمه‌های ثابت */
.fixed-buttons {
    position: fixed;
    left: 20px;
    bottom: 90px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 999;
}

.scroll-to-top, .chat-bot {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: var(--transition);
}

.scroll-to-top {
    background: var(--primary-color);
}

.chat-bot {
    background: var(--secondary-color);
}

    .scroll-to-top:hover, .chat-bot:hover {
        transform: scale(1.1);
    }

/* سایدبار سبد خرید */
.sidebar-cart-drawer {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

    .sidebar-cart-drawer.active {
        left: 0;
    }

.sidebar-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

    .sidebar-cart-header h3 {
        font-size: 1.2rem;
        color: var(--primary-color);
    }

.sidebar-close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-color);
}

.sidebar-cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.sidebar-cart-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light-color);
}

    .sidebar-cart-item-image i {
        font-size: 2rem;
        color: var(--primary-color);
        opacity: 0.7;
    }

.sidebar-cart-item-details {
    flex: 1;
}

.sidebar-cart-item-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.sidebar-cart-item-price {
    color: var(--primary-color);
    font-weight: 600;
}

.sidebar-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.sidebar-quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sidebar-quantity {
    margin: 0 10px;
}

.sidebar-remove-item {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
}

.cart-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

    .checkout-btn:hover {
        background: #3d8b40;
    }

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

    .overlay.active {
        opacity: 1;
        visibility: visible;
    }



/* رسپانسیو */

/* ========================================= MEDIA QUERIES FOR RESPONSIVE DESIGN ===== */

/* تبلت - صفحه متوسط (768px تا 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 0 10px;
    }

    .header-top {
        padding: 12px 0;
    }

    .search-box {
        width: 35%;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 5px;
    }

        .nav-menu li a {
            padding: 6px 12px;
            font-size: 0.9rem;
        }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .fixed-buttons {
        left: 15px;
        bottom: 80px;
    }
}

/* تبلت کوچک (576px تا 768px) */
@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 15px;
    }

    .logo {
        order: 1;
        flex: 1;
    }

        .logo h1 {
            font-size: 1.5rem;
        }

    .header-actions {
        order: 2;
        gap: 15px;
    }

    .search-box {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }

    .header-action span {
        display: none;
    }

    .header-action i {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    .user-dropdown {
        left: -50px;
        width: 180px;
    }

    /* مخفی کردن منوی اصلی و نمایش منوی موبایل */
    .nav-menu {
        display: none;
    }

    .mobile-nav {
        display: block;
    }

    /* تنظیمات فوتر */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-column h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .social-links {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
    }

        .newsletter-form input {
            border-radius: 5px;
            margin-bottom: 10px;
        }

        .newsletter-form button {
            border-radius: 5px;
            padding: 12px;
        }

    /* سایدبار سبد خرید */
    .sidebar-cart-drawer {
        width: 90%;
        left: -100%;
    }

    .fixed-buttons {
        left: 10px;
        bottom: 70px;
    }

    .scroll-to-top,
    .chat-bot {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

/* موبایل (360px تا 576px) */
@media (max-width: 576px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }

    .announcement-bar {
        font-size: 0.8rem;
        padding: 6px 0;
        text-align: center;
        width: 100%;
        position: relative;
        left: 0;
        right: 0;
    }

    /* تصحیح کامل هدر */
    header {
        position: sticky;
        top: 0;
        width: 100%;
        left: 0;
        right: 0;
        background: white;
        z-index: 1000;
    }

    .header-top {
        padding: 10px 0;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        position: relative;
        border-bottom: 1px solid green;
    }

    .logo {
        flex: 0 0 auto;
        margin-left: 10px;
    }

        .logo h1 {
            font-size: 1.3rem;
            white-space: nowrap;
        }

    .header-actions {
        display: flex;
        gap: 15px;
        flex: 0 0 auto;
        margin-right: auto;
    }

    .header-action {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
    }

        .header-action i {
            font-size: 1.2rem;
        }

        .header-action span {
            display: none !important; /* مخفی کردن متن در موبایل */
        }

    .cart-count {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
        top: -5px;
        left: -5px;
    }

    .search-box {
        order: 3;
        width: 100% !important;
        margin-top: 10px;
        flex: 0 0 100%;
    }

    /* تصحیح منوی موبایل */
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        padding: 8px 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        border-top: 1px solid var(--border-color);
    }

    .mobile-nav-items {
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 100%;
        list-style: none;
        margin: 0;
        padding: 0 10px;
    }

        .mobile-nav-items li {
            flex: 1;
            text-align: center;
        }

        .mobile-nav-items a {
            color: white;
            transition: var(--transition);
        }

            .mobile-nav-items a:hover {
                background: rgba(255, 255, 255, 0.1);
            }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--dark-color);
        text-decoration: none;
        font-size: 0.7rem;
        padding: 5px;
        width: 100%;
    }

        .mobile-nav-item i {
            font-size: 1.1rem;
            margin-bottom: 3px;
        }

        .mobile-nav-item span {
            font-size: 0.7rem;
        }

    /* مخفی کردن منوی اصلی در موبایل */
    nav {
        display: none !important;
    }

    /* فوتر */
    footer {
        padding: 30px 0 15px;
        margin-top: 30px;
        width: 100%;
        position: relative;
        left: 0;
        right: 0;
    }

    .footer-content {
        gap: 25px;
        display: flex;
        flex-direction: column;
    }

    .trust-badges {
        flex-direction: column;
        gap: 5px;
    }

    .footer-bottom {
        font-size: 0.8rem;
        text-align: center;
        width: 100%;
    }

    /* دکمه‌های ثابت */
    .fixed-buttons {
        position: fixed;
        left: 10px;
        bottom: 70px; /* بالاتر از منوی موبایل */
        display: flex;
        flex-direction: column;
        gap: 10px;
        z-index: 999;
    }

    .scroll-to-top,
    .chat-bot {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    /* سایدبار سبد خرید */
    .sidebar-cart-drawer {
        width: 100%;
        left: -100%;
    }

        .sidebar-cart-drawer.active {
            left: 0;
        }

    .sidebar-cart-header {
        padding: 15px;
    }

    .sidebar-cart-items {
        padding: 15px;
    }

    /* اضافه کردن padding به body برای منوی موبایل */
    body {
        padding-bottom: 60px !important;
    }
}

/* موبایل کوچک (کمتر از 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .search-box {
        padding: 6px 12px;
    }

        .search-box input {
            font-size: 0.9rem;
        }

    .header-actions {
        gap: 8px;
    }

    .header-action i {
        font-size: 1.1rem;
    }

    .mobile-nav-item span {
        font-size: 0.65rem;
    }

    .footer-column h3 {
        font-size: 1rem;
    }

    .footer-links a {
        font-size: 0.9rem;
    }
}

/* ===== IMPROVEMENTS FOR BETTER RESPONSIVE BEHAVIOR ===== */

/* بهبود رفتار اسکرول برای موبایل */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-cart-items {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
    }
}

/* بهبود نمایش برای لنداسکیپ موبایل */
@media (max-height: 500px) and (orientation: landscape) {
    .header-top {
        padding: 8px 0;
    }

    .mobile-nav {
        padding: 5px 0;
    }

    .mobile-nav-item span {
        display: none;
    }

    .fixed-buttons {
        bottom: 50px;
    }
}

/* پشتیبانی از حالت تاریک */
@media (prefers-color-scheme: dark) {
    @media (max-width: 768px) {
        .mobile-nav {
            background: #333;
            border-top: 1px solid #444;
        }

        .mobile-nav-item {
            color: #fff;
        }
    }
}

