:root {
    /* Shared "no minimum order" tag colour: forest green, dark enough for
       white text to read at the tag's small size. */
    --forest-green: #1e5631;
}

/* Hamper customisation popup, product detail popup and minimum-order tag.
   Shared by every page that offers hampers (catalogue-hamper.html, index.html,
   catalogue-local.html); built by catalogue-hampers.js. The popup layers sit
   above the order bar and the checkout pages. */

.hamper-moq-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: rgba(244, 199, 84, 0.18);
    color: var(--accent-gold);
    border: 1px solid rgba(244, 199, 84, 0.4);
    border-radius: 999px;
    padding: 3px 10px;
    margin-top: 8px;
}

.hamper-moq-badge-none {
    background: var(--forest-green);
    color: #ffffff;
    border-color: var(--forest-green);
}


.hamper-qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.hamper-qty-btn {
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.hamper-qty-btn:hover {
    background: rgba(255, 255, 255, 0.24);
}

.hamper-qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
}


/* ---------- Configurator bottom sheet ---------- */
.config-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2200;
    pointer-events: none;
    transition: background 0.25s ease;
}

.config-overlay.open {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

.config-sheet {
    position: relative;
    background: #ffffff;
    color: #2a1810;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
    transform: translateY(115%);
    transition: transform 0.28s ease;
    font-family: var(--font-main);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* `clip`, unlike `hidden`, can never be scrolled by the browser (e.g. when
       it focuses a checkbox), which would push the list out of view. */
    overflow: hidden;
    overflow: clip;
}

.config-overlay.open .config-sheet {
    transform: translateY(0);
}

/* Floats over the photo (like the product popup) so no white band sits above it. */
.config-sheet-handle {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 2;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.config-sheet.no-image .config-sheet-handle {
    background: #e0d8c8;
    box-shadow: none;
}

.config-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f0ebe0;
    color: #2a1810;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.config-close:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Header block (image, name, description, tags, note) now renders
   as the first part of .config-sheet-body so it scrolls with the
   rest of the content — on a short phone screen that guarantees
   the picks and the footer (qty/total/Add to Order) stay reachable
   instead of being squeezed out by a tall fixed header. */
/* Edge to edge and square, like the product popup's photo. */
.config-header-image {
    width: calc(100% + 44px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    margin: 0 -22px 4px;
}

.config-header-image-note {
    font-size: 0.72rem;
    font-style: italic;
    color: #8a7a63;
    margin: 0 0 10px;
}

.config-sheet-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #5a1018;
    margin: 10px 0 6px;
}

.config-header-desc {
    font-size: 0.85rem;
    color: #5a4636;
    line-height: 1.4;
    margin: 0 0 10px;
}

/* "Most-Loved Combinations" suggestion box, with a checkbox that applies it. */
.config-reco {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    background: #f7f3ea;
    border: 1.5px dashed #b8862b;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 0 12px;
    cursor: pointer;
}

.config-reco-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.config-reco-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #5a1018;
}

.config-reco-hint {
    font-size: 0.72rem;
    color: #8a7a63;
    margin-top: -4px;
}

.config-reco-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.config-reco-heading {
    font-size: 0.7rem;
    font-weight: 700;
    color: #8a7a63;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.config-reco-items {
    font-size: 0.8rem;
    color: #2a1810;
    line-height: 1.35;
}

.config-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.config-tags-row .hamper-moq-badge {
    margin-top: 0;
}

/* The popup is light, so the gold tag colours used on the dark pages fade out
   here; the minimum-order tag gets dark text on a solid pale-gold fill. */
.config-tags-row .hamper-moq-badge:not(.hamper-moq-badge-none) {
    background: #fbe7ad;
    color: #5a1018;
    border-color: #b8862b;
}

.config-header-note {
    font-size: 0.78rem;
    color: #7a6a5a;
    margin: 0 0 14px;
}

.config-sheet.no-image .config-header-block {
    padding-top: 28px;
}

.config-header-block {
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f0ebe0;
}

.config-sheet-body {
    padding: 0 22px 4px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.config-section {
    margin-bottom: 22px;
}

.config-section-title {
    font-weight: 700;
    color: #5a1018;
    font-size: 0.95rem;
    margin: 0 0 2px;
}

.config-section-progress {
    font-size: 0.76rem;
    color: #8a7a63;
    font-weight: 600;
    margin-bottom: 10px;
}

.config-section-progress.complete {
    color: #1f8a4c;
}

.config-addon-category-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #8a7a63;
    margin: 12px 0 8px;
}

.config-addon-category-title:first-of-type {
    margin-top: 4px;
}

.config-group-heading {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #8a7a63;
    margin: 14px 0 8px;
}

.config-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item row: a tappable photo (opens the product detail popup) plus
   a name that — in a single-pick-per-item group — is itself the
   checkbox's label, or else sits beside a +/- stepper. No price,
   description or weight shows here any more (Part D); the running
   total in the footer still reflects every pick. */
.config-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f7f3ea;
    border-radius: 10px;
    padding: 8px 12px;
    transition: background-color 0.15s ease;
}

.config-option.is-selected {
    background: #e7f5ec;
}

.config-option.is-disabled {
    opacity: 0.6;
}

.config-option-photo-btn {
    flex-shrink: 0;
    border: none;
    background: none;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    line-height: 0;
}

.config-option-photo-btn:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.config-option-image {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.config-option.is-disabled .config-option-image {
    opacity: 0.6;
}

.config-option-body {
    /* Anchors the row's visually-hidden checkbox to the row itself. */
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    cursor: pointer;
}

.config-option-body-plain {
    cursor: default;
}

.config-option.is-disabled .config-option-body {
    cursor: not-allowed;
}

.config-option-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #2a1810;
    flex: 1 1 auto;
}

.config-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.config-option-note {
    font-size: 0.75rem;
    color: #7a6a58;
}

.config-option-note-warning {
    color: #b3541e;
}

.config-option.is-disabled .config-option-name {
    color: #a89a86;
}

/* Checkbox control (single-pick-per-item groups: Part D §4) */
.config-checkbox-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}

.config-checkbox-box {
    position: relative;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 2.5px solid #1f8a4c;
    background: #ffffff;
}

.config-checkbox-input:checked ~ .config-checkbox-box {
    background: #1f8a4c;
    border-color: #1f8a4c;
}

.config-checkbox-input:checked ~ .config-checkbox-box::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 4px;
    width: 7px;
    height: 13px;
    border: solid #ffffff;
    border-width: 0 3px 3px 0;
    transform: rotate(40deg);
}

.config-checkbox-input:disabled ~ .config-checkbox-box {
    border-color: #d8d2c5;
    background: #efe9db;
}

.config-checkbox-input:disabled:checked ~ .config-checkbox-box {
    background: #bcd2c5;
    border-color: #bcd2c5;
}

.config-checkbox-input:focus-visible ~ .config-checkbox-box {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

/* +/- stepper control (multi-pick groups and ceramic add-ons) */
.config-option .hamper-qty-btn {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    background: #ffffff;
    color: #5a1018;
    border: 1.5px solid #1f8a4c;
}

.config-option .hamper-qty-btn:disabled {
    background: #efe9db;
    border-color: #d8d2c5;
    color: #b8ae9c;
    cursor: not-allowed;
}

.config-option .hamper-qty-btn:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.config-option .hamper-qty-value {
    color: #2a1810;
}

/* Product detail popup: opened by tapping an item's photo. Sits
   above the configurator sheet (higher z-index) and closes without
   touching the hamper selections beneath it. */
.product-detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2300;
    padding: 24px;
}

.product-detail-overlay[hidden] {
    display: none;
}

.product-detail-content {
    position: relative;
    max-width: 360px;
    width: 100%;
    max-height: 88vh;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    font-family: var(--font-main);
    color: #2a1810;
    box-sizing: border-box;
}

/* The text and photo scroll in here, so the close button (a sibling) stays put. */
.product-detail-scroll {
    overflow-y: auto;
    padding: 20px;
    min-height: 0;
}

.product-detail-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin-bottom: 14px;
}

.product-detail-img[hidden] {
    display: none;
}

.product-detail-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #5a1018;
    margin: 0 0 8px;
}

.product-detail-desc {
    font-size: 0.85rem;
    line-height: 1.45;
    margin: 0 0 10px;
}

.product-detail-desc[hidden],
.product-detail-ingredients[hidden] {
    display: none;
}

.product-detail-ingredients {
    font-size: 0.8rem;
    color: #5a4636;
    line-height: 1.4;
    margin: 0;
}

.product-detail-ingredients-lead {
    font-weight: 700;
    color: #2a1810;
}

.product-detail-close {
    /* Inside the box and outside the scrolling part, so it never scrolls away. */
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #2a1810;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.product-detail-close:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.config-sheet-footer {
    border-top: 1px solid #f0ebe0;
    padding: 10px 22px calc(10px + env(safe-area-inset-bottom));
    flex-shrink: 0;
    background: #faf7f0;
}

.config-footer-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.config-qty-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.config-qty-row-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2a1810;
}

.config-qty-block .hamper-qty-btn {
    background: #f0ebe0;
    color: #5a1018;
    width: 32px;
    height: 32px;
}

.config-add-btn {
    background: var(--bg-color);
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 9px 22px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.config-add-btn-amount {
    font-weight: 800;
}

.config-add-btn:hover {
    background: #a21829;
}


