/* =============================================
   SHOP.CSS — Shop Page, Filter Sidebar, Product Grid
   ============================================= */

/* Page shell — top & bottom breathing room */
body.woocommerce-shop .mu-site-main,
body.tax-product_cat .mu-site-main,
body.tax-product_tag .mu-site-main,
.mu-shop-page {
    background: linear-gradient(180deg, #FAF6F0 0%, #F7F3EC 45%, #FAFAF8 100%);
    padding: 36px 0 80px;
    min-height: 60vh;
}

.mu-shop-page .mu-container {
    max-width: var(--mu-container-max, 1200px);
}

/* Breadcrumbs */
.mu-shop-page .woocommerce-breadcrumb,
.mu-shop-breadcrumbs {
    font-size: 0.84rem;
    color: var(--mu-text-muted, #777);
    margin: 0 0 28px;
    padding: 0;
    letter-spacing: 0.01em;
}

.mu-shop-page .woocommerce-breadcrumb a,
.mu-shop-breadcrumbs a {
    color: var(--mu-charcoal, #2A2A2A);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.mu-shop-page .woocommerce-breadcrumb a:hover,
.mu-shop-breadcrumbs a:hover {
    color: var(--mu-maroon, #7A0C11);
}

/* Page layout */
.mu-shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 36px;
    align-items: start;
}

/* ---- SHOPIFY-STYLE FILTERS ---- */
.mu-filter-backdrop {
    display: none;
}

.mu-shop-sidebar {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    position: sticky;
    top: 96px;
    overflow: visible;
}

.mu-filter-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px;
    border-bottom: 1px solid #E8E4DC;
    margin-bottom: 4px;
}

.mu-filter-drawer-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--mu-font-sans, Inter, sans-serif);
    color: var(--mu-charcoal, #2A2A2A);
    letter-spacing: -0.01em;
}

.mu-filter-close {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #F3F0EA;
    color: #333;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mu-filter-drawer-body {
    display: flex;
    flex-direction: column;
}

.mu-filter-group {
    border-bottom: 1px solid #E8E4DC;
}

.mu-filter-group:last-child {
    border-bottom: none;
}

.mu-filter-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--mu-charcoal, #2A2A2A);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: color 0.15s ease;
    border: none;
    background: none;
    text-align: left;
}

.mu-filter-toggle:hover {
    color: var(--mu-maroon, #7A0C11);
}

.mu-filter-chevron {
    flex-shrink: 0;
    color: #888;
    transition: transform 0.2s ease;
}

.mu-filter-group.is-open .mu-filter-chevron {
    transform: rotate(180deg);
}

.mu-filter-list {
    display: none;
    list-style: none;
    padding: 0 0 14px;
    margin: 0;
}

.mu-filter-list.mu-open {
    display: block;
}

.mu-filter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.92rem;
    color: #4a4a4a;
    border-radius: 0;
    text-decoration: none;
    transition: color 0.15s ease;
    cursor: pointer;
    background: transparent !important;
}

.mu-filter-item:hover {
    color: var(--mu-charcoal, #2A2A2A);
}

.mu-filter-item.active {
    color: var(--mu-charcoal, #2A2A2A);
    font-weight: 600;
    background: transparent !important;
}

.mu-filter-label {
    flex: 1;
    min-width: 0;
}

/* Shopify-like checkbox */
.mu-cb {
    width: 18px;
    height: 18px;
    border: 1.5px solid #BDB7AE;
    border-radius: 3px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    background: #fff;
}

.mu-filter-item:hover .mu-cb {
    border-color: #8a847c;
}

.mu-cb.checked {
    background: var(--mu-maroon, #7A0C11);
    border-color: var(--mu-maroon, #7A0C11);
}

.mu-cb.checked::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

.mu-fc {
    margin-left: auto;
    font-size: 0.8rem;
    color: #9a9590;
    font-weight: 500;
}

.mu-filter-drawer-foot {
    display: none;
}

/* Toolbar: Filter button + results/sort */
.mu-shop-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.mu-filter-trigger {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #D9D3C9;
    border-radius: 10px;
    color: var(--mu-charcoal, #2A2A2A);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.mu-filter-trigger:hover {
    border-color: var(--mu-maroon, #7A0C11);
    background: #fff;
}

.mu-filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 50px;
    background: var(--mu-maroon, #7A0C11);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}

/* Shop header bar */
.mu-shop-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.mu-result-count {
    font-size: 0.9rem;
    color: var(--mu-text-muted, #777);
    font-weight: 500;
}

.mu-result-count .woocommerce-result-count {
    margin: 0;
}

.mu-shop-bar .woocommerce-ordering {
    margin: 0;
}

.mu-shop-bar .woocommerce-ordering select,
.mu-sort-select {
    border: 1px solid #D9D3C9;
    border-radius: 10px;
    padding: 10px 36px 10px 14px;
    font-size: 0.88rem;
    background-color: #fff;
    color: var(--mu-charcoal, #2A2A2A);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232A2A2A' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.mu-shop-bar .woocommerce-ordering select:focus,
.mu-sort-select:focus {
    border-color: var(--mu-maroon, #7A0C11);
    box-shadow: 0 0 0 3px rgba(122, 12, 17, 0.08);
}

/* Active filter chips */
.mu-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -6px 0 18px;
}

.mu-active-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: var(--mu-charcoal, #2A2A2A);
    border: 1px solid #D9D3C9;
    border-radius: 50px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.mu-active-chip:hover {
    border-color: var(--mu-maroon, #7A0C11);
    color: var(--mu-maroon, #7A0C11);
    background: #fff;
}

.mu-active-chip-clear {
    border-color: transparent;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
    color: #666;
    padding-left: 4px;
}

.mu-active-chip-clear:hover {
    color: var(--mu-maroon, #7A0C11);
    border-color: transparent;
    background: transparent;
}

/* ---- SHOP MAIN CONTENT ---- */
.mu-shop-main {
    min-width: 0;
}

.mu-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Shop cards — polish overrides */
.mu-shop-page .mu-product-card {
    background: var(--mu-white, #fff);
    border: 1px solid #EBE6DE;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(42, 42, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
}

.mu-shop-page .mu-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(42, 42, 42, 0.08);
}

.mu-shop-page .mu-product-image {
    display: block;
    aspect-ratio: 1 / 1;
    background: #F3EEE6;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.mu-shop-page .mu-product-image img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.mu-shop-page .mu-product-card:hover .mu-product-image img {
    transform: scale(1.04);
}

.mu-shop-page .mu-product-body {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}

.mu-shop-page .mu-product-cat {
    color: #2a5a2c;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mu-shop-page .mu-product-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
    min-height: 2.6em;
}

.mu-shop-page .mu-product-title a {
    color: var(--mu-charcoal, #2A2A2A);
    text-decoration: none;
}

.mu-shop-page .mu-product-title a:hover {
    color: var(--mu-maroon, #7A0C11);
}

.mu-shop-page .mu-product-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--mu-charcoal, #2A2A2A);
    margin-bottom: 16px;
}

.mu-shop-page .mu-product-price del {
    font-size: 0.9rem;
    color: #9CA3AF;
    font-weight: 400;
    margin-right: 6px;
}

.mu-shop-page .mu-product-add-btn {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 46px;
    background: var(--mu-maroon, #7A0C11) !important;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none !important;
    text-transform: none;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(122, 12, 17, 0.2);
}

.mu-shop-page .mu-product-add-btn:hover {
    background: var(--mu-maroon-dark, #5c090d) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(122, 12, 17, 0.28);
}

/* WooCommerce overrides for our custom template */
.mu-woo-wrap .products.columns-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    list-style: none !important;
    float: none !important;
}

/* No products message */
.mu-no-products {
    text-align: center;
    padding: 72px 24px;
    color: var(--mu-text-muted, #777);
    background: var(--mu-white, #fff);
    border: 1px solid var(--mu-border, #E8DDD0);
    border-radius: 14px;
}

.mu-no-products h3 {
    margin-bottom: 12px;
    color: var(--mu-charcoal, #2A2A2A);
    font-family: var(--mu-font-serif, Georgia, serif);
}

.mu-no-products a {
    color: var(--mu-maroon, #7A0C11);
    font-weight: 600;
}

/* Pagination */
.mu-shop-page .mu-pagination,
.mu-shop-page .woocommerce-pagination {
    margin-top: 40px;
    padding-top: 8px;
}

.mu-shop-page .woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mu-shop-page .woocommerce-pagination a,
.mu-shop-page .woocommerce-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--mu-border, #E8DDD0);
    background: var(--mu-white, #fff);
    color: var(--mu-charcoal, #2A2A2A);
    font-weight: 600;
    text-decoration: none;
}

.mu-shop-page .woocommerce-pagination .current,
.mu-shop-page .woocommerce-pagination a:hover {
    background: var(--mu-maroon, #7A0C11);
    border-color: var(--mu-maroon, #7A0C11);
    color: #fff;
}

/* Reveal animation */
.mu-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mu-reveal.mu-visible {
    opacity: 1;
    transform: none;
}

/* Responsive */
@media (max-width: 960px) {
    body.woocommerce-shop .mu-site-main,
    body.tax-product_cat .mu-site-main,
    body.tax-product_tag .mu-site-main,
    .mu-shop-page {
        padding: 28px 0 64px;
    }

    .mu-shop-layout {
        grid-template-columns: 200px 1fr;
        gap: 24px;
    }

    .mu-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
}

@media (max-width: 768px) {
    body.woocommerce-shop .mu-site-main,
    body.tax-product_cat .mu-site-main,
    body.tax-product_tag .mu-site-main,
    .mu-shop-page {
        padding: 28px 0 64px;
    }

    .mu-shop-page .mu-shop-breadcrumbs,
    .mu-shop-page .woocommerce-breadcrumb {
        margin-bottom: 20px;
    }

    .mu-shop-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Shopify mobile: Filter button visible, panel becomes bottom sheet */
    .mu-filter-trigger {
        display: inline-flex;
        flex: 1;
        min-width: 0;
    }

    .mu-shop-toolbar {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 16px;
    }

    .mu-shop-bar {
        flex: 1.2;
        min-width: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .mu-shop-bar .mu-result-count {
        display: none;
    }

    .mu-shop-bar .woocommerce-ordering {
        width: 100%;
    }

    .mu-shop-bar .woocommerce-ordering select {
        width: 100%;
        height: 44px;
    }

    .mu-filter-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 20, 20, 0.45);
        z-index: 1100;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .mu-filter-backdrop.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mu-shop-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        z-index: 1101;
        max-height: min(88vh, 720px);
        background: #fff;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.14);
        display: flex;
        flex-direction: column;
        transform: translateY(110%);
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0.3s;
        overflow: hidden;
    }

    .mu-shop-sidebar.is-open {
        transform: translateY(0);
        visibility: visible;
    }

    .mu-filter-drawer-head {
        padding: 16px 18px;
        margin: 0;
        border-bottom: 1px solid #EDE8E0;
        flex-shrink: 0;
    }

    .mu-filter-drawer-title {
        font-size: 1.05rem;
    }

    .mu-filter-close {
        display: inline-flex;
    }

    .mu-filter-drawer-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 18px;
        flex: 1;
    }

    .mu-filter-toggle {
        padding: 18px 0;
    }

    .mu-filter-drawer-foot {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid #EDE8E0;
        background: #fff;
        flex-shrink: 0;
    }

    .mu-filter-clear {
        flex: 1;
        text-align: center;
        color: #555;
        font-size: 0.92rem;
        font-weight: 600;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .mu-filter-clear.is-disabled {
        opacity: 0.35;
        pointer-events: none;
        text-decoration: none;
    }

    .mu-filter-apply {
        flex: 1.4;
        height: 48px;
        border: none;
        border-radius: 10px;
        background: var(--mu-maroon, #7A0C11);
        color: #fff;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }

    body.mu-filters-open {
        overflow: hidden;
    }

    .mu-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .mu-shop-page .mu-product-title {
        min-height: 0;
        font-size: 0.98rem;
    }
}

@media (max-width: 480px) {
    .mu-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mu-shop-page .mu-product-body {
        padding: 10px 10px 12px;
    }

    .mu-shop-page .mu-product-cat {
        font-size: 0.62rem;
        letter-spacing: 0.5px;
        margin-bottom: 4px;
    }

    .mu-shop-page .mu-product-title {
        font-size: 0.88rem;
        min-height: 0;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    .mu-shop-page .mu-product-price {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }

    .mu-shop-page .mu-product-add-btn {
        height: 40px;
        font-size: 0.78rem;
        border-radius: 8px;
        padding: 0 8px;
    }

    .mu-shop-toolbar {
        flex-direction: column;
    }

    .mu-shop-bar {
        width: 100%;
        justify-content: stretch;
    }
}
