/* Main CSS - ElemanKit Theme */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ek-font-family: 'Vazirmatn', sans-serif;
    --ek-color-primary: #6366f1;
    --ek-color-success: #10b981;
    --ek-color-text: #374151;
    --ek-color-bg: #f9fafb;
    --ek-color-white: #ffffff;
    --ek-border-radius: 16px;
    --ek-transition: all 0.3s ease;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
a,
span,
div,
strong,
li,
button,
input {
    font-family: var(--ek-font-family);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: var(--ek-color-bg);
    color: var(--ek-color-text);
    direction: rtl;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--ek-transition);
}

/* Product Grid */
.ek-products-grid,
.ek-product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.ek-no-image {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    font-size: 30px;
}

@media(max-width: 1024px) {
    .ek-products-grid, .ek-product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media(max-width: 768px) {
    .ek-products-grid, .ek-product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width: 480px) {
    .ek-products-grid, .ek-product-grid { grid-template-columns: 1fr; }
}

/* رنگ‌بندی عمومی آیکون‌های دو-رنگ */
.fa-duotone {
    --fa-primary-color: #64748b; 
    --fa-secondary-color: #6366f1;
    --fa-secondary-opacity: 0.6;
}

.ek-btn-buy, .ek-spec-label { font-family: inherit; }

/* =========================================
   منوی موبایل المان‌کیت
========================================= */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.ek-mobile-menu-toggle {
    display: none;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 20px;
    color: #334155;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.ek-mobile-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ek-mobile-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ek-mobile-drawer {
    position: fixed;
    top: 0;
    right: -300px; 
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 99999;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ek-mobile-drawer.active {
    right: 0;
}

.ek-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.ek-drawer-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
}

.ek-drawer-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #94a3b8;
    cursor: pointer;
}

.ek-drawer-body {
    padding: 20px;
    overflow-y: auto;
}

.ek-mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ek-mobile-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: #334155;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.ek-mobile-nav a i {
    font-size: 18px;
    --fa-primary-color: #6b7280;
    --fa-secondary-color: #9ca3af;
    --fa-secondary-opacity: 0.7;
}

.ek-mobile-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ek-mobile-category-item {
    display: block;
}

.ek-mobile-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ek-mobile-category-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ek-mobile-category-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ek-mobile-category-toggle i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ek-mobile-category-toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.ek-mobile-subcategory-list {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ek-mobile-subcategory-list[hidden] {
    display: none;
}

.ek-mobile-subcategory-list li {
    margin: 0;
}

.ek-mobile-subcategory-list .ek-mobile-subcategory-list {
    margin-top: 6px;
    margin-right: 8px;
    padding-right: 10px;
    border-right: 1px solid #e2e8f0;
}

.ek-mobile-subcategory-list a {
    display: block;
    padding: 10px 12px 10px 14px;
    margin-right: 12px;
    border-radius: 10px;
    background: #f8fafc;
    color: #475569;
    font-weight: 500;
    text-decoration: none;
}

.ek-mobile-subcategory-list a:hover,
.ek-mobile-subcategory-list a:focus {
    background: #eef2ff;
    color: #4338ca;
}

.ek-mobile-category-depth-1 .ek-mobile-category-main,
.ek-mobile-category-depth-2 .ek-mobile-category-main {
    font-size: 14px;
}

.ek-mobile-category-depth-1 .ek-mobile-category-main {
    margin-right: 8px;
}

.ek-mobile-nav a:hover {
    background: #f8fafc;
    color: #6366f1;
}

.ek-drawer-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 20px 0;
}

.ek-mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ek-mobile-btn-login {
    background: #10b981;
    color: #ffffff;
}

.ek-mobile-btn-account {
    background: #6366f1;
    color: #ffffff;
}

@media (max-width: 768px) {
    .ek-header-nav, 
    .ek-header-login,
    .ek-header-search { 
        display: none !important; 
    }
    .ek-mobile-menu-toggle {
        display: flex !important;
    }
}

/* =========================================
   استایل‌های دسکتاپ صفحه محصول
========================================= */
.ek-product-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 30px;
    align-items: start;
}

.ek-mobile-title-box { display: none; } 
.ek-mobile-only-tab { display: none; } 
.ek-mobile-only-pane { display: none; } 
.ek-apple-sticky-bar { display: none; } 

.ek-tabs-nav {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 6px;
    margin: 0 0 20px 0;
    list-style: none;
    gap: 5px;
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch;
}
.ek-tabs-nav::-webkit-scrollbar { display: none; } 

.ek-tabs-nav li {
    flex: 1;
    min-width: 80px;
}
.ek-tabs-nav a {
    display: block;
    text-align: center;
    padding: 12px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap !important; 
    text-decoration: none;
    transition: all 0.2s ease;
}
.ek-tabs-nav a.active {
    background: #ffffff;
    color: #6366f1;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ek-tab-content-wrap {
    width: 100%;
    max-width: 100%;
}
.ek-tab-pane {
    display: none;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.ek-tab-pane img, .ek-tab-pane iframe {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}
.ek-tab-pane.active {
    display: block;
}

.ek-specs-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ek-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
}
.ek-spec-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
}
.ek-spec-value {
    color: #1e293b;
    font-size: 13px;
    font-weight: 800;
}

.ek-btn-buy {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: #10b981;
    color: #fff;
    padding: 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
}

/* =========================================
   موبایل: اصلاحات کلی چیدمان و تب‌ها (گام ۲)
========================================= */
@media (max-width: 992px) {
    
    .ek-product-layout {
        display: flex !important;
        flex-direction: column-reverse !important; 
        gap: 20px !important;
    }
    
    .ek-main-details {
        order: 2 !important; 
        margin-bottom: 0 !important;
        width: 100% !important;
    }
    
    .ek-sidebar {
        order: 1 !important;
        width: 100% !important;
    }
    
    /* مخفی کردن المان‌های دسکتاپ و نمایش المان‌های موبایل */
    .ek-desktop-buy-box { display: none !important; } 
    .ek-desktop-specs { display: none !important; } 
    .ek-mobile-title-box { display: block; }
    .ek-mobile-only-tab { display: block; } 
    
    /* مهار کردن نوار تب‌ها جهت جلوگیری از بیرون‌زدگی از کادر */
    .ek-tabs-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .ek-tabs-nav {
        display: flex !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 4px !important;
        margin-bottom: 15px !important;
        background: #f1f5f9 !important;
        border-radius: 12px !important;
    }

    /* کوچک‌تر کردن فونت تب‌ها برای جا شدن راحت‌تر */
    .ek-tabs-nav a {
        padding: 8px 6px !important;
        font-size: 12px !important;
        font-weight: 700 !important;
    }

    /* اصلاح فونت و ترازبندی متن توضیحات (Justify) */
    .ek-tab-pane {
        padding: 15px 12px !important;
        box-sizing: border-box !important;
    }

    .ek-content-isolated, 
    .ek-content-isolated p {
        font-size: 13px !important;
        line-height: 1.8 !important;
        text-align: justify !important;
        color: #334155 !important;
        word-break: break-word !important;
    }

    .ek-mobile-title-box h1 {
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* استایل‌دهی به لیست مشخصات در تب موبایل */
    #tab-specs .ek-specs-content {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    #tab-specs .ek-spec-item {
        flex-direction: column;
        padding: 15px 10px;
        justify-content: center;
        text-align: center;
        gap: 8px;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
    }
}

/* =========================================
   موبایل: نوار شیشه‌ای اصیل اپل (گام ۱)
========================================= */
@media (max-width: 992px) {
    body {
        padding-bottom: 150px !important;
    }

    .ek-apple-sticky-bar {
        display: flex !important;
        position: fixed !important;
        bottom: 84px !important;
        left: 12px !important;
        right: 12px !important;
        background: rgba(255, 255, 255, 0.68) !important;
        backdrop-filter: blur(20px) saturate(180%) brightness(1.08) !important;
        -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.85) !important;
        border-radius: 28px !important;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12),
                    0 4px 16px rgba(15, 23, 42, 0.06),
                    inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
        z-index: 999998 !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
    }

    .ek-sticky-price-box {
        font-size: 18px !important;
        font-weight: 900 !important;
        color: #0f172a !important;
        letter-spacing: -0.5px !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        line-height: 1.2 !important;
        text-align: right !important;
    }

    .ek-sticky-cart-btn {
        background: linear-gradient(135deg, #34c759 0%, #22c55e 100%) !important;
        color: #ffffff !important;
        padding: 12px 18px !important;
        border-radius: 18px !important;
        font-size: 14px !important;
        font-weight: 800 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        text-decoration: none !important;
        box-shadow: 0 10px 22px rgba(34, 197, 94, 0.25),
                    0 4px 10px rgba(34, 197, 94, 0.12) !important;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                    box-shadow 0.2s ease !important;
        flex-shrink: 0 !important;
    }

    .ek-sticky-cart-btn:active {
        transform: scale(0.96) !important;
    }

    .ek-sticky-cart-btn:hover {
        box-shadow: 0 12px 28px rgba(34, 197, 94, 0.32),
                    0 6px 14px rgba(34, 197, 94, 0.15) !important;
    }
}
/* =========================================
   اصلاحات نهایی: مخفی کردن برچسب‌ها و سفید کردن آیکون سبد خرید
========================================= */
@media (max-width: 992px) {

    /* ۱. مخفی کردن کامل li حاوی برچسب‌ها (نه فقط لینک) */
    .ek-tabs-nav li:has(a[href="#tab-tags"]) {
        display: none !important;
    }

    /* مرکزی کردن ۳ تب باقی‌مانده */
    .ek-tabs-nav {
        justify-content: center !important;
        gap: 4px !important;
    }

    .ek-tabs-nav li {
        flex: 0 1 auto !important;
        min-width: 0 !important;
    }

    /* عرض یکسان برای تب‌ها */
    .ek-tabs-nav a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
        font-weight: 700 !important;
    }

    /* ۲. سفید کردن کامل آیکون و لایه‌های دو-رنگ داخل دکمه خرید چسبان */
    .ek-sticky-cart-btn i,
    .ek-sticky-cart-btn i.fa-duotone {
        color: #ffffff !important;
        --fa-primary-color: #ffffff !important;
        --fa-secondary-color: #ffffff !important;
        --fa-secondary-opacity: 0.8 !important;
    }

    /* ۳. بخش برچسب‌ها - اسکرول افقی اختیاری */
    #tab-tags {
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scrollbar-width: none !important;
    }

    #tab-tags::-webkit-scrollbar {
        display: none !important;
    }

    #tab-tags .ek-tags-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        min-width: min-content !important;
    }

    #tab-tags .ek-tag-item {
        flex-shrink: 0 !important;
    }
}
/* =========================================
   انقلاب در طراحی کارت‌های مشخصات (Apple Dashboard Style)
========================================= */
@media (max-width: 992px) {

    /* ۱. شبکه‌بندی ۲ ستونه و مرتب کارت‌ها */
    #tab-specs .ek-specs-content {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 5px 0 !important;
    }

    /* ۲. چیدمان افقی و ساختار کارت */
    #tab-specs .ek-spec-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 10px !important;
        padding: 12px 10px !important;
        background: #ffffff !important;
        border: 1px solid #f1f5f9 !important;
        border-radius: 14px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
        text-align: right !important;
    }

    /* ۳. ساخت باکس آیکون بزرگ و رنگی شبیه تنظیمات آیفون */
    #tab-specs .ek-spec-label {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        font-size: 11px !important;
        color: #94a3b8 !important;
        font-weight: 700 !important;
    }

    #tab-specs .ek-spec-label i {
        font-size: 16px !important;
        color: #6366f1 !important;
        background: #f0f3ff !important;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px !important;
    }

    /* ۴. مقدار مشخصه (درشت و بولد) */
    #tab-specs .ek-spec-value {
        font-size: 12px !important;
        font-weight: 800 !important;
        color: #1e293b !important;
    }
}

/* =========================================
   ترازبندی دوطرفه (Justify) متن توضیحات در دسکتاپ
========================================= */
.ek-content-isolated, 
.ek-content-isolated p {
    text-align: justify !important;
    line-height: 1.8 !important;
    color: #374151;
}
/* =========================================
   اصلاح و ظریف‌سازی کامل بخش نظرات در موبایل
========================================= */
@media (max-width: 992px) {

    /* ۱. کوچک کردن عنوان بالای نظرات (تعداد دیدگاه‌ها) */
    #tab-comments h2,
    #tab-comments .comments-title {
        font-size: 13px !important;
        line-height: 1.6 !important;
        font-weight: 700 !important;
        color: #334155 !important;
        padding: 10px 12px !important;
        margin-bottom: 15px !important;
        background: #f8fafc !important;
        border: 1px solid #f1f5f9 !important;
        border-radius: 12px !important;
        text-align: center !important;
    }

    /* ۲. کوچک و هماهنگ کردن نام نویسنده نظر و آواتار */
    #tab-comments .comment-author,
    #tab-comments .comment-author b,
    #tab-comments .fn {
        font-size: 12px !important;
        font-weight: 700 !important;
        color: #1e293b !important;
    }

    /* ۳. ظریف کردن تاریخ انتشار نظر */
    #tab-comments .comment-meta,
    #tab-comments .comment-meta a,
    #tab-comments .comment-metadata,
    #tab-comments .comment-metadata a {
        font-size: 10px !important;
        color: #94a3b8 !important;
    }

    /* ۴. کوچک کردن متن اصلی دیدگاه‌ها */
    #tab-comments .comment-content,
    #tab-comments .comment-body p,
    #tab-comments .comment-text p {
        font-size: 12px !important;
        line-height: 1.7 !important;
        color: #475569 !important;
        margin-top: 5px !important;
        margin-bottom: 10px !important;
    }

    /* ۵. جمع‌وجور کردن حاشیه‌ها و فاصله‌های هر نظر */
    #tab-comments .comment-body,
    #tab-comments li.comment {
        padding: 10px 0 !important;
        border-bottom: 1px dashed #e2e8f0 !important;
        margin-bottom: 10px !important;
    }
}