/* ============================================
   استایل فروشگاه سفارشی - نسخه کامل
   ============================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ============================================
   ۱) ردیف آیکون دسته‌بندی‌ها
   ============================================ */
.category-icons-wrapper {
    background: #ffffff;
    padding: 20px 0;
    border-bottom: 1px solid #eef1f4;
}

.category-icons-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-icons-scroll::-webkit-scrollbar {
    display: none;
}

.category-icon-item {
    flex: 0 0 auto;
    width: 86px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
}

.category-icon-image {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    background: #f2f6fb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.25s ease;
}

.category-icon-item:hover .category-icon-image {
    background: #e3f2fd;
    transform: translateY(-4px);
}

.category-icon-image img {
    width: 68%;
    height: 68%;
    object-fit: contain;
}

.category-icon-label {
    margin-top: 8px;
    font-size: 12.5px;
    color: #444444;
    text-align: center;
    line-height: 1.4;
}

/* ============================================
   ۲) هدر و چیدمان صفحه فروشگاه
   ============================================ */
.shop-page-wrapper {
    padding: 22px 0 50px;
}

.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.shop-title {
    font-size: 20px;
    font-weight: 800;
    color: #222222;
    margin: 0;
}

.mobile-filters-toggle {
    display: none;
    align-items: center;
    gap: 6px;
    background: #0D47A1;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}

.shop-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.shop-sidebar-wrapper {
    flex: 0 0 280px;
    max-width: 280px;
}

.shop-main-content {
    flex: 1 1 0%;
    min-width: 0;
}

/* ============================================
   ۳) نوار ابزار (تعداد نتایج + تب‌های مرتب‌سازی)
   ============================================ */
.shop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #eef1f4;
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 20px;
}

.product-count {
    font-size: 13px;
    color: #777777;
}

.shop-sort-tabs {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.shop-sort-tabs a {
    font-size: 13.5px;
    color: #888888;
    text-decoration: none;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.shop-sort-tabs a:hover {
    color: #0D47A1;
}

.shop-sort-tabs a.active {
    color: #0D47A1;
    font-weight: 700;
    border-color: #0D47A1;
}

/* ============================================
   ۴) گرید محصولات
   ============================================ */
.products-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 12px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 12px;
}

/* ============================================
   ۵) کارت محصول
   ============================================ */
.product-item {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.product-item:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.10);
    transform: translateY(-5px);
    border-color: #2196F3;
}

.product-link {
    text-decoration: none;
    display: block;
    color: inherit;
}

/* --- دکمه ویشلیست --- */
.wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    cursor: pointer;
    z-index: 3;
    padding: 0;
}

.wishlist-btn svg {
    width: 17px;
    height: 17px;
    stroke: #555555;
    fill: none;
    transition: all 0.2s ease;
}

.wishlist-btn.active svg {
    fill: #e91e63;
    stroke: #e91e63;
}

/* --- بج پرفروش --- */
.bestseller-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #00bfa5;
    color: #ffffff;
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

/* --- بج تخفیف روی تصویر --- */
.sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #dc3545;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

/* --- تصویر --- */
.product-image {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    padding-top: 100%;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

/* --- جزئیات --- */
.product-details {
    padding: 16px 18px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
    margin: 0;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-name:hover {
    color: #0D47A1;
}

/* --- امتیاز محصول --- */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 4px;
}

.star-rating {
    position: relative;
    display: inline-block;
    font-size: 13px;
    line-height: 1;
    width: 72px;
    height: 13px;
}

.star-rating::before {
    content: "\2605\2605\2605\2605\2605";
    color: #e0e0e0;
    letter-spacing: 2px;
    position: absolute;
    top: 0;
    right: 0;
}

.star-rating span {
    position: absolute;
    top: 0;
    right: 0;
    overflow: hidden;
    white-space: nowrap;
}

.star-rating span::before {
    content: "\2605\2605\2605\2605\2605";
    color: #ffb400;
    letter-spacing: 2px;
    position: absolute;
    top: 0;
    right: 0;
}

.rating-number {
    font-size: 12px;
    color: #888888;
}

/* --- موجودی --- */
.product-stock {
    font-size: 12.5px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 6px;
    display: inline-block;
    margin: 4px 0 12px;
}

.product-stock.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.product-stock.out-stock {
    background: #ffebee;
    color: #c62828;
}

/* --- پایین کارت: قیمت + دکمه --- */
.product-bottom {
    padding: 0 18px 18px;
}

.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.discount-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e3f2fd;
    color: #0D47A1;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 8px;
    white-space: nowrap;
}

.price-value {
    font-size: 15px;
    font-weight: 700;
    color: #0D47A1;
}

.price-value del {
    color: #aaaaaa;
    font-size: 12.5px;
    font-weight: 400;
    margin-inline-start: 6px;
}

.price-value ins {
    text-decoration: none;
}

/* --- دکمه افزودن به سبد (سازگار با خروجی وردپرس/ووکامرس) --- */
.product-button {
    width: 100%;
}

.product-button a.button,
.product-button .add_to_cart_button,
.add-to-cart {
    display: block;
   background: #2196f3;
    color: #ffffff !important;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
}

.product-button a.button:hover,
.product-button .add_to_cart_button:hover,
.add-to-cart:hover {
background: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgb(33 150 243 / 30%);
}

.product-button a.added_to_cart {
    display: block;
    margin-top: 6px;
    text-align: center;
    font-size: 12.5px;
}

.out-of-stock {
    display: block;
    background: #e9ecef;
    color: #999999;
    padding: 11px 18px;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 600;
    width: 100%;
    text-align: center;
    cursor: not-allowed;
}

/* --- پیام خالی بودن --- */
.no-products-found {
    padding: 60px 0;
}

.empty-state {
    text-align: center;
    color: #666666;
}

.empty-state h3 {
    margin: 16px 0 6px;
    font-size: 17px;
    color: #333333;
}

/* ============================================
   ۶) سایدبار فیلترها
   ============================================ */
.shop-filters-sidebar {
    background: #ffffff;
    border: 1px solid #eef1f4;
    border-radius: 14px;
    padding: 18px;
    position: sticky;
    top: 20px;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.filters-header h3 {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    color: #222222;
}

.clear-filters {
    font-size: 12.5px;
    color: #e6396b;
    text-decoration: none;
}

.close-mobile-filters {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #999999;
}

.filter-section {
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 0;
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    color: #222222;
    cursor: pointer;
}

.filter-section-toggle .chevron {
    transition: transform 0.25s ease;
}

.filter-section.is-collapsed .filter-section-toggle .chevron {
    transform: rotate(-90deg);
}

.filter-section-body {
    margin-top: 12px;
    max-height: 260px;
    overflow-y: auto;
}

.filter-section.is-collapsed .filter-section-body {
    display: none;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13.5px;
    color: #444444;
    cursor: pointer;
}

.filter-option input {
    width: 16px;
    height: 16px;
    accent-color: #0D47A1;
    cursor: pointer;
}

.filter-option-count {
    color: #aaaaaa;
    font-size: 12px;
    margin-inline-start: auto;
}

/* --- محدوده قیمت --- */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.price-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7f9fb;
    border-radius: 8px;
    padding: 8px 10px;
}

.price-input-box input {
    width: 70px;
    border: none;
    background: none;
    text-align: left;
    font-size: 13px;
    color: #333333;
}

.price-input-box input:focus {
    outline: none;
}

.price-input-label {
    font-size: 12px;
    color: #999999;
}

.price-slider {
    position: relative;
    height: 30px;
    margin: 6px 2px 0;
}

.price-slider-track {
    position: absolute;
    top: 13px;
    left: 0;
    right: 0;
    height: 4px;
    background: #e6eaf0;
    border-radius: 2px;
}

.price-slider-range {
    position: absolute;
    top: 13px;
    height: 4px;
    background: linear-gradient(90deg, #00bcd4, #e91e63);
    border-radius: 2px;
}

.price-slider input[type="range"] {
    position: absolute;
    width: 100%;
    top: 8px;
    height: 14px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.price-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4, #e91e63);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.price-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00bcd4, #e91e63);
    cursor: pointer;
    border: 3px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.price-slider input[type="range"]::-webkit-slider-runnable-track,
.price-slider input[type="range"]::-moz-range-track {
    background: transparent;
}

/* --- کلید فیلتر (سوییچ) --- */
.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13.5px;
    color: #444444;
    cursor: pointer;
}

.filter-toggle:last-of-type {
    border-bottom: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.slider-toggle::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    right: 3px;
    bottom: 3px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.switch input:checked + .slider-toggle {
    background: #00bfa5;
}

.switch input:checked + .slider-toggle::before {
    transform: translateX(-18px);
}

.apply-filters-btn {
    width: 100%;
    background: #0D47A1;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 16px;
}

.apply-filters-btn:hover {
    background: #2196F3;
}

/* ============================================
   ۷) صفحه‌بندی
   ============================================ */
.shop-pagination {
    margin-top: 26px;
    display: flex;
    justify-content: center;
}

.shop-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.shop-pagination .page-numbers li a,
.shop-pagination .page-numbers li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    color: #555555;
    text-decoration: none;
    font-size: 13px;
}

.shop-pagination .page-numbers li span.current {
    background: #0D47A1;
    border-color: #0D47A1;
    color: #ffffff;
}

/* ============================================
   ۸) بک‌گراند تیره فیلتر موبایل
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 998;
}

.sidebar-overlay.is-visible {
    display: block;
}

/* ============================================
   ریسپانسیو
   ============================================ */

/* تبلت */
@media (max-width: 992px) {
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .shop-sidebar-wrapper {
        flex: 0 0 240px;
        max-width: 240px;
    }
}

/* موبایل بزرگ - سایدبار به‌صورت افقی/آف‌کانواس */
@media (max-width: 768px) {
    .mobile-filters-toggle {
        display: inline-flex;
    }

    .shop-layout {
        display: block;
    }

    .shop-sidebar-wrapper {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        overflow-y: auto;
        background: #ffffff;
        z-index: 999;
        transition: right 0.3s ease;
        padding: 16px;
    }

    .shop-sidebar-wrapper.is-open {
        right: 0;
    }

    .close-mobile-filters {
        display: inline-block;
    }

    .shop-filters-sidebar {
        border: none;
        padding: 0;
        position: static;
    }

    .product-details {
        padding: 14px 15px 4px;
    }

    .product-name {
        font-size: 14.5px;
        height: 42px;
    }

    .product-bottom {
        padding: 0 15px 15px;
    }
}

/* موبایل */
@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }

    .products-grid {
        margin: 0 -6px;
    }

    .col-6 {
        padding: 0 6px;
    }

    .product-item {
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .category-icon-item {
        width: 74px;
    }

    .category-icon-image {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .shop-toolbar {
        padding: 10px 12px;
    }

    .shop-sort-tabs {
        gap: 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        width: 100%;
    }
}

/* موبایل خیلی کوچک */
@media (max-width: 400px) {
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .product-item {
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
}