/* ==========================================================
   Babyshop - Modern Minimal Shop Page
   ========================================================== */

:root {
    --bs-primary: #e4f7ff;
    --bs-primary-dark: #a9def9;
    --bs-accent: #ff9eb5;
    --bs-text: #2b2f36;
    --bs-text-light: #6b7280;
    --bs-white: #ffffff;
    --bs-border: #e7eef2;
    --bs-radius: 16px;
    --bs-shadow: 0 6px 24px rgba(20, 40, 60, 0.06);
    --bs-shadow-hover: 0 10px 30px rgba(20, 40, 60, 0.12);
}

.babyshop-shop-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 32px 20px 64px;
    font-family: inherit;
    color: var(--bs-text);
    direction: rtl;
}

.babyshop-shop-header {
    text-align: center;
    margin-bottom: 36px;
}

.babyshop-shop-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--bs-text);
}

.babyshop-shop-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 28px;
    align-items: start;
}

/* ===================== سایدبار فیلتر ===================== */

.babyshop-filters {
    background: var(--bs-white);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius);
    padding: 22px;
    position: sticky;
    top: 20px;
    box-shadow: var(--bs-shadow);
}

.babyshop-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--bs-primary);
    font-weight: 700;
    font-size: 17px;
}

.babyshop-clear-btn {
    background: none;
    border: none;
    color: var(--bs-accent);
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
}
.babyshop-clear-btn:hover { text-decoration: underline; }

.babyshop-filter-block {
    padding: 16px 0;
    border-bottom: 1px solid var(--bs-border);
}
.babyshop-filter-block:last-child { border-bottom: none; }

.babyshop-filter-block h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--bs-text);
}

.babyshop-search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--bs-border);
    border-radius: 10px;
    background: #f8fcfe;
    font-size: 13px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.babyshop-search-input:focus {
    border-color: var(--bs-primary-dark);
    box-shadow: 0 0 0 3px rgba(169, 222, 249, .35);
}

.babyshop-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-inline-end: 4px;
}
.babyshop-checkbox-list::-webkit-scrollbar { width: 5px; }
.babyshop-checkbox-list::-webkit-scrollbar-thumb { background: var(--bs-primary-dark); border-radius: 10px; }

.babyshop-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    cursor: pointer;
    color: var(--bs-text);
}
.babyshop-checkbox input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--bs-primary-dark);
    cursor: pointer;
}
.babyshop-checkbox em {
    font-style: normal;
    color: var(--bs-text-light);
    font-size: 12px;
    margin-inline-start: auto;
}

/* ------- بازه قیمت (دو رنج) ------- */
.babyshop-price-slider {
    position: relative;
    padding-top: 6px;
}
.babyshop-range-track {
    position: relative;
    height: 5px;
    background: var(--bs-border);
    border-radius: 10px;
    margin: 18px 0 10px;
}
.babyshop-range-fill {
    position: absolute;
    height: 5px;
    background: var(--bs-primary-dark);
    border-radius: 10px;
}
.babyshop-range-input {
    position: absolute;
    top: -6px;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    height: 18px;
}
.babyshop-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bs-white);
    border: 3px solid var(--bs-primary-dark);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.babyshop-range-input::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--bs-white);
    border: 3px solid var(--bs-primary-dark);
    cursor: pointer;
}
.babyshop-price-values {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    color: var(--bs-text-light);
    margin-top: 6px;
}
.babyshop-price-values span span { color: var(--bs-text); font-weight: 700; }

/* ===================== محتوای اصلی ===================== */

.babyshop-shop-main { min-width: 0; }

.babyshop-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bs-white);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius);
    padding: 14px 18px;
    margin-bottom: 22px;
    box-shadow: var(--bs-shadow);
}

.babyshop-results-count {
    font-size: 13.5px;
    color: var(--bs-text-light);
}

.babyshop-orderby-select {
    padding: 9px 14px;
    border-radius: 10px;
    border: 1px solid var(--bs-border);
    background: #f8fcfe;
    font-size: 13px;
    cursor: pointer;
    outline: none;
}

.babyshop-mobile-filter-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--bs-primary);
    border: none;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: var(--bs-text);
}

/* ------- گرید محصولات ------- */
.babyshop-products-grid,
ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 200px;
}

ul.products li.product,
.babyshop-products-grid .product {
    background: var(--bs-white);
    border: 1px solid var(--bs-border);
    border-radius: var(--bs-radius);
    padding: 14px;
    text-align: center;
    transition: transform .25s ease, box-shadow .25s ease;
    position: relative;
    overflow: hidden;
}
ul.products li.product:hover,
.babyshop-products-grid .product:hover {
    transform: translateY(-4px);
    box-shadow: var(--bs-shadow-hover);
}

ul.products li.product a img {
    border-radius: 12px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--bs-primary);
    margin-bottom: 12px;
}

ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-text);
    margin: 6px 0;
    line-height: 1.6;
}

ul.products li.product .price {
    font-size: 15px;
    font-weight: 700;
    color: var(--bs-text);
}
ul.products li.product .price del {
    color: var(--bs-text-light);
    font-weight: 400;
    opacity: .7;
    margin-inline-end: 6px;
}
ul.products li.product .price ins {
    text-decoration: none;
    color: var(--bs-accent);
}

ul.products li.product .onsale {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    background: var(--bs-accent);
    color: var(--bs-white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    min-height: auto;
    min-width: auto;
    line-height: 1.6;
}

ul.products li.product .button,
ul.products li.product .add_to_cart_button {
    display: inline-block;
    margin-top: 10px;
    background: var(--bs-primary);
    color: var(--bs-text) !important;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
ul.products li.product .button:hover {
    background: var(--bs-primary-dark);
}

.babyshop-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--bs-text-light);
    font-size: 15px;
    background: var(--bs-white);
    border-radius: var(--bs-radius);
    border: 1px dashed var(--bs-border);
}

/* ------- صفحه‌بندی ------- */
.babyshop-pagination-wrap,
.babyshop-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.babyshop-pagination .page-btn,
.babyshop-pagination-wrap .page-numbers {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--bs-border);
    background: var(--bs-white);
    color: var(--bs-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
}
.babyshop-pagination .page-btn:hover,
.babyshop-pagination-wrap .page-numbers:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary-dark);
}
.babyshop-pagination .page-btn.active,
.babyshop-pagination-wrap .page-numbers.current {
    background: var(--bs-primary-dark);
    color: var(--bs-white);
    border-color: var(--bs-primary-dark);
}

/* ------- لودینگ ------- */
.babyshop-loading {
    display: none;
    justify-content: center;
    padding: 40px 0;
}
.babyshop-loading.active { display: flex; }
.babyshop-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid var(--bs-primary);
    border-top-color: var(--bs-primary-dark);
    border-radius: 50%;
    animation: babyshop-spin .8s linear infinite;
}
@keyframes babyshop-spin { to { transform: rotate(360deg); } }

.babyshop-products-grid.babyshop-fading { opacity: .4; pointer-events: none; transition: opacity .2s; }

/* ===================== واکنش‌گرا (Responsive) ===================== */

@media (max-width: 992px) {
    .babyshop-shop-container {
        grid-template-columns: 1fr;
    }

    .babyshop-mobile-filter-btn { display: inline-flex; }

    .babyshop-filters {
        position: fixed;
        inset-inline-start: -100%;
        top: 0;
        bottom: 0;
        width: 82%;
        max-width: 340px;
        z-index: 9999;
        border-radius: 0;
        overflow-y: auto;
        transition: inset-inline-start .3s ease;
        box-shadow: var(--bs-shadow-hover);
    }
    .babyshop-filters.babyshop-filters-open {
        inset-inline-start: 0;
    }

    .babyshop-filters-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.35);
        z-index: 9998;
    }
    .babyshop-filters-overlay.active { display: block; }
}

@media (max-width: 768px) {
    .babyshop-shop-title { font-size: 24px; }

    .babyshop-toolbar {
        flex-wrap: wrap;
    }

    .babyshop-products-grid,
    ul.products {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    ul.products li.product .woocommerce-loop-product__title {
        font-size: 12.5px;
    }
}

@media (max-width: 480px) {
    .babyshop-shop-wrapper { padding: 20px 12px 40px; }

    .babyshop-products-grid,
    ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .babyshop-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .babyshop-orderby-select,
    .babyshop-mobile-filter-btn {
        width: 100%;
        justify-content: center;
    }
}
