﻿/* =====================================================
   BD SHOP PAGE (Archive)
   ===================================================== */

.bd-shop-page { padding: 20px 0 60px; }

.bd-shop-wrap {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: start;
}

/* ----- Sidebar ----- */
.bd-shop-sidebar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 100px;
    overflow: hidden;
}

.bd-sidebar-inner { padding: 0; }

.bd-filter-section {
    padding: 18px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.bd-filter-section:last-child { border-bottom: none; }

.bd-filter-heading {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.bd-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bd-filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.bd-filter-list a span {
    font-size: 12px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 7px;
    border-radius: 999px;
}

.bd-filter-list a:hover,
.bd-filter-list a.active {
    background: #fdf2f8;
    color: #ff4da6;
}

.bd-filter-list a.active span {
    background: #fce7f3;
    color: #be185d;
}

/* Price form */
.bd-price-form { display: flex; flex-direction: column; gap: 10px; }

.bd-price-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bd-price-inputs input {
    flex: 1;
    padding: 9px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    min-width: 0;
    transition: border-color 0.2s;
}

.bd-price-inputs input:focus { border-color: #ff4da6; outline: none; }
.bd-price-inputs span { color: #9ca3af; font-weight: 700; flex-shrink: 0; }

.bd-filter-apply-btn {
    padding: 9px 16px;
    background: linear-gradient( 90deg, #ff4da6, #2563eb );
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.bd-filter-apply-btn:hover { opacity: 0.88; }

.bd-filter-clear {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    text-decoration: none;
    display: block;
}

.bd-filter-clear:hover { color: #ef4444; }

/* ----- Shop Main ----- */
.bd-shop-main { min-width: 0; }

/* Toolbar */
.bd-shop-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bd-sidebar-toggle-btn {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.bd-sidebar-toggle-btn.active,
.bd-sidebar-toggle-btn:hover { border-color: #ff4da6; color: #ff4da6; }

.bd-result-count {
    font-size: 14px;
    color: #6b7280;
    flex: 1;
}

.bd-result-count p { margin: 0; }

.bd-shop-ordering select {
    padding: 9px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    appearance: none;
    padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.2s;
}

.bd-shop-ordering select:focus { border-color: #ff4da6; outline: none; }

/* Section with class "products" must stay block, not grid */
section.products,
.related.products,
.upsells.products,
.cross-sells.products { display: block !important; }

/* Product grid — ul.products only (avoid hitting <section class="products">) */
ul.products {
    display: grid !important;
    grid-template-columns: repeat( 4, 1fr ) !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

/* WooCommerce notices above product grid */
.bd-shop-main .woocommerce-notices-wrapper,
.bd-shop-main .woocommerce-error,
.bd-shop-main .woocommerce-message,
.bd-shop-main .woocommerce-info {
    margin-bottom: 16px;
}

.products li.product {
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
}

/* Pagination */
.woocommerce-pagination {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.woocommerce-pagination .page-numbers {
    display: flex;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-pagination .page-numbers a,
.woocommerce-pagination .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    color: #374151;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
}

.woocommerce-pagination .page-numbers a:hover,
.woocommerce-pagination .page-numbers .current {
    background: #ff4da6;
    border-color: #ff4da6;
    color: #fff;
}

/* Responsive */
@media ( max-width: 1200px ) {
    .products { grid-template-columns: repeat( 3, 1fr ) !important; }
}

@media ( max-width: 992px ) {
    .bd-shop-wrap { grid-template-columns: 1fr; }
    .bd-sidebar-toggle-btn { display: flex; }

    .bd-shop-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 1200;
        border-radius: 0;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: none;
    }

    .bd-shop-sidebar.open {
        left: 0;
        box-shadow: 4px 0 24px rgba( 0, 0, 0, 0.15 );
    }

    ul.products { grid-template-columns: repeat( 3, 1fr ) !important; }
}

@media ( max-width: 768px ) {
    ul.products { grid-template-columns: repeat( 2, 1fr ) !important; }
}

@media ( max-width: 480px ) {
    ul.products { grid-template-columns: 1fr !important; }
}

/* ── Product category hero (shared .bd-tax-hero styles are in courses.css) ──
   shop.css handles the product-cat specific overrides for non-course pages */
.bd-shop-page .bd-tax-hero { margin-bottom: 28px; }

/* Dark mode */
body.dark-mode .bd-shop-sidebar { background: #1e293b; border-color: rgba(255,255,255,0.08); }
body.dark-mode .bd-filter-section { border-bottom-color: rgba(255,255,255,0.06); }
body.dark-mode .bd-filter-heading { color: #94a3b8; }
body.dark-mode .bd-filter-list a { color: #cbd5e1; }
body.dark-mode .bd-filter-list a span { background: #0f172a; color: #64748b; }
body.dark-mode .bd-price-inputs input { background: #0f172a; border-color: rgba(255,255,255,0.1); color: #e2e8f0; }
body.dark-mode .bd-shop-ordering select { background-color: #1e293b; border-color: rgba(255,255,255,0.1); color: #e2e8f0; }
body.dark-mode .bd-sidebar-toggle-btn { background: #1e293b; border-color: rgba(255,255,255,0.1); color: #e2e8f0; }
body.dark-mode .bd-result-count { color: #94a3b8; }
