body {
    margin: 0;
    font-family: 'IRANSans', Tahoma, sans-serif;
    direction: rtl;
    background: #fff;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 0 15px;
}

.flex {
    display: flex;
    align-items: center;
}

.between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.top-bar {
    padding: 5px 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    max-height: 45px;
    display: block;
}

.text-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-name {
    font-weight: bold;
    font-size: 15px;
    color: #1c80f2;
}

.divider {
    width: 1px;
    height: 20px;
    background: #ccc;
}

.slogan {
    font-size: 13px;
    color: #666;
}

.support-phone a {
    color: #1c80f2;
    font-weight: bold;
    text-decoration: none;
    margin-right: 20px;
    font-size: 14px;
}

.hamburger {
    display: none;
    font-size: 22px;
    margin-left: 15px;
    cursor: pointer;
    user-select: none;
}

.middle-bar {
    background: #fff;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.main-nav {
    display: flex;
    gap: 10px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:focus {
    color: #1c80f2;
    outline: none;
}

.search-form {
    position: relative;
    flex: 1;
    max-width: 60%;
    display: flex;
    align-items: center;
}

.search-form input {
    background-color: #ebeffa;
    width: 100%;
    padding: 7px 10px 7px 35px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 14px;
    box-sizing: border-box;
    text-align: center;
}

.search-form button {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    cursor: pointer;
    color: #1c80f2;
    font-size: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.cart-icon {
    position: relative;
    font-size: 24px;
    color: #333;
    text-decoration: none;
    margin-left: 20px;
    display: inline-block;
    transition: color 0.3s ease;
}

.cart-icon:hover,
.cart-icon:focus {
    color: #1c80f2;
    outline: none;
}

.cart-icon .count {
    position: absolute;
    top: -11px;
    left: -15px;
    background: #1c80f2;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 1px;
    border-radius: 50%;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    user-select: none;
    line-height: 1;
    white-space: nowrap;
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .top-bar .container {
        justify-content: space-between;
        position: relative;
    }

    .support-phone {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
    }

    .logo-section {
        justify-content: center;
        width: 100%;
    }

    .hamburger {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        display: block;
        z-index: 10000;
    }

    .main-nav {
        flex-direction: column;
        background: #fff;
        padding: 15px 20px;
        position: absolute;
        top: 60px;
        right: 0;
        width: 85vw;
        max-width: fit-content;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        border-radius: 12px;
        z-index: 9999;
        transform: translateX(110%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.35s ease, opacity 0.3s ease;
    }

    .main-nav.open {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
        animation: slideInFromRight 0.35s ease-out;
    }

    @keyframes slideInFromRight {
        0% {
            transform: translateX(100%);
            opacity: 0;
        }

        100% {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .main-nav a {
        padding: 12px 0;
        font-size: 15px;
        border-bottom: 1px solid #f0f0f0;
        color: #333;
        text-align: right;
        transition: all 0.2s ease;
    }

    .main-nav a:hover {
        color: #1c80f2;
        padding-right: 8px;
    }

    .middle-bar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .search-form {
        order: 1;
        flex: 1;
        max-width: 80%;
    }

    .cart-icon {
        order: 2;
        margin-left: 10px;
        font-size: 20px;
    }

    .cart-icon .count {
        top: -10px;
        right: 10px;
        left: 0;
        font-size: 11px;
        min-width: 18px;
    }

    .divider {
        display: none;
    }
}

@media (min-width: 769px) {
    .main-nav {
        display: flex !important;
        transform: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: static !important;
        flex-direction: row !important;
        box-shadow: none !important;
    }
}

/* اصلاح ایکن سبد خرید */
.cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #1b80f2;
    /* رنگ خاکستری ملایم */
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 50%;
    text-align: center;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
    user-select: none;
    padding: 0;
}

.cart-icon {
    position: relative;
    font-size: 24px;
    color: #333;
    text-decoration: none;
    margin: 0 0 0 10px;
    /* اصلاح margin چپ فقط ۱۰px */
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .cart-icon {
        margin-left: 8px;
        font-size: 20px;
    }

    .cart-icon .cart-count {
        top: -6px;
        right: -8px;
        font-size: 10px;
        width: 16px;
        height: 16px;
        line-height: 16px;
    }
}

html,
body {
    overflow-x: hidden;
}

/* غیر فعال سازی موقت سرچ بار */
.search-form {
    visibility: hidden;
}