/*
Theme Name: تاها مارت
Theme URI: https://tahamc.ir
Author: احمد رحیمی
Author URI: https://tahamc.ir
Description: تم فروشگاهی حرفه‌ای و ریسپانسیو برای ووکامرس با الهام از دیجی‌کالا
Version: 1.0.0
License: GPL v2 or later
Text Domain: tahamart
Domain Path: /languages
WC requires at least: 6.0
WC tested up to: 8.5
*/

/* ==========================================
   ریشه و متغیرها
   ========================================== */
:root {
    --primary: #dc3545;
    --primary-hover: #b02a37;
    --secondary: #0d6efd;
    --green: #198754;
    --bg-body: #f5f5f7;
    --border-radius: 12px;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
    --font: 'Vazirmatn', 'Tahoma', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-body);
    color: #333;
    direction: rtl;
    font-family: var(--font);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 15px;
}

.flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================
   هدر بالا
   ========================================== */
.header-top {
    background: #fff;
    padding: 14px 0;
    border-bottom: 1px solid #e2e2e2;
}

.logo {
    color: var(--primary);
    font-size: 28px;
    font-weight: 800;
}

.logo img {
    max-height: 50px;
}

.search-wrap {
    flex: 1;
    margin: 0 35px;
    background: #f1f3f4;
    border-radius: 30px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
}

.search-wrap input {
    border: none;
    background: transparent;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.header-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-btns .btn {
    background: #fff;
    border: 1px solid #e2e2e2;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
}

.header-btns .btn:hover {
    border-color: var(--primary);
}

.cart-btn {
    position: relative;
    border: none;
    background: transparent;
    font-size: 22px;
    color: #333;
}

.cart-badge {
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    padding: 1px 7px;
    position: absolute;
    top: -6px;
    left: -4px;
    font-weight: bold;
}

.address-row {
    background: #fff;
    border-bottom: 1px solid #e2e2e2;
    padding: 8px 15px;
    color: #934c0e;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ==========================================
   نوار ناوبری و مگا منو
   ========================================== */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e2e2e2;
    height: 55px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 9999;
    overflow: visible !important;
}

.navbar .container {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 30px;
    overflow: visible !important;
    position: relative;
    width: 100%;
}

/* آیتم‌های منوی وردپرس */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
}

.nav-menu li {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
}

.nav-menu li:hover {
    color: var(--primary);
}

.nav-menu li a {
    color: inherit;
}

/* مگا تریگر (دسته‌بندی کالاها) - در سمت راست */
.mega-trigger {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    background: #f8f9fa;
    border-left: 1px solid #e2e2e2;
    z-index: 99999;
    transition: 0.2s;
}

.mega-trigger:hover {
    color: var(--primary);
    background: #fff;
}

.mega-trigger i {
    margin-left: 8px;
}

/* ===== مگا منو ===== */
.mega-wrapper {
    position: fixed;
    top: 110px;
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 18px 18px;
    display: none;
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 99998;
    padding: 30px 0;
    min-height: 320px;
}

.mega-trigger:hover .mega-wrapper {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.mega-inner {
    display: flex;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 0;
}

.mega-sidebar {
    flex: 0 0 180px;
    border-left: 1px solid #f0f0f0;
    padding: 0 20px;
}

.mega-sidebar ul li {
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    transition: 0.2s;
    cursor: pointer;
}

.mega-sidebar ul li:hover {
    background: #f8f9fa;
    color: var(--primary);
    padding-right: 16px;
}

.mega-content {
    flex: 1;
    padding: 0 25px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mega-col h4 {
    color: #888;
    font-size: 13px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
}

.mega-col ul li {
    font-size: 13.5px;
    color: #555;
    padding: 6px 0;
    transition: 0.2s;
    cursor: pointer;
}

.mega-col ul li:hover {
    color: var(--primary);
    transform: translateX(-5px);
}

.mega-banner {
    flex: 0 0 270px;
    padding: 0 15px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9fc;
}

.mega-banner img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    max-height: 220px;
}

/* ==========================================
   اسلایدر اصلی
   ========================================== */
.hero-wrapper {
    position: relative;
    z-index: 1;
    margin: 25px 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero {
    height: 260px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 40px;
    background-size: cover;
    background-position: center;
    transition: background 0.5s;
    position: relative;
}

.hero-content {
    z-index: 2;
    position: relative;
}

/* ==========================================
   آیکون‌های سریع
   ========================================== */
.quick-icons {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px 0;
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    flex-wrap: wrap;
}

.q-item {
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    flex: 0 0 12%;
    min-width: 70px;
}

.q-item:hover {
    transform: translateY(-6px);
}

.q-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 10px;
    overflow: hidden;
}

.q-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.q-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #444;
}

/* ==========================================
   بنرها
   ========================================== */
.banner-row-2 {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
}

.banner-half {
    flex: 1;
    height: 160px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
}

.banner-half img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
}

.banner-half span {
    z-index: 2;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.banner-row-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.banner-quarter {
    height: 130px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    gap: 8px;
}

.banner-quarter:hover {
    transform: translateY(-4px);
}

/* ==========================================
   پیشنهاد شگفت‌انگیز قرمز (با تایمر)
   ========================================== */
.amazing-red-box {
    background: linear-gradient(225deg, #d22c4e, #ee384e);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.2);
}

.amazing-red-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    color: #fff;
}

.amazing-red-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
}

.amazing-red-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: bold;
}

.timer-box {
    background: #fff;
    color: #333;
    border-radius: 4px;
    padding: 2px 6px;
    min-width: 30px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.timer-sep {
    color: #fff;
    font-size: 22px;
}

.amazing-red-link {
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.amazing-red-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.amazing-red-card {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    flex: 0 0 auto;
    min-width: 130px;
    text-align: center;
    position: relative;
}

.amazing-red-card img {
    width: 100%;
    height: 100px;
    object-fit: contain;
}

.amazing-red-card .price {
    font-weight: 700;
    margin-top: 8px;
    font-size: 14px;
    color: #333;
}

.amazing-red-card .discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.amazing-red-card .old-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    display: block;
}

/* ==========================================
   پیشنهاد شگفت‌انگیز سبز
   ========================================== */
.amazing-green-box {
    background: linear-gradient(135deg, #198754, #20c997);
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    color: #fff;
}

.amazing-title {
    text-align: center;
    min-width: 80px;
}

.amazing-title span {
    font-size: 22px;
    font-weight: 800;
    display: block;
}

.amazing-title small {
    font-size: 12px;
    opacity: 0.8;
}

.amazing-list {
    flex: 1;
    display: flex;
    gap: 12px;
    overflow-x: auto;
}

.amazing-card {
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    flex: 0 0 auto;
    min-width: 120px;
    text-align: center;
    color: #333;
    position: relative;
}

.amazing-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.amazing-card .price {
    font-weight: 700;
    margin-top: 10px;
    font-size: 14px;
    color: #198754;
}

.amazing-card .discount {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: bold;
}

/* ==========================================
   ویژه‌های دیجی‌کالا
   ========================================== */
.features-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 25px;
}

.feature-card {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: 0.3s;
}

.feature-card:hover {
    transform: translateY(-6px);
}

.feature-card i {
    font-size: 32px;
    margin-bottom: 12px;
}

/* ==========================================
   برندها (خطی)
   ========================================== */
.brand-row {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px 25px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: var(--shadow);
}

.brand-row img {
    height: 32px;
    opacity: 0.6;
    transition: 0.3s;
    filter: grayscale(100%);
    object-fit: contain;
}

.brand-row img:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.1);
}

/* ==========================================
   بخش‌های محصولات (کارت‌ها)
   ========================================== */
.section-wrapper {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.sec-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.sec-header h3 {
    font-size: 17px;
    color: #222;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-header a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.p-card {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: 0.3s;
    background: #fff;
    position: relative;
}

.p-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.1);
    transform: translateY(-6px);
}

.p-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
}

.p-card h4 {
    text-align: right;
    font-size: 13.5px;
    font-weight: 500;
    height: 42px;
    overflow: hidden;
    margin: 12px 0;
    line-height: 1.4;
}

.p-card .price {
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    color: #222;
}

.p-card .add-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    width: 100%;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.p-card .add-btn:hover {
    background: var(--primary-hover);
}

.p-card .add-btn.added {
    background: var(--green);
    cursor: default;
}

/* ==========================================
   اسلایدرهای افقی (ویتامین‌ها، کاورها)
   ========================================== */
.horizontal-slider-section {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.hs-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.hs-header h4 {
    font-size: 17px;
    font-weight: bold;
    color: #222;
}

.hs-header a {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hs-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.hs-card {
    min-width: 160px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #fff;
    flex-shrink: 0;
    position: relative;
}

.hs-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
}

.hs-card h5 {
    font-size: 13px;
    font-weight: normal;
    height: 36px;
    overflow: hidden;
    margin: 8px 0;
    text-align: right;
}

.hs-card .price {
    font-weight: bold;
    font-size: 14px;
    text-align: left;
}

.hs-card .old-price {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    display: block;
    text-align: left;
}

.hs-card .discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

/* ==========================================
   اسلایدرهای رتبه‌بندی (پرفروش‌ترین، داغ‌ترین)
   ========================================== */
.ranking-slider-section {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    position: relative;
}

.ranking-slider-wrapper {
    position: relative;
    overflow: hidden;
}

.ranking-slider-track {
    display: flex;
    transition: transform 0.4s ease;
    gap: 12px;
}

.ranking-slide {
    flex: 0 0 calc(33.333% - 8px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
    transition: 0.3s;
}

.ranking-item:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ranking-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
}

.ranking-rank.top-rank {
    background: var(--primary);
    color: #fff;
}

.ranking-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ranking-content img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-info h4 {
    font-size: 13px;
    font-weight: 500;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-info .price {
    font-weight: 700;
    font-size: 14px;
    color: #222;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e2e2e2;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: 0.3s;
    color: #333;
    font-size: 18px;
}

.slider-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--primary);
}

.slider-btn.prev-btn {
    right: -10px;
}

.slider-btn.next-btn {
    left: -10px;
}

.slider-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ==========================================
   برندهای دایره‌ای
   ========================================== */
.circle-brands-section {
    margin-bottom: 25px;
}

.circle-brands-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.circle-brands-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.circle-brand-card {
    min-width: 90px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: 0.3s;
}

.circle-brand-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.circle-brand-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: #f9f9f9;
    border-radius: 50%;
    margin-bottom: 8px;
}

.circle-brand-card span {
    font-size: 12px;
    font-weight: 600;
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ==========================================
   فوتر
   ========================================== */
.footer-new {
    background: #fff;
    border-top: 1px solid #e2e2e2;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h5 {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-col ul li {
    font-size: 13.5px;
    color: #555;
    padding: 5px 0;
    cursor: pointer;
}

.footer-col ul li:hover {
    color: var(--primary);
    padding-right: 6px;
}

.footer-bottom {
    border-top: 1px solid #eee;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #888;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.socials {
    display: flex;
    gap: 15px;
}

.socials a {
    color: #888;
    font-size: 20px;
}

.socials a:hover {
    color: var(--primary);
}

/* ==========================================
   المان‌های UI (توست، دکمه بازگشت، چسبنده)
   ========================================== */
.toast-notif {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: #333;
    padding: 16px 35px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: 0.4s;
    font-weight: 600;
    border-right: 4px solid var(--green);
}

.toast-notif i {
    color: var(--green);
    margin-left: 12px;
    font-size: 18px;
}

.back-top {
    position: fixed;
    bottom: 35px;
    left: 35px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.4);
    display: none;
    opacity: 0;
    transition: 0.3s;
    z-index: 999;
}

.back-top:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.sticky-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(6px);
}

body.sticky-pad {
    padding-top: 55px;
}

/* ==========================================
   ووکامرس
   ========================================== */
.woocommerce .p-card .price ins {
    text-decoration: none;
    background: transparent;
}

.woocommerce .p-card .price del {
    color: #999;
    font-size: 12px;
    margin-left: 8px;
}

.woocommerce .p-card .add-to-cart-button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    width: 100%;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.woocommerce .p-card .add-to-cart-button:hover {
    background: var(--primary-hover);
}

/* ==========================================
   ریسپانسیو
   ========================================== */

/* تبلت */
@media (max-width: 992px) {
    .ranking-slide {
        flex: 0 0 calc(50% - 6px);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .features-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .mega-wrapper {
        top: 100px;
        min-height: 200px;
        padding: 20px 0;
    }

    .mega-inner {
        flex-direction: column;
        padding: 0 15px;
    }

    .mega-sidebar {
        flex: none;
        border-left: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 0 0 10px 0;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .mega-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .mega-sidebar ul li {
        padding: 6px 14px;
        font-size: 13px;
        background: #f5f5f5;
        border-radius: 20px;
        white-space: nowrap;
    }

    .mega-sidebar ul li:hover {
        background: var(--primary);
        color: #fff;
        padding-right: 14px;
    }

    .mega-content {
        grid-template-columns: 1fr 1fr;
        padding: 10px 0;
        gap: 15px;
    }

    .mega-banner {
        display: none;
    }

    .mega-trigger {
        padding: 0 10px;
        font-size: 13px;
    }
}

/* موبایل */
@media (max-width: 768px) {
    .grid-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .banner-row-2 {
        flex-direction: column;
    }

    .banner-row-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .amazing-green-box {
        flex-direction: column;
    }

    .hero {
        height: 180px;
        font-size: 24px;
    }

    .quick-icons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .q-item {
        flex: 0 0 20%;
    }

    .brand-row {
        flex-wrap: wrap;
        justify-content: center;
    }

    .brand-row img {
        height: 24px;
    }

    .ranking-slide {
        flex: 0 0 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-col ul {
        display: none;
    }

    .footer-col ul.open {
        display: block;
    }

    .footer-col h5 .footer-toggle {
        display: inline-block;
    }

    .slider-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .slider-btn.prev-btn {
        right: 0;
    }

    .slider-btn.next-btn {
        left: 0;
    }

    .mega-wrapper {
        top: 90px;
        padding: 15px 0;
        min-height: 150px;
        border-radius: 0;
        width: 100vw;
        left: 0;
        right: 0;
    }

    .mega-inner {
        flex-direction: column;
        padding: 0 10px;
    }

    .mega-sidebar {
        flex: none;
        border-left: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 0 0 10px 0;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .mega-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .mega-sidebar ul li {
        padding: 6px 12px;
        font-size: 13px;
        background: #f5f5f5;
        border-radius: 20px;
        white-space: nowrap;
    }

    .mega-content {
        grid-template-columns: 1fr 1fr;
        padding: 10px 0;
        gap: 10px;
    }

    .mega-banner {
        display: none;
    }

    .mega-trigger {
        padding: 0 8px;
        font-size: 12px;
    }

    .navbar .container {
        gap: 15px;
        overflow-x: auto;
        padding: 0 10px;
    }

    .nav-menu li {
        font-size: 13px;
        padding: 0 4px;
    }

    .amazing-red-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .amazing-red-card {
        flex: 0 0 auto;
        min-width: 130px;
        max-width: 160px;
        scroll-snap-align: start;
    }

    .amazing-red-card img {
        height: 80px;
    }

    .amazing-red-card .price {
        font-size: 13px;
    }

    .amazing-green-box {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .amazing-title {
        text-align: center;
        margin-bottom: 10px;
    }

    .amazing-list {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 8px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .amazing-card {
        flex: 0 0 auto;
        min-width: 120px;
        max-width: 150px;
        scroll-snap-align: start;
        padding: 10px;
    }

    .amazing-card img {
        width: 70px;
        height: 70px;
    }

    .amazing-card .price {
        font-size: 13px;
    }

    .woocommerce ul.products li.product {
        width: 48% !important;
        margin: 0 1% 20px !important;
    }
}

/* موبایل بسیار کوچک */
@media (max-width: 480px) {
    .grid-cards {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .p-card img {
        height: 100px;
    }

    .header-btns .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .search-wrap {
        flex: 2; /* فضای بیشتری بگیرد */
        height: 44px; /* ارتفاع بیشتر */
        margin: 10 10px;
        padding: 0;
    }

    .amazing-red-card {
        min-width: 110px;
        max-width: 130px;
        padding: 8px;
    }

    .amazing-red-card img {
        height: 70px;
    }

    .amazing-red-card .price {
        font-size: 12px;
    }

    .amazing-red-card .old-price {
        font-size: 10px;
    }

    .amazing-red-card .discount {
        font-size: 10px;
        padding: 1px 5px;
    }

    .amazing-red-timer .timer-box {
        font-size: 14px;
        min-width: 24px;
        padding: 1px 4px;
    }

    .amazing-red-timer .timer-sep {
        font-size: 16px;
    }

    .amazing-card {
        min-width: 100px;
        max-width: 120px;
        padding: 8px;
    }

    .amazing-card img {
        width: 60px;
        height: 60px;
    }

    .amazing-card .price {
        font-size: 12px;
    }

    .amazing-card .discount {
        font-size: 10px;
        padding: 1px 5px;
    }

    .features-section {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .feature-card {
        padding: 15px;
    }

    .feature-card i {
        font-size: 24px;
    }

    .feature-card h4 {
        font-size: 14px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
    }

    .mega-content {
        grid-template-columns: 1fr;
    }

    .mega-sidebar ul li {
        font-size: 12px;
        padding: 4px 10px;
    }

    .mega-trigger {
        padding: 0 6px;
        font-size: 11px;
    }

    .mega-wrapper {
        top: 80px;
        padding: 10px 0;
        min-height: 120px;
    }
}

/* تنظیمات نهایی مگا منو برای ریسپانسیو */
@media (max-width: 992px) {
    .mega-wrapper {
        position: fixed !important;
        top: 100px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        max-height: 80vh;
        overflow-y: auto;
        transform-origin: top center !important;
    }
}

@media (max-width: 480px) {
    .mega-wrapper {
        top: 90px !important;
    }
}


/* ===== برندها با عکس و نام ===== */
.brand-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px 30px;
    padding: 25px 20px;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.brand-item {
    text-align: center;
    transition: all 0.3s ease;
    flex: 0 0 auto;
    width: 110px;
}

.brand-item:hover {
    transform: translateY(-6px);
}

.brand-item a {
    display: block;
    text-decoration: none;
    color: #333;
}

.brand-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 50%;
    background: #f5f5f5;
    padding: 12px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto 8px;
}

.brand-item:hover img {
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transform: scale(1.05);
}

.brand-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    line-height: 1.3;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-item:hover .brand-name {
    color: var(--primary);
}

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .brand-row {
        gap: 15px 20px;
        padding: 15px;
    }
    .brand-item {
        width: 80px;
    }
    .brand-item img {
        width: 60px;
        height: 60px;
        padding: 8px;
    }
    .brand-name {
        font-size: 11px;
        max-width: 80px;
    }
}

@media (max-width: 480px) {
    .brand-row {
        gap: 10px 15px;
        padding: 12px;
    }
    .brand-item {
        width: 65px;
    }
    .brand-item img {
        width: 50px;
        height: 50px;
        padding: 6px;
    }
    .brand-name {
        font-size: 10px;
        max-width: 65px;
    }
}


/* ==========================================
   رفع مشکل مگا منو در موبایل
   ========================================== */
@media (max-width: 768px) {
    .navbar {
        display: flex;
        align-items: center;
        height: auto;
        flex-wrap: nowrap;
        padding: 0;
        position: relative;
        overflow: visible !important;
    }

    .navbar .container {
        display: flex;
        align-items: center;
        overflow-x: auto;
        overflow-y: visible;
        flex-wrap: nowrap;
        padding: 0 10px;
        gap: 10px;
        justify-content: flex-start;
        width: 100%;
        height: 100%;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    .mega-trigger {
        position: relative !important;
        right: auto !important;
        left: auto !important;
        top: auto !important;
        order: -1; /* در RTL، مرتبه‌ی اول یعنی سمت راست */
        margin-right: 0;
        margin-left: auto; /* چسبیدن به راست */
        background: transparent !important;
        border-left: none !important;
        border-right: none !important;
        padding: 0 10px;
        flex-shrink: 0;
        height: 100%;
        display: flex;
        align-items: center;
        font-size: 13px;
        z-index: 99999;
    }

    .mega-trigger i {
        margin-left: 6px;
    }

    .nav-menu {
        display: flex;
        align-items: center;
        gap: 15px;
        flex-shrink: 0;
        height: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-menu li {
        font-size: 13px;
        padding: 0 6px;
        white-space: nowrap;
        height: 100%;
        display: flex;
        align-items: center;
    }

    /* مگا منو در موبایل */
    .mega-wrapper {
        position: fixed !important;
        top: 55px !important; /* ارتفاع navbar را تنظیم کنید */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        max-height: 80vh;
        overflow-y: auto;
        transform-origin: top center;
        z-index: 99998;
        padding: 15px 0;
        min-height: 200px;
    }

    .mega-inner {
        flex-direction: column;
        padding: 0 10px;
        gap: 10px;
    }

    .mega-sidebar {
        flex: none;
        border-left: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 0 0 10px 0;
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .mega-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
        width: 100%;
    }

    .mega-sidebar ul li {
        padding: 6px 12px;
        font-size: 13px;
        background: #f5f5f5;
        border-radius: 20px;
        white-space: nowrap;
    }

    .mega-sidebar ul li:hover {
        background: var(--primary);
        color: #fff;
        padding-right: 12px;
    }

    .mega-content {
        grid-template-columns: 1fr 1fr;
        padding: 10px 0;
        gap: 10px;
    }

    .mega-banner {
        display: none;
    }
}

/* موبایل کوچک‌تر */
@media (max-width: 480px) {
    .mega-wrapper {
        top: 50px !important;
    }

    .mega-trigger {
        font-size: 11px;
        padding: 0 6px;
    }

    .nav-menu li {
        font-size: 12px;
        padding: 0 4px;
    }

    .mega-content {
        grid-template-columns: 1fr;
    }

    .mega-sidebar ul li {
        font-size: 12px;
        padding: 4px 10px;
    }
}



/* ==========================================
   رفع خروج کارت‌های بخش موبایل و تبلت در گوشی
   ========================================== */

/* در موبایل (تا عرض 768px) */
@media (max-width: 768px) {
    .grid-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
        overflow: hidden;
        padding: 0;
    }

    .grid-cards .p-card,
    .grid-cards > * {
        max-width: 100%;
        overflow: hidden;
        padding: 10px;
        box-sizing: border-box;
        margin: 0;
    }

    .grid-cards .p-card img,
    .grid-cards > * img {
        max-width: 100%;
        height: auto;
        display: block;
    }

    .grid-cards .p-card h4,
    .grid-cards > * h4 {
        font-size: 12px;
        height: auto;
        max-height: 36px;
        overflow: hidden;
    }

    .grid-cards .p-card .price,
    .grid-cards > * .price {
        font-size: 13px;
    }

    /* حذف padding اضافی از section-wrapper در موبایل */
    .section-wrapper {
        padding: 12px;
    }

    .sec-header h3 {
        font-size: 15px;
    }
}

/* برای موبایل‌های بسیار کوچک (تا 480px) */
@media (max-width: 480px) {
    .grid-cards {
        gap: 8px;
    }

    .grid-cards .p-card,
    .grid-cards > * {
        padding: 8px;
    }

    .grid-cards .p-card img,
    .grid-cards > * img {
        height: 100px;
        object-fit: contain;
    }

    .grid-cards .p-card h4,
    .grid-cards > * h4 {
        font-size: 11px;
        max-height: 30px;
    }

    .grid-cards .p-card .price,
    .grid-cards > * .price {
        font-size: 12px;
    }

    /* اطمینان از عدم خروج از کادر */
    .section-wrapper {
        overflow: hidden;
        padding: 10px;
    }
}


/* ==========================================
   صفحه‌بندی سفارشی برای بخش کالاهای دیجیتال
   ========================================== */
.custom-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.custom-pagination .page-numbers {
    display: inline-block;
    min-width: 38px;
    height: 38px;
    line-height: 38px;
    text-align: center;
    padding: 0 10px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
}

.custom-pagination .page-numbers:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.custom-pagination .page-numbers.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
    cursor: default;
}

.custom-pagination .page-numbers.prev,
.custom-pagination .page-numbers.next {
    background: #f0f0f0;
    padding: 0 16px;
    font-size: 16px;
}

.custom-pagination .page-numbers.prev:hover,
.custom-pagination .page-numbers.next:hover {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 480px) {
    .custom-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }
    .custom-pagination .page-numbers.prev,
    .custom-pagination .page-numbers.next {
        padding: 0 10px;
        font-size: 14px;
    }
}




/* ==========================================
   بهبود نمایش بخش کالاهای دیجیتال در موبایل
   ========================================== */

/* تبلت و موبایل بزرگ */
@media (max-width: 992px) {
    #digital-products-section .grid-cards {
        gap: 15px;
    }
    
    #digital-products-section .p-card {
        padding: 12px;
    }
    
    #digital-products-section .p-card img {
        height: 130px;
    }
    
    #digital-products-section .p-card h4 {
        font-size: 13px;
        height: 38px;
    }
}

/* موبایل (تا عرض 768px) */
@media (max-width: 768px) {
    /* ===== گرید محصولات ===== */
    #digital-products-section .grid-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
        overflow: hidden;
        padding: 0;
        box-sizing: border-box;
    }

    /* کارت‌های محصول */
    #digital-products-section .p-card,
    #digital-products-section .grid-cards > * {
        max-width: 100%;
        overflow: hidden;
        padding: 10px;
        box-sizing: border-box;
        margin: 0;
        border-radius: 10px;
    }

    #digital-products-section .p-card img,
    #digital-products-section .grid-cards > * img {
        max-width: 100%;
        height: 120px;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }

    #digital-products-section .p-card h4,
    #digital-products-section .grid-cards > * h4 {
        font-size: 12px;
        height: auto;
        max-height: 34px;
        overflow: hidden;
        margin: 8px 0;
        line-height: 1.3;
        text-align: right;
    }

    #digital-products-section .p-card .price,
    #digital-products-section .grid-cards > * .price {
        font-size: 13px;
        text-align: left;
    }

    #digital-products-section .p-card .add-btn,
    #digital-products-section .grid-cards > * .add-to-cart-button {
        font-size: 12px;
        padding: 6px 0;
        margin-top: 8px;
    }

    /* ===== صفحه‌بندی ===== */
    #digital-products-section .custom-pagination {
        gap: 5px;
        margin-top: 15px;
        padding: 5px 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    #digital-products-section .custom-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        line-height: 32px;
        font-size: 13px;
        padding: 0 8px;
        border-radius: 5px;
    }

    #digital-products-section .custom-pagination .page-numbers.prev,
    #digital-products-section .custom-pagination .page-numbers.next {
        padding: 0 10px;
        font-size: 14px;
        min-width: 30px;
    }

    /* حذف padding اضافی از بخش */
    #digital-products-section.section-wrapper {
        padding: 12px;
    }

    #digital-products-section .sec-header h3 {
        font-size: 15px;
    }

    #digital-products-section .sec-header a {
        font-size: 12px;
    }
}

/* موبایل بسیار کوچک (تا 480px) */
@media (max-width: 480px) {
    #digital-products-section .grid-cards {
        gap: 8px;
    }

    #digital-products-section .p-card,
    #digital-products-section .grid-cards > * {
        padding: 8px;
        border-radius: 8px;
    }

    #digital-products-section .p-card img,
    #digital-products-section .grid-cards > * img {
        height: 100px;
    }

    #digital-products-section .p-card h4,
    #digital-products-section .grid-cards > * h4 {
        font-size: 11px;
        max-height: 30px;
        margin: 6px 0;
    }

    #digital-products-section .p-card .price,
    #digital-products-section .grid-cards > * .price {
        font-size: 12px;
    }

    #digital-products-section .p-card .add-btn,
    #digital-products-section .grid-cards > * .add-to-cart-button {
        font-size: 11px;
        padding: 5px 0;
        margin-top: 6px;
    }

    /* صفحه‌بندی کوچک‌تر */
    #digital-products-section .custom-pagination .page-numbers {
        min-width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 11px;
        padding: 0 5px;
    }

    #digital-products-section .custom-pagination .page-numbers.prev,
    #digital-products-section .custom-pagination .page-numbers.next {
        padding: 0 8px;
        font-size: 12px;
        min-width: 26px;
    }

    #digital-products-section.section-wrapper {
        padding: 8px;
    }

    #digital-products-section .sec-header h3 {
        font-size: 14px;
    }
}

/* اطمینان از اینکه هیچ چیزی از کادر خارج نشود */
#digital-products-section,
#digital-products-container,
#digital-products-grid {
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

#digital-products-grid .p-card {
    box-sizing: border-box;
    border: 1px solid #f0f0f0;
    background: #fff;
    transition: 0.3s;
}

#digital-products-grid .p-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
}


.woocommerce nav.woocommerce-pagination{
    margin-top:30px;
    text-align:center;
}

.woocommerce nav.woocommerce-pagination ul{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:8px;
    list-style:none;
    padding:0;
    margin:0;
    border:none;
}

.woocommerce nav.woocommerce-pagination ul li{
    display:inline-block;
    border:none;
    margin:0;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span{
    display:flex;
    justify-content:center;
    align-items:center;
    width:40px;
    height:40px;
    border:1px solid #ddd;
    border-radius:6px;
    text-decoration:none;
    background:#fff;
    color:#333;
    transition:.3s;
}

.woocommerce nav.woocommerce-pagination ul li a:hover{
    background:#0073aa;
    color:#fff;
}

.woocommerce nav.woocommerce-pagination ul li .current{
    background:#0073aa;
    color:#fff;
    border-color:#0073aa;
}


.digital-pages{

display:flex;
justify-content:center;
gap:8px;
margin-top:25px;

}


.digital-page{

width:38px;
height:38px;

display:flex;
align-items:center;
justify-content:center;

border:1px solid #ddd;
border-radius:50%;

cursor:pointer;

background:white;

}


.digital-page:hover,
.digital-page.active{

background:var(--primary);
color:white;

}


/* ==========================================
   لیست بلوک‌ها (کادر سفید جلوی مگا منو)
   ========================================== */
.blocks-list-wrapper {
    background: #fff;
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin: 15px 0;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px 30px;
}

.blocks-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px 40px;
    width: 100%;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 30px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.block-item:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.block-item i {
    font-size: 18px;
    color: var(--primary);
    transition: 0.3s;
}

.block-item:hover i {
    color: #fff;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .blocks-list {
        gap: 10px 15px;
    }
    .block-item {
        font-size: 12px;
        padding: 6px 12px;
        white-space: nowrap;
    }
    .block-item i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .blocks-list-wrapper {
        padding: 10px;
        margin: 10px 0;
    }
    .blocks-list {
        gap: 8px;
        justify-content: center;
    }
    .block-item {
        font-size: 11px;
        padding: 5px 10px;
        gap: 5px;
    }
    .block-item i {
        font-size: 12px;
    }
}



.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-right: auto;
}

.block-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.block-link {
    font-size: 14px;
    color: #444;
    font-weight: 500;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: 0.3s;
    white-space: nowrap;
}

.block-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

@media (max-width: 768px) {
    .block-links {
        display: none; /* در موبایل لینک‌ها پنهان شوند */
    }
}
/* ==========================================
   لیست بلوک‌ها در هدر (سمت راست)
   ========================================== */
.blocks-list-wrapper {
    display: flex;
    align-items: center;
    margin-right: auto; /* چسبیدن به سمت راست */
    background: #fff;
    border-radius: 30px;
    padding: 4px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    height: 40px;
    border: 1px solid #e2e2e2;
    margin-left: 15px; /* فاصله از مگا منو */
}

.blocks-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.block-item i {
    font-size: 14px;
    color: var(--primary);
}

.block-item:hover {
    background: var(--primary);
    color: #fff;
}

.block-item:hover i {
    color: #fff;
}

/* در موبایل (عرض کم) */
@media (max-width: 992px) {
    .blocks-list-wrapper {
        display: none; /* یا می‌توانید در موبایل مخفی کنید یا به صورت همبرگری نمایش دهید */
    }
}

/* اگر می‌خواهید در موبایل هم نمایش داده شود، عرض را کم کنید */
@media (max-width: 768px) {
    .blocks-list-wrapper {
        display: flex;
        padding: 2px 8px;
        height: 34px;
        margin-left: 8px;
    }
    .block-item {
        font-size: 11px;
        padding: 2px 6px;
    }
    .block-item span {
        display: none; /* فقط آیکون نمایش داده شود */
    }
}


/* ==========================================
   نوار ناوبری با سه بخش
   ========================================== */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e2e2e2;
    height: 55px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 9999;
    overflow: visible !important;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between; /* منو چپ، بلوک‌ها وسط، مگا راست */
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 15px;
    gap: 10px;
    height: 100%;
}

/* منوی اصلی */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
}

.nav-menu li {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
}

/* لیست بلوک‌ها (وسط) */
.blocks-list-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1; /* این بخش فضای باقی‌مانده را می‌گیرد و باعث می‌شود لیست در وسط قرار گیرد */
    background: #fff;
    border-radius: 30px;
    padding: 4px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e2e2;
    height: 40px;
    min-width: 0;
}

.blocks-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.block-item i {
    font-size: 14px;
    color: var(--primary);
}

.block-item:hover {
    background: var(--primary);
    color: #fff;
}

.block-item:hover i {
    color: #fff;
}

/* مگا تریگر (راست) */
.mega-trigger {
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    background: #f8f9fa;
    border-left: 1px solid #e2e2e2;
    border-radius: 30px;
    height: 40px;
    flex: 0 0 auto;
    transition: 0.2s;
}

.mega-trigger:hover {
    color: var(--primary);
    background: #fff;
}

.mega-trigger i {
    margin-left: 8px;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 992px) {
    .blocks-list-wrapper {
        display: none; /* در تبلت و موبایل مخفی شود، یا می‌توانید آن را به صورت همبرگری نمایش دهید */
    }
}

/* اگر می‌خواهید در موبایل هم نمایش داده شود، عرض را کم کنید */
@media (max-width: 768px) {
    .blocks-list-wrapper {
        display: flex;
        padding: 2px 8px;
        height: 34px;
        flex: 0 0 auto;
    }
    .block-item {
        font-size: 11px;
        padding: 2px 6px;
    }
    .block-item span {
        display: none; /* فقط آیکون نمایش داده شود */
    }
    .mega-trigger {
        font-size: 12px;
        padding: 0 8px;
        height: 34px;
    }
}


/* ==========================================
   نوار ناوبری با سه بخش
   ========================================== */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e2e2e2;
    height: 55px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 9999;
    overflow: visible !important;
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 0 15px;
    gap: 10px;
    height: 100%;
}

/* منوی اصلی */
.nav-menu-wrapper {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
    height: 100%;
}

.nav-menu li {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    white-space: nowrap;
}

/* لیست بلوک‌ها (وسط) */
.blocks-list-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #fff;
    border-radius: 30px;
    padding: 4px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid #e2e2e2;
    height: 40px;
    min-width: 0;
}

.blocks-list {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.block-item i {
    font-size: 14px;
    color: var(--primary);
}

.block-item:hover {
    background: var(--primary);
    color: #fff;
}

.block-item:hover i {
    color: #fff;
}

/* مگا تریگر (راست) */
.mega-trigger {
    display: flex;
    align-items: center;
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    background: #f8f9fa;
    border-left: 1px solid #e2e2e2;
    border-radius: 30px;
    height: 40px;
    flex: 0 0 auto;
    transition: 0.2s;
}

.mega-trigger:hover {
    color: var(--primary);
    background: #fff;
}

.mega-trigger i {
    margin-left: 8px;
}

/* ===== ریسپانسیو ===== */

/* تبلت و موبایل بزرگ */
@media (max-width: 992px) {
    .blocks-list-wrapper {
        display: none !important; /* مخفی کردن لیست بلوک‌ها در موبایل و تبلت */
    }
    .mega-trigger {
        font-size: 13px;
        padding: 0 12px;
        height: 38px;
    }
    .navbar-inner {
        gap: 8px;
        padding: 0 10px;
    }
}

/* موبایل کوچک */
@media (max-width: 768px) {
    .navbar {
        height: auto;
        min-height: 48px;
    }
    .navbar-inner {
        gap: 5px;
        padding: 0 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-menu-wrapper {
        flex: 0 0 auto;
    }
    .nav-menu li {
        font-size: 12px;
        padding: 0 4px;
    }
    .mega-trigger {
        font-size: 12px;
        padding: 0 8px;
        height: 34px;
        border-radius: 20px;
        flex-shrink: 0;
    }
    .mega-trigger i {
        margin-left: 4px;
    }
    /* در صورت نیاز، منوی اصلی را نیز می‌توانید به همبرگر تبدیل کنید */
}
/* ===== مخفی کردن لیست بلوک‌ها در موبایل ===== */
@media (max-width: 992px) {
    .blocks-list-wrapper {
        display: none !important;
    }
}


/* ==========================================
   اصلاح لوگو برای جلوگیری از تداخل و سرچ روی لوگو
   ========================================== */
.logo, 
.logo a, 
.custom-logo-link {
    position: relative;
    z-index: 9999; /* جلوگیری از افتادن باکس جستجو روی لوگو */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
}

.logo img, 
.custom-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

/* تنظیمات ویژه برای موبایل */
/* ==========================================
   تنظیمات هدر در حالت موبایل
   ========================================== */
/* ==========================================
   تنظیمات هدر در حالت موبایل
   ========================================== */
/* ==========================================
   تنظیمات هدر در حالت موبایل (اصلاح تداخل)
   ========================================== */
   
   
   
   /* ==========================================
   تنظیمات هدر در حالت موبایل (اصلاح تداخل)
   ========================================== */
/* ==========================================
   تنظیمات هدر در حالت موبایل (ترتیب صحیح RTL)
   ========================================== */
@media (max-width: 768px) {
    .header-top {
        padding: 8px 0 8px 10px !important; /* حذف پدینگ راست برای چسبیدن لوگو به لبه */
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px; /* فاصله کم بین لوگو، سرچ و دکمه‌ها */
        width: 100%;
        box-sizing: border-box;
    }

    /* ۱. لوگو: سمت راست‌ترین عنصر (اولین در RTL) */
    .logo {
        order: -1 !important; /* کوچک‌ترین عدد = در سمت راست */
        margin: 0 !important;
        padding: 0 !important;
        flex-shrink: 0 !important; /* جلوگیری از فشرده شدن */
        position: relative;
        z-index: 9999 !important; /* تضمین لایه‌بندی برای جلوگیری از کلیک سرچ */
    }
    .logo a, .logo img, .custom-logo-link, .custom-logo {
        width: 34px;
        height: 34px;
        object-fit: contain;
        display: block;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* ۲. فیلد جستجو: عنصر دوم (بلافاصله بعد از لوگو به سمت چپ) */
    .search-wrap {
        order: 0 !important; /* عدد ۰ = دقیقاً بعد از لوگو */
        flex: 1 1 auto !important;
        min-width: 0 !important; /* کلید طلایی برای جلوگیری از بیرون زدن و تداخل */
        height: 34px !important;
        padding: 6px 16px !important;
        margin: 0 !important;
        border-radius: 30px !important;
        background: #f1f3f4;
        position: relative;
        z-index: 1 !important;
        box-sizing: border-box;
    }
    .search-wrap input {
        font-size: 15px !important;
        height: 100% !important;
        padding: 0;
        background: transparent;
        border: none;
        outline: none;
        width: 100%;
        box-sizing: border-box;
    }

    /* ۳. آیکون‌های ورود و سبد: در سمت چپ (آخرین عنصر) */
    .header-btns {
        order: 1 !important; /* عدد ۱ = در سمت چپ‌ترین قسمت قرار می‌گیرد */
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important; /* این فاصله، بین آیکون ورود و سبد خرید است */
        flex-shrink: 0 !important; /* جلوگیری از فشرده شدن کلی این بخش */
    }
    
    .header-btns .btn {
        padding: 6px 10px;
        font-size: 12px;
        flex-shrink: 0 !important; /* خودِ دکمه‌ها هم فشرده نشوند */
        white-space: nowrap;
    }

    .cart-btn {
        flex-shrink: 0 !important;
    }
}
   
   
   /* تنظیمات موبایل برای کوچک کردن فونت اسلایدر */
@media (max-width: 768px) {
    .hero-content {
        /* اگر کل محتوای متنی داخل اسلایدر را می‌خواهید کوچک کنید */
        font-size: 16px !important; 
    }

    /* اگر داخل اسلایدر از تگ های H1، H2 یا P استفاده کرده‌اید */
    .hero-content h1, 
    .hero-content h2, 
    .hero-content h3, 
    .hero-content p {
        font-size: 16px !important; /* یا 14px اگر خیلی بزرگ است */
        line-height: 1.4 !important;
    }

    /* (اختیاری) اگر می‌خواهید ارتفاع خود اسلایدر هم در گوشی کوچک‌تر شود */
    .hero {
        height: 160px !important;
        padding: 0 20px !important;
    }
}
