/**
 * Storefront chrome: slide-in mini-cart, popup add bar, and the two-phase
 * stove browser. Adapted from brief/opulence-trade-portal styling into the
 * opulence-2026 design tokens.
 */

/* ------------------------------------------------------------------ *
 * Slide-in mini-cart
 * ------------------------------------------------------------------ */
.mini-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 15, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1400;
    pointer-events: none;
}
.mini-cart-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mini-cart {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(400px, 90vw);
    background: var(--color-bg, #fff);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1500;
    display: flex;
    flex-direction: column;
}
.mini-cart.is-open {
    transform: translateX(0);
}
body.minicart-open {
    overflow: hidden;
}

.mini-cart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border, #e6e2da);
}
.mini-cart__title {
    margin: 0;
    font-family: var(--font-display, serif);
    font-size: 1.4rem;
}
.mini-cart__close {
    background: none;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-ink, #1c1a17);
}
.mini-cart__body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}
.mini-cart__body .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.mini-cart__body .woocommerce-mini-cart__buttons a {
    flex: 1 1 45%;
    text-align: center;
}
.mini-cart__body .woocommerce-mini-cart__buttons a.checkout {
    background: var(--color-gold, #b3892f);
    color: #fff;
}

/* Variation meta lists (mini-cart + cart page): WooCommerce wraps each dd
   value in a <p> whose default margins push the dd onto the next row, so the
   dt/dd stop lining up. Flatten the paragraph spacing so it sits inline with
   its term. */
dl.variation dd p {
    margin: 0;
    padding: 0;
}

/* ------------------------------------------------------------------ *
 * Popup bottom "added to basket" bar
 * ------------------------------------------------------------------ */
.add-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1300;
    background: var(--color-ink, #1c1a17);
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.add-bar.is-visible {
    transform: translateY(0);
}
.add-bar__inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    flex-wrap: wrap;
}
.add-bar__msg {
    font-weight: 500;
}
.add-bar__total {
    opacity: 0.85;
}
.add-bar__continue,
.add-bar__cart {
    margin-left: auto;
}
.add-bar__cart {
    margin-left: 0;
}

/* ------------------------------------------------------------------ *
 * Sales category: subcategory cards mimicking the stove brand cards
 * ------------------------------------------------------------------ */
.term-sales ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin: 1.5rem 0 3rem;
    padding: 0;
    list-style: none;
}
.term-sales ul.products::before,
.term-sales ul.products::after {
    content: none;
}
.term-sales ul.products li.product-category {
    width: auto;
    margin: 0;
    padding: 0;
    float: none;
    clear: none;
}
.term-sales ul.products li.product-category a {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--color-bg, #fff);
    border: 1px solid var(--color-border, #e6e2da);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.term-sales ul.products li.product-category a:hover {
    border-color: var(--color-gold, #b3892f);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.term-sales ul.products li.product-category img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin: 0;
}
.term-sales ul.products li.product-category .woocommerce-loop-category__title {
    margin: 0;
    padding: 1rem 1.25rem;
    font-family: var(--font-display, serif);
    font-size: 1.15rem;
    font-weight: 500;
    text-align: center;
    color: var(--color-ink, #211d18);
}
.term-sales ul.products li.product-category .woocommerce-loop-category__title .count {
    display: inline-block;
    margin-left: 0.35rem;
    background: none;
    color: var(--color-muted, #6b6459);
    font-size: 0.85rem;
    font-weight: 400;
}

/* ------------------------------------------------------------------ *
 * Stove browser: phase 1 brand cards
 * ------------------------------------------------------------------ */
    margin: 1.5rem 0 3rem;
}
.stove-scope-note {
    margin: 0 0 1rem;
    color: var(--color-muted, #6b6459);
    font-size: 0.95rem;
}
.stove-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.stove-brand-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    background: var(--color-bg, #fff);
    border: 1px solid var(--color-border, #e6e2da);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    text-align: center;
}
.stove-brand-card:hover {
    border-color: var(--color-gold, #b3892f);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.stove-brand-card__img img {
    width: auto;
    object-fit: contain;
    max-height: 160px;
}
.stove-brand-card__name {
    font-family: var(--font-display, serif);
    font-size: 1.1rem;
}
.stove-brand-card__count {
    font-size: 0.8rem;
    color: var(--color-muted, #6b6459);
}
.stove-brand-card--all {
    justify-content: center;
    background: var(--color-paper, #f5f1ea);
}

/* ------------------------------------------------------------------ *
 * Stove browser: phase 2 product list
 * ------------------------------------------------------------------ */
.stove-back-btn {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--color-gold, #b3892f);
    font-weight: 500;
    padding: 0.25rem 0;
    margin-bottom: 0.5rem;
}
.stove-active-title {
    font-family: var(--font-display, serif);
    font-size: 1.8rem;
    margin: 0 0 1rem;
}
.stove-order-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--color-border, #e6e2da);
    margin-bottom: 0.75rem;
}
.stove-order-tab {
    background: none;
    border: 0;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--color-muted, #6b6459);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.stove-order-tab.is-active {
    color: var(--color-ink, #1c1a17);
    border-bottom-color: var(--color-gold, #b3892f);
}
.stove-subheading {
    color: var(--color-muted, #6b6459);
    margin: 0 0 1rem;
}
.stove-filter-bar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.stove-search {
    flex: 1;
    min-width: 200px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--color-border, #e6e2da);
    border-radius: 8px;
    font: inherit;
}
.stove-view-toggle {
    display: flex;
    gap: 0.25rem;
}
.stove-view-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border, #e6e2da);
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}
.stove-view-btn.is-active {
    background: var(--color-ink, #1c1a17);
    color: #fff;
    border-color: var(--color-ink, #1c1a17);
}
.stove-filter-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}
.stove-chip {
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--color-border, #e6e2da);
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}
.stove-chip.is-active {
    background: var(--color-gold, #b3892f);
    color: #fff;
    border-color: var(--color-gold, #b3892f);
}
.stove-results-count {
    font-size: 0.85rem;
    color: var(--color-muted, #6b6459);
    margin-bottom: 1rem;
}
.stove-loading,
.stove-no-results {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--color-muted, #6b6459);
    grid-column: 1 / -1;
}

/* Grid view */
.stove-product-list.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}
/* List view */
.stove-product-list.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stove-product-card {
    background: #fff;
    border: 1px solid var(--color-border, #e6e2da);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.list-view .stove-product-card {
    flex-direction: row;
}
.stove-card-image {
    position: relative;
}
.stove-card-image img {
    width: 100%;
    height: auto;
    display: block;
}
.list-view .stove-card-image {
    width: 180px;
    flex-shrink: 0;
}
.stove-card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}
.stove-card-brand {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted, #6b6459);
}
.stove-card-title {
    font-family: var(--font-display, serif);
    font-size: 1.1rem;
    color: var(--color-ink, #1c1a17);
    text-decoration: none;
    line-height: 1.25;
}
.stove-card-title:hover {
    color: var(--color-gold, #b3892f);
}
.stove-card-stock {
    font-size: 0.82rem;
}
.stove-stock.in-stock {
    color: #2e7d32;
}
.stove-stock.on-backorder {
    color: #8a6d1f;
}
.stove-card-price {
    font-weight: 600;
    font-size: 1.05rem;
}
.stove-card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}
.stove-qty {
    display: inline-flex;
    border: 1px solid var(--color-border, #e6e2da);
    border-radius: 8px;
    overflow: hidden;
}
.stove-qty button {
    width: 34px;
    height: 38px;
    border: 0;
    background: #f5f1ea;
    cursor: pointer;
    font-size: 1.1rem;
}
.stove-qty-input {
    width: 44px;
    border: 0;
    text-align: center;
    font: inherit;
    -moz-appearance: textfield;
}
.stove-qty-input::-webkit-outer-spin-button,
.stove-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.stove-add-to-cart {
    flex: 1;
    min-width: 130px;
}
.stove-add-to-cart.is-loading {
    opacity: 0.6;
    pointer-events: none;
}
.stove-card-view {
    flex: 1;
    min-width: 130px;
    text-align: center;
}

.woocommerce div.product .woocommerce-tabs .panel {
    padding: 20px;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
    margin-bottom: 0px;
}

@media (max-width: 768px) {
    .list-view .stove-product-card {
        flex-direction: column;
    }

    .list-view .stove-card-image {
        width: 100%;
    }

    .add-bar__inner {
        gap: 0.6rem;
    }

    .add-bar__continue,
    .add-bar__cart {
        flex: 1;
        text-align: center;
    }
}
