/* ==========================================================================
   Handle Configurator — /configure/
   ========================================================================== */

/* ---------- Layout ---------- */
/* Ensure site-main fills width on configure page (Astra flex container) */
.page-template-page-configure .site-main {
    width: 100%;
}

.configurator {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 260px 1fr;
    background: var(--wh-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 32px rgba(61, 52, 39, 0.08);
}

/* ---------- Preview Panel ---------- */
.preview {
    background:
        radial-gradient(ellipse 70% 50% at 50% 20%, rgba(255, 248, 230, 0.7) 0%, transparent 70%),
        linear-gradient(180deg, #F0EBE3 0%, #E8E0D4 60%, #D4C9B5 100%);
    padding: 24px 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    position: sticky;
    top: 0;
    align-self: start;
}

.preview-svg-wrap {
    width: 140px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-top: 4px;
}

.preview-svg-wrap::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 22px;
    background: radial-gradient(ellipse, rgba(61, 52, 39, 0.25) 0%, transparent 70%);
    z-index: -1;
}

.preview-svg-wrap svg {
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(.4, 0, .2, 1);
}

.preview-glyph {
    position: absolute;
    top: 4px;
    right: -18px;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    padding: 3px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wh-text);
    box-shadow: 0 1px 3px rgba(61, 52, 39, 0.12);
    pointer-events: none;
    z-index: 2;
}
.preview-glyph svg {
    width: 100%;
    height: 100%;
    display: block;
}

.preview-summary {
    margin-top: 12px;
    text-align: center;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.preview-summary .label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--wh-accent);
    margin-bottom: 6px;
}

.preview-summary .name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--wh-text);
    line-height: 1.5;
    white-space: pre-line;
}

.tier-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 10px;
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 12px;
    font-weight: 500;
}

.tier-entry { background: var(--wh-surface); color: var(--wh-text-light); }
.tier-standard { background: var(--wh-secondary-bg); color: var(--wh-text); }
.tier-premium { background: var(--wh-text-light); color: var(--wh-bg); }
.tier-exotic { background: var(--wh-accent); color: var(--wh-bg); }

.price-display {
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--wh-white);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(61, 52, 39, 0.08);
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.preview > .cta {
    margin-top: 12px;
    width: 100%;
    max-width: 320px;
}

.price-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--wh-accent);
    margin-bottom: 4px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 300;
    color: var(--wh-text);
    line-height: 1;
    transition: color 0.3s;
}

.price-amount .currency {
    font-size: 1rem;
    vertical-align: top;
    margin-right: 2px;
    color: var(--wh-accent);
}

.price-disclaimer {
    font-size: 0.7rem;
    color: var(--wh-accent);
    margin-top: 6px;
}

.price-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--wh-surface);
    font-size: 0.72rem;
    color: var(--wh-text-light);
    text-align: left;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.price-row .delta { color: var(--wh-accent); font-weight: 500; }

.price-row.total {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed var(--wh-border);
    font-weight: 600;
    color: var(--wh-text);
}

/* ---------- Options Panel ---------- */
.options {
    padding: 0 24px 20px;
    overflow-y: auto;
    max-height: 100vh;
}

/* ---------- Configurator Tabs ---------- */
.cfg-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--wh-surface);
    position: sticky;
    top: 0;
    background: var(--wh-white);
    z-index: 5;
    padding-top: 12px;
}

.cfg-tab {
    flex: 1;
    padding: 10px 4px;
    font-size: 0.65rem;
    font-family: var(--wh-font);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--wh-accent);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.cfg-tab:hover { color: var(--wh-text); }
.cfg-tab.active { color: var(--wh-text); border-bottom-color: var(--wh-text); }

.cfg-panel { padding-top: 16px; }

.section { margin-bottom: 16px; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 12px;
}

.section-head > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    line-height: 1.2;
}

.configurator .section-label {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--wh-accent);
    line-height: 1.1;
    margin: 0;
}

.section-label + .section-jp::before {
    content: "/";
    margin-right: 4px;
    opacity: 0.55;
    font-style: normal;
}

.section-value {
    font-size: 0.8rem;
    color: var(--wh-text);
    font-weight: 500;
    line-height: 1.3;
    text-align: right;
}

.section-jp {
    font-size: 0.65rem;
    font-style: italic;
    color: var(--wh-accent);
    letter-spacing: 0.5px;
    margin-top: 0;
    line-height: 1;
    font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
}

.shape-option .shape-jp {
    display: block;
    font-size: 0.55rem;
    font-style: italic;
    color: var(--wh-accent);
    letter-spacing: 0.4px;
    margin-top: 1px;
    font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans JP", sans-serif;
}

.tier-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--wh-surface);
}

.tier-tab {
    padding: 8px 12px;
    font-size: 0.7rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--wh-accent);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tier-tab:hover { color: var(--wh-text); }
.tier-tab.active { color: var(--wh-text); border-bottom-color: var(--wh-text); }
.tier-tab .tier-price { display: block; font-size: 0.6rem; color: var(--wh-accent); margin-top: 2px; }

.wood-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wood-swatch {
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    overflow: hidden;
    background: #f5f0e8;
}

.wood-swatch svg { width: 100%; height: 100%; display: block; }
.wood-swatch:hover { transform: translateY(-2px); }
.wood-swatch.active { border-color: var(--wh-text); box-shadow: 0 0 0 3px rgba(61, 52, 39, 0.1); }

.wood-swatch-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 0.53rem;
    padding: 4px 2px 3px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: #fff;
    text-align: center;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.wood-swatch-price {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--wh-text);
    font-size: 0.58rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
}

.ferrule-cat { margin-bottom: 8px; }

.ferrule-cat-label {
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--wh-accent);
    margin-bottom: 4px;
    font-weight: 500;
}

.ferrule-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.ferrule-option {
    cursor: pointer;
    text-align: center;
    border: 2px solid var(--wh-border);
    border-radius: 5px;
    padding: 6px 3px;
    transition: border-color 0.2s, background 0.2s;
}

.ferrule-option:hover { border-color: var(--wh-accent); }
.ferrule-option.active { border-color: var(--wh-text); background: var(--wh-surface); }

.ferrule-grid-none .ferrule-option-none {
    grid-column: 1 / -1;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--wh-surface);
    border-style: dashed;
}
.ferrule-grid-none .ferrule-option-none span { display: inline; font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; color: var(--wh-text); font-weight: 500; }
.ferrule-grid-none .ferrule-option-none small { display: inline; margin-top: 0; font-size: 0.6rem; color: var(--wh-accent); }

.ferrule-preview {
    height: 18px;
    border-radius: 3px;
    margin-bottom: 3px;
    overflow: hidden;
}

.ferrule-option span { font-size: 0.62rem; color: var(--wh-text); font-weight: 500; display: block; line-height: 1.2; }
.ferrule-option small { font-size: 0.55rem; color: var(--wh-accent); display: block; margin-top: 1px; }

.fp-black-horn { background: linear-gradient(180deg, #2a2a2a, #0a0a0a 50%, #000); }
.fp-blonde-horn { background: linear-gradient(180deg, #e8d4a8, #b89a70 50%, #8a7048); }
.fp-white-horn { background: linear-gradient(180deg, #f5f0dc, #d8d0b0 50%, #b0a880); }
.fp-marbled-horn { background: radial-gradient(ellipse 30% 50% at 30% 40%, #d4b080, transparent), radial-gradient(ellipse 40% 60% at 70% 60%, #5a3a20, transparent), linear-gradient(180deg, #8a6040, #3a2010); }
.fp-ebony { background: linear-gradient(180deg, #2a1810, #0a0604 50%, #000); }
.fp-padauk { background: linear-gradient(180deg, #c04820, #8b3010 50%, #5a1808); }
.fp-pakkawood { background: linear-gradient(180deg, #5a3018, #3a1808 50%, #1a0804); }
.fp-brass { background: linear-gradient(180deg, #e8c860, #b8982c 50%, #806818); }
.fp-nickel { background: linear-gradient(180deg, #e0e0e0, #a8a8a8 50%, #606060); }
.fp-micarta { background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15) 1px, transparent 1px, transparent 3px), linear-gradient(180deg, #4a3020, #2a1810 50%, #1a0f08); }
.fp-turquoise { background: linear-gradient(180deg, #5cc0d0, #48a8b8 50%, #2a808a); }
.fp-pink-coral { background: linear-gradient(180deg, #e06888, #c85070 50%, #8a2840); }
.fp-copper { background: linear-gradient(180deg, #d8885c, #b06838 50%, #6a3818); }
.fp-none { background: repeating-linear-gradient(45deg, #eee, #eee 4px, #f8f8f8 4px, #f8f8f8 8px); border: 1px dashed #ccc; }

.endcap-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.endcap-option {
    cursor: pointer;
    text-align: center;
    border: 2px solid var(--wh-border);
    border-radius: 5px;
    padding: 6px 3px;
    transition: border-color 0.2s, background 0.2s;
}

.endcap-option:hover { border-color: var(--wh-accent); }
.endcap-option.active { border-color: var(--wh-text); background: var(--wh-surface); }
.endcap-option span { font-size: 0.62rem; color: var(--wh-text); font-weight: 500; display: block; line-height: 1.2; }
.endcap-option small { font-size: 0.55rem; color: var(--wh-accent); display: block; margin-top: 1px; }

.endcap-grid-none .endcap-option-none {
    grid-column: 1 / -1;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--wh-surface);
    border-style: dashed;
}
.endcap-grid-none .endcap-option-none span { display: inline; font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; }
.endcap-grid-none .endcap-option-none small { display: inline; margin-top: 0; }

.shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.shape-option {
    cursor: pointer;
    text-align: center;
    border: 2px solid var(--wh-border);
    border-radius: 6px;
    padding: 8px 4px;
    transition: border-color 0.2s;
}

.shape-option:hover { border-color: var(--wh-accent); }
.shape-option.active { border-color: var(--wh-text); background: var(--wh-surface); }
.shape-visual {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    color: var(--wh-text);
}
.shape-visual > svg:not(.shape-glyph) {
    width: 40px;
    height: 32px;
}
.shape-visual .shape-glyph {
    flex-shrink: 0;
    opacity: 0.75;
}
.shape-option.active .shape-glyph { opacity: 1; }
.shape-option span { font-size: 0.65rem; color: var(--wh-text); font-weight: 500; display: block; line-height: 1.2; }
.shape-option small { font-size: 0.55rem; color: var(--wh-accent); display: block; margin-top: 1px; }

.size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.size-option {
    cursor: pointer;
    text-align: center;
    border: 2px solid var(--wh-border);
    border-radius: 6px;
    padding: 8px 4px;
    transition: all 0.2s;
}

.size-option:hover { border-color: var(--wh-accent); }
.size-option.active { border-color: var(--wh-text); background: var(--wh-text); color: var(--wh-bg); }
.size-option .letter { font-weight: 600; font-size: 0.9rem; }
.size-option .range { font-size: 0.6rem; color: var(--wh-accent); margin-top: 2px; }
.size-option.active .range { color: var(--wh-secondary-bg); }
.size-option .price-mod { font-size: 0.58rem; color: var(--wh-accent); margin-top: 2px; }
.size-option.active .price-mod { color: var(--wh-secondary-bg); }

.configurator .cta {
    display: block;
    width: 100%;
    padding: 14px;
    background: var(--wh-text);
    color: var(--wh-bg);
    border: none;
    border-radius: var(--wh-radius);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 12px;
    font-family: var(--wh-font);
}

.configurator .cta:hover { background: var(--wh-text-light); }

/* ---------- Step 2 Form ---------- */
.step2-form .back-link {
    background: none;
    border: none;
    color: var(--wh-accent);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    margin-bottom: 16px;
    letter-spacing: 0;
    text-transform: none;
}

.step2-form .back-link:hover { color: var(--wh-text); }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--wh-accent);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    box-sizing: border-box;
}

.form-group input[type="file"] {
    font-size: 0.85rem;
    color: var(--wh-text-light);
}

.form-hint {
    display: block;
    font-size: 0.7rem;
    color: var(--wh-accent);
    margin-top: 4px;
}

/* ---------- Inline Spacer (chips under Ferrule / End Cap) ---------- */
.spacer-inline {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--wh-border);
}

.spacer-inline .section-head {
    margin-bottom: 8px;
}

.section-sublabel {
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--wh-text);
    font-weight: 500;
}

.section-sublabel .optional {
    font-size: 0.65rem;
    letter-spacing: 0;
    text-transform: none;
    color: var(--wh-accent);
    font-weight: 400;
    font-style: italic;
    margin-left: 4px;
}

.chips {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 0.72rem;
    border-radius: 14px;
    border: 1px solid var(--wh-border);
    background: var(--wh-white);
    cursor: pointer;
    color: var(--wh-text);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1.3;
}

.chip small {
    font-size: 0.62rem;
    color: var(--wh-accent);
    margin-left: 2px;
}

.chip:hover {
    border-color: var(--wh-accent);
}

.chip.active {
    background: var(--wh-text);
    color: var(--wh-bg);
    border-color: var(--wh-text);
}

.chip.active small {
    color: var(--wh-secondary-bg);
}

.chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.chip-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* ---------- Zone Glow (active-tab anatomy highlight) ---------- */
#zoneGlow rect {
    transition: opacity 0.3s ease-in-out;
    transform-box: fill-box;
    transform-origin: center;
}

@keyframes zone-breathe {
    0%, 100% {
        opacity: 0.95;
        stroke-width: 3;
        filter: drop-shadow(0 0 0 var(--wh-gold, #C9A14A));
    }
    50% {
        opacity: 0.55;
        stroke-width: 4;
        filter: drop-shadow(0 0 6px var(--wh-gold, #C9A14A));
    }
}

#handleSvg[data-active-zone="wood"] #zoneGlowBody,
#handleSvg[data-active-zone="ferrule"] #zoneGlowFerrule,
#handleSvg[data-active-zone="endcap"] #zoneGlowEndcap,
#handleSvg[data-active-zone="finish"] #zoneGlowWhole {
    opacity: 1;
    animation: zone-breathe 2.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
    #handleSvg[data-active-zone="wood"] #zoneGlowBody,
    #handleSvg[data-active-zone="ferrule"] #zoneGlowFerrule,
    #handleSvg[data-active-zone="endcap"] #zoneGlowEndcap,
    #handleSvg[data-active-zone="finish"] #zoneGlowWhole {
        animation: none;
    }
}

/* ---------- Mobile preview toggle (hidden on desktop) ---------- */
.preview-toggle {
    display: none;
    position: absolute;
    top: 6px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--wh-accent);
    z-index: 5;
    align-items: center;
    justify-content: center;
}

.preview-toggle svg {
    display: block;
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}

.preview.collapsed .preview-toggle svg {
    transform: rotate(180deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .configurator {
        grid-template-columns: 1fr;
    }

    .preview {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 14px 16px 12px;
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 14px;
        row-gap: 6px;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid var(--wh-border);
    }

    .preview-svg-wrap {
        width: 84px;
        height: 190px;
        margin-top: 0;
        grid-row: 1 / span 2;
    }

    .preview-svg-wrap::after { display: none; }

    .preview-summary {
        margin-top: 0;
        text-align: left;
        max-width: none;
    }

    .preview-summary .label { font-size: 0.6rem; margin-bottom: 2px; }
    .preview-summary .name { font-size: 0.85rem; }

    .price-display {
        min-width: 0;
        width: 100%;
        padding: 10px 14px;
        margin-top: 0;
        text-align: left;
    }

    .price-label { font-size: 0.6rem; }
    .price-amount { font-size: 1.6rem; }
    .price-disclaimer { font-size: 0.6rem; }
    .price-breakdown { display: none; }
    .tier-badge { margin-top: 2px; font-size: 0.6rem; }

    .preview > .cta { max-width: none; grid-column: 1 / span 2; margin-top: 8px; }
}

@media (max-width: 640px) {
    /* Compact preview band — target ~140px so options stay in view */
    .preview { padding: 8px 14px 8px; row-gap: 2px; }
    .preview-svg-wrap { width: 60px; height: 130px; }
    .preview-glyph {
        width: 20px;
        height: 20px;
        top: 2px;
        right: -10px;
        padding: 2px;
    }
    .preview.collapsed .preview-glyph { display: none; }

    .preview-summary .label { display: none; }
    .preview-summary .name {
        font-size: 0.8rem;
        line-height: 1.3;
        white-space: normal;
    }
    .tier-badge { display: none; }

    .price-display {
        padding: 0;
        background: transparent;
        box-shadow: none;
        margin-top: 0;
    }
    .price-label,
    .price-disclaimer { display: none; }
    .price-amount { font-size: 1.2rem; }

    /* Show collapse chevron on mobile */
    .preview-toggle { display: inline-flex; }

    /* ----- Collapsed preview state (chip-height bar) ----- */
    .preview.collapsed {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto;
        padding: 10px 40px 10px 14px;
        column-gap: 10px;
        row-gap: 0;
    }
    .preview.collapsed .preview-svg-wrap { display: none; }
    .preview.collapsed .preview-summary {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
        align-self: center;
    }
    .preview.collapsed .preview-summary .name {
        font-size: 0.78rem;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .preview.collapsed .price-display {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
    }
    .preview.collapsed .price-amount { font-size: 1.05rem; }

    /* ----- Horizontal-scroll option grids (category grids only) ----- */
    .wood-grid,
    .ferrule-grid:not(.ferrule-grid-none),
    .endcap-grid:not(.endcap-grid-none) {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
        padding-bottom: 2px;
    }
    .wood-grid::-webkit-scrollbar,
    .ferrule-grid::-webkit-scrollbar,
    .endcap-grid::-webkit-scrollbar { display: none; }

    .wood-swatch,
    .ferrule-grid:not(.ferrule-grid-none) .ferrule-option,
    .endcap-grid:not(.endcap-grid-none) .endcap-option {
        flex: 0 0 calc((100% - 12px) / 3);
        min-width: 95px;
    }

    /* Scroll indicator — right-edge fade + arrow chip when overflow exists */
    .wood-grid.is-scrollable,
    .ferrule-grid.is-scrollable,
    .endcap-grid.is-scrollable {
        -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
        mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
    }
    .wood-grid.is-scrollable.scrolled-end,
    .ferrule-grid.is-scrollable.scrolled-end,
    .endcap-grid.is-scrollable.scrolled-end {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 100%);
    }
    .wood-grid.is-scrollable.scrolled-middle,
    .ferrule-grid.is-scrollable.scrolled-middle,
    .endcap-grid.is-scrollable.scrolled-middle {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    }

    .options { padding: 14px 14px 90px; }

    /* Horizontal-scroll tabs */
    .cfg-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .cfg-tabs::-webkit-scrollbar { display: none; }
    .cfg-tab { flex: 0 0 auto; padding: 10px 14px; white-space: nowrap; }

    /* Sticky CTA at viewport bottom */
    .preview > .cta {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        margin: 0;
        max-width: none;
        z-index: 20;
        min-height: 54px;
    }

    .section { margin-bottom: 14px; }
}

@media (max-width: 480px) {
    .configurator {
        border-radius: 0;
        box-shadow: none;
    }

    .preview-summary .name { font-size: 0.75rem; line-height: 1.3; }
    .price-amount { font-size: 1.15rem; }

    .options { padding: 12px 12px 90px; }

    .wood-grid,
    .ferrule-grid,
    .endcap-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .shape-grid,
    .size-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chip { font-size: 0.7rem; padding: 5px 9px; }

    /* Tier tabs: horizontal scroll */
    .tier-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .tier-tabs::-webkit-scrollbar { display: none; }
    .tier-tab { white-space: nowrap; flex-shrink: 0; }

    /* Touch-friendly inputs */
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="number"],
    .form-group textarea {
        font-size: 16px;
    }
}

/* ---------- Shape transition ---------- */
#handleSvg > g[id^="handle"] {
    opacity: 0;
    transition: opacity 250ms ease-out;
}
#handleSvg > g[id^="handle"].is-visible {
    opacity: 1;
}
#handleSvg > g[id^="handle"].is-entering {
    transition: opacity 250ms ease-out 50ms;
}

@keyframes glyph-pop {
    0%   { transform: scale(0.7); opacity: 0.3; }
    60%  { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
.preview-glyph svg.pop {
    animation: glyph-pop 400ms cubic-bezier(0.5, 1.6, 0.4, 1);
    transform-origin: center;
}

@media (prefers-reduced-motion: reduce) {
    #handleSvg > g[id^="handle"],
    #handleSvg > g[id^="handle"].is-entering {
        transition: none;
    }
    .preview-glyph svg.pop { animation: none; }
}
