﻿/* === Design tokens === */
    .hp-w {
        --hp-sans:   "Manrope", sans-serif;
        --hp-serif:  "Fraunces", serif;
        --hp-cream:  #FDFBF7;
        --hp-bg:     #F5F1EA;
        --hp-border: #E6E0D4;
        --hp-muted:  #7A6F5C;
        --hp-subtle: #9A8F7C;
        --hp-dark:   #2C2418;
        --hp-blue:   #1B4F7C;
        --hp-glow:   rgba(27,79,124,0.12);
        --hp-r:      8px;
    }

    /* === Wrapper === */
    .hp-w {
        margin: 1.2em 0;
        background: var(--hp-cream);
        border: 1.5px solid var(--hp-border);
        border-radius: var(--hp-r);
        font-family: var(--hp-sans);
        overflow: hidden;
    }

    /* === Header row === */
    .hp-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px 10px;
    }
    /* ── Variant selector (Frisch/Tiefkuehl) ── */
    .hp-var {
        padding: 0 16px 12px;
    }
    .hp-var-lb {
        font-family: var(--hp-sans);
        font-size: 16px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--hp-muted);
        margin-bottom: 8px;
    }
    .hp-var-opts {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .hp-var-opt {
        position: relative;
        flex: 1 1 0;
        min-width: 110px;
        cursor: pointer;
    }
    .hp-var-opt input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }
    .hp-var-opt span {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 52px;
        border: 2px solid var(--hp-border);
        border-radius: 12px;
        font-family: var(--hp-sans);
        font-size: 18px;
        font-weight: 600;
        color: var(--hp-dark);
        background: #fff;
        transition: border-color .18s, background .18s, color .18s;
        text-align: center;
        padding: 0 10px;
    }
    .hp-var-opt input:checked + span {
        border-color: var(--hp-blue);
        background: var(--hp-blue);
        color: #fff;
    }
    .hp-var-opt input:focus-visible + span {
        outline: 2px solid var(--hp-blue);
        outline-offset: 2px;
    }
    .hp-var.hp-var-err .hp-var-lb { color: #C0392B; }
    .hp-var.hp-var-err .hp-var-opt span { border-color: #E74C3C; }

    .hp-lb {
        font-family: var(--hp-sans);
        font-size: 16px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--hp-muted);
    }
    .hp-lbsm { font-size: 15px; }
    .hp-rh {
        font-family: var(--hp-sans);
        font-size: 16px;
        font-weight: 600;
        color: var(--hp-subtle);
    }

    /* =============================================
       CONTROL ROW — always a single full-width dropdown
       (or a single full-width input in custom-only mode)
       ============================================= */
    .hp-cr {
        display: flex;
        align-items: stretch;
        margin: 0 12px 12px;
        border: 1.5px solid var(--hp-border);
        border-radius: var(--hp-r);
        background: #fff;
        overflow: hidden;
        transition: border-color .2s ease, box-shadow .2s ease;
    }
    .hp-cr:focus-within {
        border-color: var(--hp-blue);
        box-shadow: 0 0 0 3px var(--hp-glow);
    }

    /* Dropdown cell — always full width */
    .hp-dc {
        position: relative;
        display: flex;
        align-items: center;
        flex: 1;
    }
    .hp-sel {
        width: 100%;
        height: 100%;
        border: none;
        outline: none;
        padding: 0 40px 0 16px;
        font-family: var(--hp-sans);
        font-size: 21px;
        font-weight: 600;
        color: var(--hp-blue);
        background: transparent;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        min-height: 58px;
    }
    .hp-sel option        { color: var(--hp-dark); font-weight: 500; }
    .hp-sel option[value=""]      { color: var(--hp-muted); }
    .hp-sel option[value="custom"] { color: var(--hp-muted); font-style: italic; }
    .hp-chev {
        position: absolute;
        right: 13px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }

    /* Custom-only mode input cell (no dropdown) */
    .hp-ic {
        flex: 1;
        display: flex;
        align-items: center;
        min-width: 0;
    }

    /* Stepper buttons */
    .hp-sb {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 58px;
        flex-shrink: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 24px;
        font-weight: 700;
        color: var(--hp-muted);
        font-family: var(--hp-sans);
        transition: color .15s, background .15s;
        user-select: none;
    }
    .hp-sb:hover  { color: var(--hp-dark); background: var(--hp-bg); }
    .hp-sb:active { transform: scale(.92); }
    .hp-off { opacity: .2 !important; pointer-events: none; }

    /* Number input */
    .hp-ni {
        flex: 1;
        min-width: 0;
        border: none;
        outline: none;
        text-align: right;
        font-family: var(--hp-sans);
        font-size: 22px;
        font-weight: 700;
        color: var(--hp-blue);
        padding: 0 0 0 4px;
        background: transparent;
        -moz-appearance: textfield;
    }
    .hp-ni::-webkit-outer-spin-button,
    .hp-ni::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
    .hp-ni::placeholder { font-weight: 400; color: #D4CCBD; font-size: 18px; }

    .hp-gu {
        font-family: var(--hp-sans);
        font-size: 16px;
        font-weight: 800;
        color: var(--hp-muted);
        letter-spacing: .02em;
        padding: 0 8px 0 3px;
        flex-shrink: 0;
        pointer-events: none;
    }

    /* =============================================
       CUSTOM DRAWER
       Slides down below the dropdown when "Custom" selected.
       Uses a real label element — no ::before tricks that
       conflict with overflow:hidden on the slide container.
       ============================================= */
    .hp-cx {
        max-height: 0;
        overflow: hidden;
        transition: max-height .28s cubic-bezier(.4,0,.2,1),
                    opacity .2s ease;
        opacity: 0;
        margin: 0 12px;
    }
    .hp-cx.hp-cx-open {
        max-height: 150px;
        opacity: 1;
        padding: 3px 0 0;       /* 3px top: just enough for box-shadow glow to not clip */
        margin-bottom: 12px;    /* matches the gap .hp-cr already has below it */
    }

    /* Small pill label above the bordered row */
    .hp-cx-label {
        font-family: var(--hp-sans);
        font-size: 15px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: var(--hp-blue);
        padding: 0 2px 6px;
    }

    /* Bordered input row */
    .hp-cx-inner {
        display: flex;
        align-items: center;
        border: 1.5px solid var(--hp-blue);
        border-radius: var(--hp-r);
        background: #fff;
        box-shadow: 0 0 0 3px var(--hp-glow);
    }
    .hp-cx-inner .hp-ni { padding-top: 0; }
    .hp-cx-inner .hp-sb { height: 58px; }

    /* =============================================
       ACTION BAR
       Two visual states:
         idle  → cream/sandy, standard border
         active → deep navy gradient, gold accent line
       ============================================= */
    .hp-bar {
        position: relative;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 18px;
        background: var(--hp-bg);
        border-top: 1.5px solid var(--hp-border);
        transition: background .35s ease, border-top-color .35s ease;
        overflow: hidden;
    }

    /* Gold thread — sweeps in at the top when active */
    .hp-bar::before {
        content: "";
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 2px;
        background: linear-gradient(
            90deg,
            transparent 0%,
            #C8860A 25%,
            #F0B832 50%,
            #C8860A 75%,
            transparent 100%
        );
        opacity: 0;
        transform: scaleX(.6);
        transition: opacity .4s ease, transform .4s ease;
        transform-origin: center;
    }

    /* Active: deep navy gradient, gold line, border gone */
    .hp-bar.hp-on {
        background: linear-gradient(150deg, #0B2840 0%, #1B4F7C 100%);
        border-top-color: transparent;
    }
    .hp-bar.hp-on::before {
        opacity: 1;
        transform: scaleX(1);
    }
    .hp-bar.hp-on .hp-lb,
    .hp-bar.hp-on .hp-lbsm { color: rgba(255,255,255,.6); }

    /* ── Qty column ── */
    .hp-qcol { display: flex; flex-direction: column; gap: 5px; }

    .hp-ct {
        display: flex;
        align-items: center;
        border: 1.5px solid var(--hp-border);
        border-radius: 7px;
        background: #fff;
        overflow: hidden;
        transition: border-color .3s ease, background .3s ease;
    }
    .hp-bar.hp-on .hp-ct {
        border-color: rgba(255,255,255,.16);
        background: rgba(255,255,255,.06);
    }

    .hp-qb {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border: none;
        background: transparent;
        cursor: pointer;
        font-size: 20px;
        font-weight: 700;
        color: var(--hp-muted);
        font-family: var(--hp-sans);
        transition: color .15s, background .15s;
        user-select: none;
    }
    .hp-qb:hover { color: var(--hp-dark); background: rgba(0,0,0,.04); }
    .hp-bar.hp-on .hp-qb { color: rgba(255,255,255,.6); }
    .hp-bar.hp-on .hp-qb:hover { color: #fff; background: rgba(255,255,255,.1); }

    .hp-cn {
        min-width: 40px;
        text-align: center;
        font-family: var(--hp-sans);
        font-size: 20px;
        font-weight: 800;
        color: var(--hp-dark);
        border-left: 1px solid var(--hp-border);
        border-right: 1px solid var(--hp-border);
        padding: 6px 4px;
        transition: color .3s ease, border-color .3s ease;
    }
    .hp-bar.hp-on .hp-cn { color: #fff; border-color: rgba(255,255,255,.16); }

    /* ── Price column ── */
    .hp-tcol {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0;
    }
    .hp-tpw {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    /* Idle dash */
    .hp-tpe {
        font-family: var(--hp-sans);
        font-size: 22px;
        color: var(--hp-subtle);
        font-weight: 400;
    }
    /* Active price block */
    .hp-tpc {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 2px;
        animation: hp-price-in .3s cubic-bezier(.22,.68,0,1.2) both;
    }
    /* The price figure — Fraunces italic, big, white */
    .hp-tp {
        font-family: var(--hp-serif);
        font-style: italic;
        font-size: 36px;
        font-weight: 900;
        color: #fff;
        letter-spacing: -.03em;
        line-height: 1;
        /* Subtle warm glow behind the number */
        text-shadow: 0 0 24px rgba(240,184,50,.2);
    }
    /* Breakdown line: "2 × 250g = 500g" or just "250g" */
    .hp-det {
        font-family: var(--hp-sans);
        font-size: 13px;
        font-weight: 700;
        color: rgba(255,255,255,.65);
        letter-spacing: .05em;
        text-transform: uppercase;
    }

    @keyframes hp-price-in {
        from { opacity: 0; transform: translateY(5px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Utility */
    .hp-h   { display: none !important; }
    .hp-w ~ .quantity { display: none !important; }

    @keyframes hp-shake {
        0%,100%{transform:translateX(0);}
        20%{transform:translateX(-4px);}40%{transform:translateX(4px);}
        60%{transform:translateX(-3px);}80%{transform:translateX(3px);}
    }
    .hp-shake { animation: hp-shake .4s ease; }

    /* =============================================
       RESPONSIVE
       Dropdown is always full-width so no structural
       changes needed. Just tighten touch targets.
       ============================================= */
    @media (max-width: 520px) {
        .hp-sb { width: 50px; height: 56px; font-size: 22px; }
        .hp-cx-inner .hp-sb { height: 56px; }
        .hp-sel { font-size: 19px; min-height: 56px; }
        .hp-bar { padding: 14px 14px; }
        .hp-tp { font-size: 32px; }
    }

    /* =============================================
       NATIVE VARIATION SELECT - styled to match .hp-w
       Table structure intentionally preserved - overriding
       display on table/tr/td breaks WooCommerce variation JS.
       Only safe properties are changed here.
       ============================================= */

    .variations_form .variations {
        width: 100%;
        border: none;
        border-collapse: separate;
        border-spacing: 0 10px;
        margin-bottom: 0.5em;
    }

    .variations_form .variations .label {
        padding: 14px 0 6px;
        white-space: nowrap;
        vertical-align: top;
        width: 1%;
    }
    .variations_form .variations .label label {
        font-family: "Manrope", sans-serif;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        color: #7A6F5C;
        padding-right: 14px;
    }

    .variations_form .variations .value {
        padding: 0;
        width: 100%;
    }

    /* Wrapper div injected by JS around the native select */
    .hp-var-wrap {
        position: relative;
        display: flex;
        align-items: stretch;
        border: 1.5px solid #E6E0D4;
        border-radius: 8px;
        background: #fff;
        overflow: hidden;
        transition: border-color .2s ease, box-shadow .2s ease;
    }
    .hp-var-wrap:focus-within {
        border-color: #1B4F7C;
        box-shadow: 0 0 0 3px rgba(27,79,124,0.12);
    }

    .hp-var-wrap select {
        width: 100%;
        height: 100%;
        border: none !important;
        outline: none !important;
        padding: 0 40px 0 16px;
        font-family: "Manrope", sans-serif;
        font-size: 21px;
        font-weight: 600;
        color: #1B4F7C;
        background: transparent !important;
        appearance: none;
        -webkit-appearance: none;
        cursor: pointer;
        min-height: 58px;
        box-shadow: none !important;
    }
    .hp-var-wrap select option       { color: #2C2418; font-weight: 500; }
    .hp-var-wrap select option[value=""] { color: #7A6F5C; }

    .hp-var-chev {
        position: absolute;
        right: 13px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
        display: flex;
        align-items: center;
    }

    .variations_form .reset_variations { display: none !important; }

    @media (max-width: 520px) {
        .hp-var-wrap select { font-size: 19px; min-height: 56px; }
    }
