/* ==========================================================================
   Body Aesthetics Shop Customizer
   Matched to bodyaesthetics.bg + the [ba_price_list] design system.

   Mobile-first (97% mobile traffic).
   Gold #B59A45 · Text #2C2C2C · Muted #6B6B6B · Cream #F8F5EF · Border #E8E0D0
   Fonts: Montserrat (body/UI) · Cormorant Garamond (accents)

   Selectors are scoped under .ba-shop / .ba-pd so they win over the theme
   without leaning on !important.
   ========================================================================== */

.ba-shop,
.ba-pd {
    --ba-gold: #b59a45;
    --ba-gold-hover: #9e8539;
    --ba-gold-soft: rgba(181, 154, 69, 0.10);
    --ba-gold-tint: rgba(181, 154, 69, 0.05);
    --ba-white: #ffffff;
    --ba-cream: #f8f5ef;
    --ba-cream-2: #fbf8f2;
    --ba-text: #2c2c2c;
    --ba-text-light: #6b6b6b;
    --ba-border: #e8e0d0;
    --ba-border-light: #f0ebe2;
    --ba-radius: 14px;
    --ba-font-heading: "Cormorant Garamond", Georgia, serif;
    --ba-font-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
    --ba-transition: 0.22s ease;
    --ba-shop-cols: 3;
}

/* Scoped reset */
.ba-shop *,
.ba-shop *::before,
.ba-shop *::after,
.ba-pd *,
.ba-pd *::before,
.ba-pd *::after {
    box-sizing: border-box;
}

.ba-shop,
.ba-pd {
    font-family: var(--ba-font-body);
    color: var(--ba-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   [ba_shop] layout
   ========================================================================== */

.ba-shop-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

/* ----- Sidebar (desktop) -----
   Hidden on mobile, where the sticky picker (below) takes over — same pattern
   as the [ba_price_list] plugin. */

.ba-shop-sidebar {
    display: none;
    margin-bottom: 18px;
}

.ba-shop-sidebar-heading {
    margin: 0 0 10px;
    padding: 0 2px;
    font-family: var(--ba-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ba-text-light);
}

.ba-shop-cats {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ba-shop-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    font-family: var(--ba-font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    color: var(--ba-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--ba-transition), color var(--ba-transition),
        border-color var(--ba-transition);
    -webkit-tap-highlight-color: transparent;
}

.ba-shop-cat:hover {
    background: var(--ba-cream);
    color: var(--ba-gold);
}

.ba-shop-cat.is-active {
    background: var(--ba-cream);
    border-color: rgba(181, 154, 69, 0.45);
    color: var(--ba-gold);
}

.ba-shop-cat:focus-visible {
    outline: 2px solid var(--ba-gold);
    outline-offset: 2px;
}

.ba-shop-cat-txt {
    flex: 1;
    min-width: 0;
}

/* ----- Collapsible laser groups (parent + zone children) ----- */

.ba-shop-cat-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ba-shop-cat-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    font-family: var(--ba-font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    color: var(--ba-gold);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--ba-transition);
    -webkit-tap-highlight-color: transparent;
}

.ba-shop-cat-group-toggle:hover {
    background: var(--ba-cream);
}

.ba-shop-cat-group-toggle:focus-visible {
    outline: 2px solid var(--ba-gold);
    outline-offset: 2px;
}

.ba-shop-cat-chevron {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    transition: transform var(--ba-transition);
}

.ba-shop-cat-group:not(.is-open) .ba-shop-cat-chevron {
    transform: rotate(-45deg);
    margin-top: 2px;
}

.ba-shop-cat-children {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 6px;
}

.ba-shop-cat-group:not(.is-open) .ba-shop-cat-children {
    display: none;
}

.ba-shop-cat--child {
    padding-left: 38px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ba-text-light);
}

.ba-shop-cat--child.is-active,
.ba-shop-cat--child:hover {
    color: var(--ba-gold);
}

/* ----- Mobile: sticky custom category picker (mirrors [ba_price_list]) ----- */

.ba-shop-mobile {
    position: sticky;
    /* JS fills --ba-shop-header-offset from the fixed header height. */
    top: var(--ba-shop-header-offset, 70px);
    z-index: 50;
    margin: 0 0 14px;
    padding: 10px 12px 12px;
    background: var(--ba-white);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    isolation: isolate;
}

.ba-shop-mobile-label {
    margin: 0 0 6px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ba-text-light);
}

.ba-shop-picker {
    position: relative;
    width: 100%;
}

.ba-shop-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    font-family: var(--ba-font-body);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ba-text);
    text-align: left;
    background: var(--ba-cream);
    border: 1px solid rgba(181, 154, 69, 0.45);
    border-radius: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color var(--ba-transition), box-shadow var(--ba-transition),
        background var(--ba-transition);
}

.ba-shop-picker-trigger:hover {
    border-color: var(--ba-gold);
}

.ba-shop-picker.is-open .ba-shop-picker-trigger,
.ba-shop-picker-trigger:focus-visible {
    border-color: var(--ba-gold);
    box-shadow: 0 0 0 2px rgba(181, 154, 69, 0.2);
    outline: none;
}

.ba-shop-picker-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ba-shop-picker-chevron {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ba-gold);
    border-bottom: 2px solid var(--ba-gold);
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform var(--ba-transition);
}

.ba-shop-picker.is-open .ba-shop-picker-chevron {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.ba-shop-picker-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: min(60vh, 340px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--ba-white);
    border: 1px solid var(--ba-border);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(44, 44, 44, 0.12);
}

.ba-shop-picker-panel[hidden] {
    display: none !important;
}

.ba-shop-picker-list,
.ba-shop-picker-sublist {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.ba-shop-picker-group-label {
    display: block;
    padding: 10px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--ba-gold);
    line-height: 1.3;
}

.ba-shop-picker-option {
    display: block;
    width: 100%;
    margin: 0;
    padding: 11px 14px;
    font-family: var(--ba-font-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ba-text);
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--ba-transition), color var(--ba-transition);
}

.ba-shop-picker-option--child {
    padding-left: 22px;
    font-size: 13px;
}

.ba-shop-picker-option:hover,
.ba-shop-picker-option:focus-visible {
    background: var(--ba-cream);
    color: var(--ba-gold);
    outline: none;
}

.ba-shop-picker-option.is-selected {
    background: rgba(181, 154, 69, 0.12);
    color: var(--ba-gold);
    font-weight: 600;
}

.ba-shop-picker-option.is-selected::before {
    content: "✓";
    display: inline-block;
    width: 1.1em;
    margin-right: 6px;
    font-size: 12px;
    font-weight: 700;
}

/* ----- Product grid ----- */

.ba-shop-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.ba-shop-grid-wrap {
    position: relative;
    min-height: 120px;
}

.ba-shop-grid.is-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity var(--ba-transition);
}

.ba-shop-empty {
    grid-column: 1 / -1;
    padding: 48px 16px;
    text-align: center;
    font-family: var(--ba-font-heading);
    font-style: italic;
    font-size: 18px;
    color: var(--ba-text-light);
}

/* ----- Product card -----
   Selectors are prefixed with .ba-shop and reset theme (Breakdance) styles on
   the inner h3 / a so the cards render consistently regardless of the theme. */

.ba-shop .ba-shop-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--ba-white);
    border: 1px solid rgba(232, 224, 208, 0.6);
    border-radius: 20px;
    overflow: hidden;
    list-style: none;
    box-shadow: 0 1px 3px rgba(44, 44, 44, 0.03);
    transition: box-shadow 260ms ease, transform 260ms ease, border-color 260ms ease;
}

.ba-shop .ba-shop-card:hover {
    border-color: var(--ba-border);
    box-shadow: 0 18px 40px rgba(44, 44, 44, 0.12);
    transform: translateY(-5px);
}

.ba-shop .ba-card-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.ba-shop .ba-card-link:hover,
.ba-shop .ba-card-link:focus {
    text-decoration: none;
    color: inherit;
}

.ba-shop .ba-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--ba-cream);
}

.ba-shop .ba-card-media img,
.ba-shop .ba-card-img {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
    margin: 0;
    border: 0;
    border-radius: 0;
    transition: transform 0.5s ease;
}

.ba-shop .ba-shop-card:hover .ba-card-media img {
    transform: scale(1.05);
}

/* Title — secondary in the hierarchy: calm, scannable, never more than 2 lines.
   The !important rules override the theme's aggressive h3 styles. */
.ba-shop h3.ba-card-title {
    margin: 0 !important;
    padding: 20px 20px 0 !important;
    font-family: var(--ba-font-body) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-style: normal !important;
    line-height: 1.4 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: var(--ba-text) !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    /* Reserve exactly two lines so prices + buttons align across every card. */
    min-height: calc(2 * 1.4em + 20px);
}

/* Price — the visual hero of the card: larger, bolder, brand gold. */
.ba-shop .ba-card-price {
    padding: 10px 20px 0;
    font-family: var(--ba-font-body) !important;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ba-gold);
}

.ba-shop .ba-card-price .woocommerce-Price-amount,
.ba-shop .ba-card-price bdi {
    font-weight: 700;
    color: var(--ba-gold);
    white-space: nowrap;
}

.ba-shop .ba-card-price del,
.ba-shop .ba-card-price del .woocommerce-Price-amount {
    margin-right: 6px;
    font-weight: 400;
    font-size: 14px;
    color: var(--ba-text-light);
}

.ba-shop .ba-card-price ins,
.ba-shop .ba-card-price ins .woocommerce-Price-amount {
    text-decoration: none;
    color: var(--ba-gold);
}

/* Button — premium, full-width, identical size + position on every card. */
.ba-shop a.ba-card-btn {
    display: block;
    margin: 18px 20px 20px;
    margin-top: auto;
    padding: 13px 18px;
    font-family: var(--ba-font-body) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    color: var(--ba-gold);
    background: transparent;
    border: 1.5px solid var(--ba-gold);
    border-radius: 999px;
    cursor: pointer;
    transition: background 220ms ease, color 220ms ease, box-shadow 220ms ease;
}

.ba-shop a.ba-card-btn:hover,
.ba-shop a.ba-card-btn:focus {
    background: var(--ba-gold);
    color: var(--ba-white) !important;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(181, 154, 69, 0.30);
}

/* ----- Load more ----- */

.ba-shop-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.ba-shop-more {
    padding: 13px 38px;
    font-family: var(--ba-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ba-white);
    background: var(--ba-gold);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--ba-transition);
}

.ba-shop-more:hover {
    background: var(--ba-gold-hover);
}

.ba-shop-more[hidden] {
    display: none;
}

/* ==========================================================================
   Desktop: sidebar + grid
   ========================================================================== */

@media (min-width: 992px) {
    .ba-shop-layout {
        display: grid;
        grid-template-columns: minmax(220px, 24%) minmax(0, 1fr);
        gap: clamp(24px, 3vw, 44px);
        align-items: start;
        padding: 0 20px;
    }

    .ba-shop-sidebar {
        display: block;
        position: sticky;
        /* Clears the fixed Breakdance header; override per page if needed. */
        top: 110px;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        margin-bottom: 0;
    }

    .ba-shop-mobile {
        display: none;
    }

    .ba-shop-grid {
        grid-template-columns: repeat(var(--ba-shop-cols), minmax(0, 1fr));
        gap: clamp(22px, 2vw, 30px);
    }
}

/* Small phones */
@media (max-width: 420px) {
    .ba-shop-grid {
        gap: 12px;
    }

    .ba-shop h3.ba-card-title {
        font-size: 13px !important;
        padding: 16px 16px 0 !important;
        min-height: calc(2 * 1.4em + 16px);
    }

    .ba-shop .ba-card-price {
        font-size: 17px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .ba-shop a.ba-card-btn {
        margin: 14px 16px 16px;
        letter-spacing: 0.06em;
    }
}

/* ==========================================================================
   [ba_product_details] — premium single-product infographic
   ========================================================================== */

.ba-pd {
    max-width: 1080px;
    margin: 24px auto;
    padding: 0 12px;
}

/* ----- Metric badge cards ----- */

.ba-pd-badges {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.ba-pd-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 22px 14px;
    background: linear-gradient(160deg, #cdb45f 0%, var(--ba-gold) 60%, var(--ba-gold-hover) 100%);
    border-radius: 22px;
    color: var(--ba-white);
    box-shadow: 0 8px 22px rgba(181, 154, 69, 0.22);
}

.ba-pd-badge-label {
    font-family: var(--ba-font-body);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    opacity: 0.95;
}

.ba-pd-badge-value {
    font-family: var(--ba-font-heading);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.05;
}

/* ----- Content grid (cream cards) ----- */

.ba-pd-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.ba-pd-card {
    background: var(--ba-cream);
    border: 1px solid var(--ba-border-light);
    border-radius: var(--ba-radius);
    padding: 20px 20px 18px;
}

.ba-pd-card-title {
    margin: 0 0 8px;
    font-family: var(--ba-font-heading);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ba-gold);
}

.ba-pd-card-text {
    font-family: var(--ba-font-body);
    font-size: 14px;
    line-height: 1.65;
    color: var(--ba-text);
}

.ba-pd-card-text p {
    margin: 0 0 10px;
}

.ba-pd-card-text p:last-child {
    margin-bottom: 0;
}

@media (min-width: 600px) {
    .ba-pd-badges {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .ba-pd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 600px) and (max-width: 991px) {
    .ba-pd-badge-value {
        font-size: 26px;
    }
}
