/*
 * Gift Packages — Builder stylesheet.
 *
 * Visual language mirrors the Figma Shop page: dot progress bar, two-column
 * sections with a left-side illustration, borderless quantity steppers, and a
 * light grey band around the gift-box section. Typography is DM Sans. All
 * classes are prefixed `.gpk-` and scoped under `.gpk-builder` so the styles
 * never leak into the surrounding theme / Elementor markup.
 */

.gpk-builder {
    --gpk-red: #E30613;
    --gpk-red-dark: #B3050F;
    --gpk-red-soft: rgba(227, 6, 19, 0.12);
    --gpk-navy: #1C2D5A;
    --gpk-navy-dark: #151F41;
    --gpk-navy-soft: rgba(28, 45, 90, 0.08);
    --gpk-ink: #1A1F2E;
    --gpk-muted: #6B7280;
    --gpk-muted-soft: #9AA1AE;
    --gpk-line: #E5E7EB;
    --gpk-blue: #242577;
    --gpk-surface: #FFFFFF;
    --gpk-surface-alt: #F3F4F6;
    --gpk-surface-band: #EDEEF0;
    --gpk-radius: 14px;
    --gpk-radius-sm: 8px;
    --gpk-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 6px rgba(16, 24, 40, 0.04);
    --gpk-shadow: 0 2px 4px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.08);
    --gpk-shadow-lg: 0 12px 40px rgba(16, 24, 40, 0.14);

    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 16px 120px;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--gpk-ink);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.gpk-builder *,
.gpk-builder *::before,
.gpk-builder *::after {
    box-sizing: border-box;
}

/* ==================================================================
   Progress bar — dot style
   ================================================================== */

.gpk-progress {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    list-style: none;
    margin: 0 0 48px;
    padding: 0;
}

.gpk-progress__step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    text-align: center;
    color: var(--gpk-muted);
    font-size: 14px;
    font-weight: 500;
}

.gpk-progress__step::before {
    content: "";
    position: absolute;
    top: 14px;
    left: calc(-50% + 10px);
    right: calc(50% + 10px);
    height: 2px;
    background: var(--gpk-line);
    z-index: 0;
}

.gpk-progress__step:first-child::before {
    display: none;
}

.gpk-progress__dot {
    position: relative;
    z-index: 1;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #F7C3C7;
    border: 2px solid #F7C3C7;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.gpk-progress__step.is-active .gpk-progress__dot {
    background: var(--gpk-red);
    border-color: var(--gpk-red);
    box-shadow: 0 0 0 4px var(--gpk-red-soft);
    transform: scale(1.05);
}

.gpk-progress__step.is-done .gpk-progress__dot {
    background: var(--gpk-red);
    border-color: var(--gpk-red);
}

.gpk-progress__step.is-done::before,
.gpk-progress__step.is-active::before {
    background: var(--gpk-red);
}

.gpk-progress__step.is-active {
    color: var(--gpk-ink);
    font-weight: 600;
}

.gpk-progress__label {
    display: block;
    line-height: 1.25;
    max-width: 160px;
}

/* ==================================================================
   Section shells
   ================================================================== */

.gpk-section {
    background: var(--gpk-surface);
    border-radius: var(--gpk-radius);
    padding: 32px;
    margin-bottom: 28px;
}

.gpk-section--split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 40px;
    align-items: center;
}

/* Gift card section: header row (logo + intro + filters), then full-width grid. */
.gpk-section--cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-left: 48px;
    padding-right: 48px;
}

.gpk-section__card-head {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 20px 48px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    /* Vertically centre the image against the text+filters block only. */
    align-items: center;
}

.gpk-section--cards .gpk-section__illustration--card {
    margin: 0;
    min-height: 0;
    align-self: center;
    justify-self: start;
    width: 100%;
}

.gpk-section--cards .gpk-section__illustration--card img {
    display: block;
    max-height: 440px;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0;
}

.gpk-section__card-head-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    width: 100%;
    align-self: center;
    text-align: left;
}

.gpk-section__card-intro {
    min-width: 0;
}

.gpk-section--cards .gpk-section__card-intro .gpk-section__title {
    margin: 0 0 4px;
}

.gpk-section--cards .gpk-section__card-intro .gpk-section__lead {
    margin: 0;
}

.gpk-section--cards .gpk-filters--card-head {
    margin: 0;
    justify-content: flex-start;
    width: 100%;
}

.gpk-section--cards > .gpk-card-picker[hidden] {
    display: none;
}

.gpk-section--cards > .gpk-card-picker .gpk-section__card-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    min-width: 0;
}

.gpk-section--cards .gpk-section__card-main .gpk-field {
    width: 100%;
    max-width: 100%;
}

#gpk-section-cards .gpk-card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 0;
}

.gpk-section--banded {
    background: var(--gpk-surface-band);
    padding: 40px 32px;
}

.gpk-section--banded .gpk-section__split {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 40px;
    align-items: center;
}

.gpk-section--compact {
    padding: 24px 32px;
}

.gpk-section__head {
    margin-bottom: 16px;
}

.gpk-section__head--centered {
    text-align: center;
    margin-bottom: 28px;
}

.gpk-section__title {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.gpk-section--compact .gpk-section__title {
    font-size: 22px;
}

.gpk-section__subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--gpk-muted);
    margin-left: 6px;
}

.gpk-section__desc {
    margin: 0;
    color: var(--gpk-muted);
    font-size: 14px;
}

.gpk-section__lead {
    margin: 0 0 20px;
    font-size: 15px;
    color: var(--gpk-ink);
    font-weight: 500;
}

/* ==================================================================
   Illustration column
   ================================================================== */

.gpk-section__illustration {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}

.gpk-section__illustration img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 320px;
    object-fit: contain;
    filter: drop-shadow(0 20px 32px rgba(16, 24, 40, 0.15));
}

.gpk-section__illustration--card img {
    max-height: 340px;
}

.gpk-section__illustration--box img {
    max-height: 300px;
}

.gpk-section__body {
    min-width: 0;
}

/* ==================================================================
   Row list (stepper + hint)
   ================================================================== */

.gpk-row-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gpk-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.gpk-row__hint {
    margin: 0;
    font-size: 14px;
    color: var(--gpk-muted);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.gpk-row__hint strong {
    color: var(--gpk-ink);
    font-weight: 600;
}

/* ==================================================================
   Qty stepper — borderless, minimal
   ================================================================== */

.gpk-qty {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: transparent;
    white-space: nowrap;
}

.gpk-qty__btn {
    width: 32px;
    height: 32px;
    border: 1.5px solid var(--gpk-line);
    background: var(--gpk-surface);
    border-radius: 999px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gpk-navy);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.gpk-qty__btn:hover:not(:disabled) {
    background: var(--gpk-navy);
    border-color: var(--gpk-navy);
    color: #fff;
}

.gpk-qty__btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gpk-qty__input {
    width: 72px;
    min-width: 72px;
    max-width: 72px;
    flex: 0 0 72px;
    border: 0;
    background: transparent;
    text-align: center;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--gpk-ink);
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Theme overrides (Blocksy, etc.) sometimes force quantity inputs to
 * `width: 100%`, which makes voucher steppers consume the whole row.
 * Lock this specific input back to a compact fixed width. */
.gpk-builder .gpk-qty .gpk-qty__input {
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    flex: 0 0 72px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    text-align: center !important;
}

.gpk-qty__input::-webkit-outer-spin-button,
.gpk-qty__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gpk-qty__input:focus {
    outline: none;
}

/* ==================================================================
   Per-section totals & prices
   ================================================================== */

.gpk-section__total {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--gpk-ink);
    font-weight: 500;
    text-align: left;
    align-self: flex-start;
}

.gpk-section__total strong {
    color: var(--gpk-navy);
    font-weight: 700;
    margin-left: 4px;
}

.gpk-section__price {
    margin: 0 0 20px;
    font-size: 16px;
    color: var(--gpk-ink);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.gpk-section__price-label {
    color: var(--gpk-muted);
    font-weight: 500;
}

.gpk-section__price strong {
    color: var(--gpk-navy);
    font-weight: 700;
    font-size: 18px;
}

.gpk-section__price-vat {
    font-size: 14px;
    color: var(--gpk-muted);
    font-weight: 500;
    margin-left: 4px;
}

/* ==================================================================
   Filters (gift-card category chips)
   ================================================================== */

.gpk-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.gpk-filter {
    padding: 7px 14px;
    border: 1.5px solid var(--gpk-line);
    border-radius: 999px;
    background: var(--gpk-surface);
    color: var(--gpk-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 120ms ease;
}

.gpk-filter:hover {
    border-color: var(--gpk-navy);
}

.gpk-filter.is-active {
    background: var(--gpk-navy);
    border-color: var(--gpk-navy);
    color: #fff;
}

/* ==================================================================
   Card slots + artwork grid
   ================================================================== */

.gpk-slots {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.gpk-slots__empty[hidden] {
    display: none;
}

.gpk-slots__empty .gpk-notice {
    margin: 0;
}

.gpk-slot {
    padding: 18px 20px;
    background: var(--gpk-surface-alt);
    border-radius: var(--gpk-radius);
    animation: gpk-slot-in 160ms ease-out;
}

@keyframes gpk-slot-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.gpk-slot__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.gpk-slot__badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--gpk-navy);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.gpk-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.gpk-card-tile {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 120ms ease, transform 120ms ease;
    background: var(--gpk-surface);
}

/*
 * Filter hides tiles via the native `hidden` attribute. Because
 * `.gpk-card-tile { display: block }` is author CSS it beats the UA
 * default `[hidden] { display: none }` — we must re-state it here
 * with equal or higher specificity so filtering actually works.
 */
.gpk-builder .gpk-card-tile[hidden] {
    display: none;
}

.gpk-card-tile:hover {
    transform: translateY(-2px);
}

.gpk-card-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.gpk-card-tile__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gpk-card-tile__check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--gpk-red);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

.gpk-card-tile__radio:checked ~ .gpk-card-tile__check,
.gpk-card-tile.is-selected .gpk-card-tile__check {
    display: inline-flex;
}

.gpk-card-tile:has(.gpk-card-tile__radio:checked),
.gpk-card-tile.is-selected {
    border-color: var(--gpk-red);
}

/* ==================================================================
   Card picker (single per package, v0.7+)
   ==================================================================
   Replaces the old per-voucher slot model. Lives inside
   `#gpk-section-cards` and is toggled show/hide by JS based on the
   voucher count. The empty-state notice is the inverse of the
   picker. Both elements use the `hidden` attribute and need an
   explicit `display` rule because the card-grid CSS above sets
   `display: block` on its children.
   ================================================================== */

.gpk-card-picker {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 6px;
}

.gpk-card-picker[hidden] {
    display: none;
}

.gpk-card-empty {
    margin-top: 6px;
}

.gpk-card-empty[hidden] {
    display: none;
}

.gpk-card-empty .gpk-notice {
    margin: 0;
}

.gpk-card-hint {
    margin: 0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gpk-red-dark);
    background: var(--gpk-red-soft);
    border-radius: var(--gpk-radius-sm);
}

.gpk-card-hint[hidden] {
    display: none;
}

.gpk-section--inactive .gpk-section__title,
.gpk-section--inactive .gpk-section__lead {
    opacity: 0.55;
}

/* ==================================================================
   Box choice tiles (three-radio picker, v0.7+)
   ==================================================================
   Three side-by-side tiles: "No box" (default), "Red box", "Black
   box". Single-select radio group — picking one auto-clears the
   others via native `<input type="radio">`. Styling mirrors
   `.gpk-card-tile` so the whole form feels consistent.
   ================================================================== */

.gpk-box-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.gpk-box-choice {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 96px;
    height: 100%;
    padding: 18px 16px;
    background: var(--gpk-surface);
    border: 2px solid var(--gpk-line);
    border-radius: var(--gpk-radius);
    text-align: center;
    cursor: pointer;
    transition: border-color 120ms ease, transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.gpk-box-choice:hover {
    border-color: var(--gpk-navy-soft, #CBD5E1);
    transform: translateY(-2px);
}

.gpk-box-choice__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    inset: 0;
    margin: 0;
}

.gpk-box-choice__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-box-choice__hint {
    font-size: 13px;
    font-weight: 600;
    color: var(--gpk-muted);
}

.gpk-box-choice__hint small {
    font-size: 11px;
    font-weight: 600;
    color: var(--gpk-muted);
}

.gpk-box-choice__hint .amount,
.gpk-box-choice__hint bdi {
    color: var(--gpk-ink);
}

.gpk-box-choice:has(.gpk-box-choice__radio:checked),
.gpk-box-choice.is-selected {
    border-color: var(--gpk-red);
    background: var(--gpk-red-soft);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.08);
}

.gpk-box-choice:has(.gpk-box-choice__radio:checked) .gpk-box-choice__hint,
.gpk-box-choice.is-selected .gpk-box-choice__hint {
    color: var(--gpk-red-dark);
}

.gpk-box-choice--none .gpk-box-choice__hint {
    font-style: italic;
}

@media (max-width: 640px) {
    .gpk-box-choices {
        grid-template-columns: 1fr;
    }
}

/* ==================================================================
   Fields
   ================================================================== */

.gpk-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.gpk-field--inline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    max-width: 520px;
}

.gpk-field--inline .gpk-field__input {
    flex: 1;
}

.gpk-field__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gpk-navy);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.gpk-field__required {
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gpk-red);
    padding: 2px 6px;
    background: var(--gpk-red-soft);
    border-radius: 4px;
}

.gpk-field__input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--gpk-line);
    border-radius: var(--gpk-radius-sm);
    background: var(--gpk-surface);
    font-family: inherit;
    font-size: 15px;
    color: var(--gpk-ink);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.gpk-field__input:focus {
    outline: none;
    border-color: var(--gpk-navy);
    box-shadow: 0 0 0 3px var(--gpk-navy-soft);
}

.gpk-field__input--textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.55;
}

.gpk-field__input:disabled {
    background: var(--gpk-surface-alt);
    color: var(--gpk-muted);
    cursor: not-allowed;
}

.gpk-field__counter {
    align-self: flex-end;
    font-size: 12px;
    color: var(--gpk-muted);
}

/* ==================================================================
   Notice
   ================================================================== */

.gpk-notice {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--gpk-radius-sm);
    background: var(--gpk-surface-alt);
    color: var(--gpk-muted);
    font-size: 14px;
}

.gpk-notice--error {
    background: var(--gpk-red-soft);
    color: var(--gpk-red-dark);
}

/* ==================================================================
   Sticky footer — package total + commit button
   ================================================================== */

.gpk-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: var(--gpk-surface);
    border: 1px solid var(--gpk-line);
    border-radius: var(--gpk-radius);
    box-shadow: var(--gpk-shadow);
    position: sticky;
    bottom: 16px;
    margin-top: 24px;
    z-index: 10;
}

.gpk-footer__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.gpk-footer__hint[hidden] {
    display: none;
}

.gpk-footer__hint {
    font-size: 12px;
    color: var(--gpk-red-dark);
    font-weight: 500;
    max-width: 280px;
    text-align: right;
    line-height: 1.35;
}

.gpk-total {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gpk-total__label {
    font-size: 12px;
    color: var(--gpk-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.gpk-total__amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--gpk-navy);
}

/* ==================================================================
   Buttons
   ================================================================== */

.gpk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.gpk-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gpk-btn:not(:disabled):active {
    transform: translateY(1px);
}

.gpk-btn--primary {
    background: var(--gpk-red);
    color: #fff;
    border-color: var(--gpk-red);
    font-weight: 600;
}

.gpk-btn--primary:hover:not(:disabled) {
    background: var(--gpk-blue);
    border-color: var(--gpk-blue);
    color: #fff;
}

.gpk-btn--ghost {
    background: transparent;
    color: var(--gpk-navy);
    border-color: var(--gpk-line);
}

.gpk-btn--ghost:hover:not(:disabled) {
    border-color: var(--gpk-navy);
}

/* ==================================================================
   Modal (post-add confirmation)
   ================================================================== */

.gpk-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.gpk-modal[hidden] {
    display: none;
}

.gpk-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
}

.gpk-modal__dialog {
    position: relative;
    max-width: 440px;
    width: 100%;
    background: var(--gpk-surface);
    border-radius: var(--gpk-radius);
    padding: 28px;
    box-shadow: var(--gpk-shadow-lg);
    text-align: center;
}

.gpk-modal__title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--gpk-navy);
}

.gpk-modal__body {
    margin: 0 0 20px;
    color: var(--gpk-muted);
}

.gpk-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 480px) {
    .gpk-modal__actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* ==================================================================
   Responsive
   ================================================================== */

@media (max-width: 1024px) {
    #gpk-section-cards .gpk-card-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .gpk-section--split,
    .gpk-section--banded .gpk-section__split {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .gpk-section--cards {
        padding-left: 24px;
        padding-right: 24px;
    }

    .gpk-section__card-head {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: none;
    }

    .gpk-section__card-head .gpk-section__illustration--card {
        order: -1;
    }

    .gpk-section--cards .gpk-section__illustration--card img {
        max-height: 280px;
    }

    .gpk-section__illustration {
        min-height: 200px;
        order: -1;
    }

    .gpk-section__illustration img {
        max-height: 240px;
    }

    .gpk-section__title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    #gpk-section-cards .gpk-card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .gpk-builder {
        padding: 16px 12px 140px;
    }

    .gpk-progress {
        margin-bottom: 32px;
    }

    .gpk-progress__label {
        font-size: 11px;
    }

    .gpk-section {
        padding: 24px 20px;
    }

    .gpk-section--banded {
        padding: 28px 20px;
    }

    .gpk-section--compact {
        padding: 20px;
    }

    .gpk-section__title {
        font-size: 22px;
    }

    .gpk-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .gpk-card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    #gpk-section-cards .gpk-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gpk-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 18px;
    }

    .gpk-footer__actions {
        align-items: stretch;
    }

    .gpk-footer__hint {
        max-width: none;
        text-align: left;
    }

    .gpk-btn--primary {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .gpk-progress__label {
        display: none;
    }

    .gpk-progress__step {
        padding-top: 0;
    }

    .gpk-progress__step::before {
        top: 8px;
    }

    .gpk-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #gpk-section-cards .gpk-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==================================================================
   Submit button loading state (Step 5 AJAX)
   ================================================================== */

.gpk-btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.gpk-btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #fff;
    animation: gpk-spin 600ms linear infinite;
}

@keyframes gpk-spin {
    to { transform: rotate(360deg); }
}

/* ==================================================================
   Cart / order styling hooks
   Minimal touches — the theme owns the cart layout. We only restyle
   our own thumbnails and append a subtle indent to card rows so a
   package reads as a group.
   ================================================================== */

.gpk-cart-thumb {
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.gpk-cart-item--card td.product-name,
.gpk-cart-item--card .product-name {
    padding-left: 32px !important;
    position: relative;
}

.gpk-cart-item--card td.product-name::before,
.gpk-cart-item--card .product-name::before {
    content: '↳';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9AA1AE;
    font-weight: 600;
}

.gpk-cart-card-label {
    font-weight: 600;
}

/*
 * Package divider — injected by cart.js above the first line item of
 * each distinct package on the cart and checkout tables. The row is a
 * full-width <tr> whose single <td> carries a colspan that matches
 * the host table so the band reaches edge-to-edge regardless of
 * column count (4 on cart, 2 on checkout review).
 */
/*
 * Modern WC cart themes (Blocksy / Elementor Pro / Hello Biz / the
 * WC Blocks cart) render the cart body as a CSS grid — `<tbody>` is
 * the grid container, `<tr>` often carries `display: contents`, and
 * the `<td>`s are the real grid items. In that layout `colspan` is
 * completely ignored, which makes our injected header cell render
 * at the width of the first grid column (~140px) instead of
 * spanning the full table.
 *
 * The one thing that works reliably across BOTH classic-table and
 * modern-grid cart themes: ask the td to span every grid column
 * via `grid-column: 1 / -1`. For classic tables this is ignored
 * (grid properties don't apply), and colspan still carries the
 * day. No need to force `display: table-row` on the <tr> — that
 * was too aggressive and caused Blocksy's thumbnail sizing rules
 * to stop applying to the following rows, making voucher / box
 * thumbnails blow up to their 300x300 source size.
 */
.gpk-pkg-header {
    grid-column: 1 / -1;
}

.gpk-pkg-header > .gpk-pkg-header__cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    grid-column: 1 / -1;
    background: #F3F4F6;
    color: #1C2D5A;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.01em;
    padding: 12px 16px !important;
    border-top: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
    text-align: left;
}

/*
 * Defensive thumbnail cap for voucher / box lines in a package.
 * Some WC cart themes (Blocksy in particular) lose their
 * `td.product-thumbnail img { max-width }` rule for rows that
 * carry our extra `.gpk-cart-item` classes — the source images
 * are 300x300 (WooCommerce default) so without a cap they render
 * at full size in the cart.
 *
 * Card lines already carry `.gpk-cart-thumb` on their <img>, which
 * has its own constraint further down, so this rule purposely
 * scopes to non-card lines. 64x64 matches the card thumb size for
 * consistent visual rhythm down the package.
 */
.gpk-cart-item:not(.gpk-cart-item--card) td.product-thumbnail img,
.gpk-cart-item:not(.gpk-cart-item--card) .product-thumbnail img {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    object-fit: cover !important;
    border-radius: 8px;
}

.gpk-pkg-header__label {
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Per-package subtotal chip — sits between the "Package N" label and
 * the Edit / Remove buttons. Visually a neutral pill so it pairs well
 * with the light grey header band without competing with the action
 * buttons. */
.gpk-pkg-header__total {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    margin-left: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--gpk-navy);
    background: #FFFFFF;
    border: 1.5px solid var(--gpk-line);
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1.2;
}

.gpk-pkg-header__total .amount,
.gpk-pkg-header__total bdi {
    color: inherit;
    font: inherit;
}

.gpk-pkg-header__actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
    margin-left: auto;
}

/*
 * Per-package Edit / Remove controls, rendered into the header band
 * by cart.js. Styled as light pill buttons so they sit comfortably
 * inside the grey header strip without competing visually with the
 * page's primary CTA (Proceed to checkout).
 */
.gpk-pkg-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px !important;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    cursor: pointer;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    color: #1C2D5A;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    line-height: 1.2;
    white-space: nowrap;
}

/* Keep all interactive controls visually consistent: 5-10px corners. */
.gpk-builder .gpk-btn,
.gpk-builder .gpk-pkg-btn,
.gpk-builder .gpk-qty__btn,
.gpk-builder .gpk-filter,
.gpk-builder .gpk-pkg-pick__toggle,
.gpk-builder .gpk-calc-trigger,
.gpk-builder .gpk-calc-option,
.gpk-builder .gpk-address-panel__remove,
.gpk-builder .gpk-multi-address__add,
#gpk-multi-address .gpk-address-panel__remove,
#gpk-multi-address .gpk-multi-address__add,
#gpk-multi-address .gpk-pkg-pick__toggle {
    border-radius: 8px !important;
}

.gpk-pkg-btn:hover:not(:disabled) {
    border-color: #1C2D5A;
    background: #1C2D5A;
    color: #FFFFFF;
}

.gpk-pkg-btn--remove {
    color: #B3050F;
    border-color: rgba(227, 6, 19, 0.25);
}

.gpk-pkg-btn--remove:hover:not(:disabled) {
    background: #B3050F;
    border-color: #B3050F;
    color: #FFFFFF;
}

.gpk-pkg-btn:disabled,
.gpk-pkg-btn.is-busy {
    opacity: 0.65;
    cursor: not-allowed;
}

.gpk-pkg-header + tr.gpk-cart-item > td {
    border-top: 0 !important;
}

/*
 * Read-only qty marker on package cart lines. Replaces the native
 * qty input (see GPK_Cart::filter_cart_item_quantity) so the
 * customer understands a package is atomic — they edit via the
 * Builder, not via per-row stepping.
 */
.gpk-cart-qty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #F3F4F6;
    color: #1C2D5A;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.01em;
    line-height: 1.2;
    min-width: 48px;
    text-align: center;
}

/*
 * "Free" token used on card line items in place of a €0.00 price.
 */
.gpk-cart-free {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    color: #1C2D5A;
    letter-spacing: 0.01em;
}

/*
 * Edit-mode banner injected by builder.js when the Builder loads
 * with a ?gpk_edit= param. Makes the mode switch unmistakable and
 * gives the customer a one-click escape hatch.
 */
.gpk-edit-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 24px;
    padding: 14px 18px;
    background: rgba(28, 45, 90, 0.06);
    border: 1px solid rgba(28, 45, 90, 0.12);
    border-radius: 12px;
    color: #1C2D5A;
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px !important;
}

.gpk-edit-banner__title {
    font-weight: 700;
    color: #1C2D5A;
}

.gpk-edit-banner__body {
    flex: 1;
    min-width: 160px;
    color: #3A4666;
    font-weight: 500;
}

.gpk-edit-banner__cancel {
    font-weight: 600;
    color: #B3050F;
    text-decoration: underline;
    cursor: pointer;
}

.gpk-edit-banner__cancel:hover {
    color: #7d030a;
}

@media (max-width: 640px) {
    .gpk-pkg-header > .gpk-pkg-header__cell,
    .gpk-pkg-header > td.gpk-pkg-header__cell {
        flex-direction: column;
        align-items: stretch;
    }
    .gpk-pkg-header__actions {
        justify-content: flex-end;
        margin-left: 0;
    }
    .gpk-pkg-header__label {
        white-space: normal;
    }
    .gpk-pkg-header__total {
        align-self: flex-start;
        margin-left: 0;
        margin-top: 4px;
    }
    .gpk-edit-banner {
        padding: 12px 14px;
    }
}

/* ======================================================================
 * Multi-address shipping (Step 7) — checkout-only UI that lets the
 * customer split a single checkout across any number of distinct
 * delivery addresses and assign cart packages to each.
 * ====================================================================== */

.gpk-multi-address {
    font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--gpk-ink);
    margin: 24px 0 28px;
    padding: 20px 22px;
    background: var(--gpk-surface);
    border: 1px solid var(--gpk-line);
    border-radius: var(--gpk-radius);
    box-shadow: var(--gpk-shadow-sm);
}

.gpk-multi-address__heading {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-multi-address__mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 0 0 16px;
    border: 0;
}

.gpk-multi-address__mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1.5px solid var(--gpk-line);
    border-radius: var(--gpk-radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 120ms ease, background 120ms ease;
}

.gpk-multi-address__mode-option:hover {
    border-color: var(--gpk-navy-soft);
}

.gpk-multi-address__mode-option input[type="radio"] {
    accent-color: var(--gpk-red);
    margin: 0;
}

.gpk-multi-address__mode-option:has(input[type="radio"]:checked) {
    border-color: var(--gpk-red);
    background: var(--gpk-red-soft);
}

.gpk-multi-address__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* HTML's `hidden` attribute normally implies `display: none`, but our own
 * `display: flex` above overrides that. Restore the hiding behaviour so the
 * mode-toggle actually collapses the whole multi-address section without
 * wiping the customer's addresses / package assignments. */
.gpk-multi-address__body[hidden] {
    display: none !important;
}

.gpk-multi-address__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gpk-multi-address__add {
    align-self: flex-start;
    padding: 10px 18px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--gpk-navy);
    background: var(--gpk-surface-alt);
    border: 1.5px dashed var(--gpk-navy-soft);
    border-radius: 999px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.gpk-multi-address__add:hover {
    background: var(--gpk-navy-soft);
    border-color: var(--gpk-navy);
    color: var(--gpk-navy-dark);
}

.gpk-multi-address__status {
    margin: 0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--gpk-radius-sm);
    background: var(--gpk-surface-alt);
    color: var(--gpk-muted);
}

.gpk-multi-address__status.is-ok {
    background: rgba(16, 185, 129, 0.10);
    color: #047857;
}

.gpk-multi-address__status.is-warn {
    background: var(--gpk-red-soft);
    color: var(--gpk-red-dark);
}

/* -- Address panel --------------------------------------------------- */

.gpk-address-panel {
    padding: 18px 18px 16px;
    background: var(--gpk-surface-alt);
    border: 1px solid var(--gpk-line);
    border-radius: var(--gpk-radius);
}

.gpk-address-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 14px;
}

.gpk-address-panel__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-address-panel__remove {
    padding: 4px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--gpk-red-dark);
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
    white-space: nowrap;
}

.gpk-address-panel__remove:hover {
    background: var(--gpk-red-soft);
    border-color: var(--gpk-red);
}

/* -- Address fields -------------------------------------------------- */

.gpk-address-panel__fields {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.gpk-af-row {
    display: grid;
    gap: 10px;
}

.gpk-af-row--2 { grid-template-columns: 1fr 1fr; }
.gpk-af-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.gpk-af {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
}

.gpk-af__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gpk-muted);
    letter-spacing: 0.01em;
}

/* ------------------------------------------------------------------
 * Multi-address field visibility
 *
 * Blocksy, Storefront, Astra and several other WooCommerce themes
 * ship heavy checkout resets that zero out input borders, background,
 * min-height and sometimes toggle visibility. The rules below use an
 * ID selector PLUS !important on every individual property so they
 * win against pretty much any theme reset, including `all: unset`.
 *
 * We also target both `input[type="..."]` and the bare `input` (via
 * descendant of `.gpk-af`) because some themes apply their resets
 * without a type qualifier.
 * ------------------------------------------------------------------ */

#gpk-multi-address .gpk-af > input,
#gpk-multi-address .gpk-af > select,
#gpk-multi-address .gpk-af input[type="text"],
#gpk-multi-address .gpk-af input[type="tel"],
#gpk-multi-address .gpk-af input[type="email"],
#gpk-multi-address .gpk-af input[type="number"],
#gpk-multi-address .gpk-af select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    font-family: inherit !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    font-weight: 400 !important;
    color: #1A1F2E !important;
    background-color: #FFFFFF !important;
    background-image: none !important;
    border: 1.5px solid #E5E7EB !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
    outline: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

#gpk-multi-address .gpk-af select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236B7280' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 10px 6px !important;
    padding-right: 36px !important;
    cursor: pointer;
}

#gpk-multi-address .gpk-af input::placeholder {
    color: #9CA3AF !important;
    opacity: 1 !important;
}

#gpk-multi-address .gpk-af input:hover,
#gpk-multi-address .gpk-af select:hover {
    border-color: #CBD5E1 !important;
}

#gpk-multi-address .gpk-af input:focus,
#gpk-multi-address .gpk-af select:focus {
    border-color: #E30613 !important;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12) !important;
}

/* Some Woo themes auto-reset `input` to `width: auto` inside grid
 * containers; force row children to stretch so our two-column /
 * three-column layouts don't collapse. */
#gpk-multi-address .gpk-af-row > .gpk-af {
    min-width: 0;
}

/* -- Package picks --------------------------------------------------- */

.gpk-address-panel__packages {
    padding-top: 12px;
    border-top: 1px dashed var(--gpk-line);
}

.gpk-address-panel__packages-heading {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-pkg-picks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gpk-pkg-pick {
    padding: 10px 12px;
    background: var(--gpk-surface);
    border: 1.5px solid var(--gpk-line);
    border-radius: var(--gpk-radius-sm);
    transition: border-color 120ms ease, background 120ms ease;
}

.gpk-pkg-pick.is-mine {
    border-color: var(--gpk-red);
    background: var(--gpk-red-soft);
}

.gpk-pkg-pick.is-assigned-elsewhere {
    opacity: 0.55;
    border-style: dashed;
    cursor: not-allowed;
}

.gpk-pkg-pick__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.gpk-pkg-pick__label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    cursor: pointer;
    min-width: 0;
}

.gpk-pkg-pick.is-assigned-elsewhere .gpk-pkg-pick__label {
    cursor: not-allowed;
}

.gpk-pkg-pick__checkbox {
    accent-color: var(--gpk-red);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.gpk-pkg-pick__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gpk-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1 1 auto;
}

.gpk-pkg-pick__total {
    font-size: 13px;
    font-weight: 600;
    color: var(--gpk-navy);
    white-space: nowrap;
}

.gpk-pkg-pick__toggle {
    padding: 4px 10px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--gpk-muted);
    background: transparent;
    border: 1.5px solid var(--gpk-line);
    border-radius: 999px;
    cursor: pointer;
    transition: border-color 120ms ease, color 120ms ease;
    white-space: nowrap;
}

.gpk-pkg-pick__toggle:hover {
    border-color: var(--gpk-navy);
    color: var(--gpk-navy);
}

.gpk-pkg-pick__details {
    list-style: disc;
    margin: 8px 0 0 0;
    padding-left: 22px;
    color: var(--gpk-muted);
    font-size: 13px;
    line-height: 1.5;
}

.gpk-pkg-pick__elsewhere {
    display: inline-block;
    margin-top: 4px;
    font-size: 11px;
    font-style: italic;
    color: var(--gpk-muted);
}

/* -- Order-received / admin / email recap --------------------------- */

.gpk-order-addresses {
    margin-top: 20px;
}

.gpk-order-addresses h3 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--gpk-navy);
}

.gpk-order-address {
    margin: 10px 0;
    padding: 12px 14px;
    border: 1px solid var(--gpk-line);
    border-radius: 10px;
    background: var(--gpk-surface-alt);
}

.gpk-order-address h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gpk-navy);
}

.gpk-order-address__who {
    font-weight: 600;
}

.gpk-order-address__lines,
.gpk-order-address__phone {
    color: var(--gpk-muted);
    font-size: 13px;
}

.gpk-order-address__packages {
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 13px;
    color: var(--gpk-ink);
}

/* -- Responsive ------------------------------------------------------ */

@media (max-width: 640px) {
    .gpk-multi-address {
        padding: 16px 14px;
    }
    .gpk-af-row--2,
    .gpk-af-row--3 {
        grid-template-columns: 1fr;
    }
    .gpk-pkg-pick__row {
        flex-direction: column;
        align-items: flex-start;
    }
    .gpk-pkg-pick__toggle {
        align-self: flex-end;
    }
}

/* ==================================================================
   Voucher calculator — CTA below the voucher total + modal popup
   ================================================================== */

.gpk-calc-trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    margin: 14px 0 0;
    padding: 12px 14px;
    font-family: inherit;
    text-align: left;
    background: linear-gradient(180deg, #FFF 0%, #FAFAFC 100%);
    border: 1.5px dashed var(--gpk-line);
    border-radius: var(--gpk-radius-sm);
    color: var(--gpk-ink);
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.gpk-calc-trigger:hover {
    border-style: solid;
    border-color: var(--gpk-red);
    background: var(--gpk-red-soft);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(227, 6, 19, 0.08);
}

.gpk-calc-trigger:focus-visible {
    outline: none;
    border-color: var(--gpk-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}

.gpk-calc-trigger__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: var(--gpk-red);
    border-radius: 50%;
    line-height: 1;
}

.gpk-calc-trigger__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}

.gpk-calc-trigger__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-calc-trigger__hint {
    font-size: 12.5px;
    color: var(--gpk-muted);
    line-height: 1.35;
}

.gpk-calc-trigger__chevron {
    flex-shrink: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--gpk-muted);
    transition: transform 140ms ease, color 140ms ease;
}

.gpk-calc-trigger:hover .gpk-calc-trigger__chevron {
    color: var(--gpk-red);
    transform: translateX(3px);
}

/* -- Calculator modal ------------------------------------------------ */

.gpk-modal__dialog--calc {
    max-width: 520px;
    padding: 30px 28px 26px;
    text-align: left;
}

.gpk-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    color: var(--gpk-muted);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.gpk-modal__close:hover {
    background: var(--gpk-surface-alt, #F6F7FA);
    color: var(--gpk-red);
}

.gpk-modal__close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}

.gpk-modal__lead {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--gpk-muted);
}

.gpk-calc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.gpk-calc-field__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-calc-field__hint {
    font-size: 12px;
    color: var(--gpk-muted);
}

.gpk-calc-input {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--gpk-line);
    border-radius: var(--gpk-radius-sm);
    transition: border-color 120ms ease, box-shadow 120ms ease;
    overflow: hidden;
}

.gpk-calc-input:focus-within {
    border-color: var(--gpk-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}

.gpk-calc-input__prefix {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 44px;
    padding: 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--gpk-navy);
    background: var(--gpk-surface-alt, #F6F7FA);
    border-right: 1.5px solid var(--gpk-line);
}

.gpk-calc-input__field {
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 14px !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--gpk-navy) !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.gpk-calc-input__field::-webkit-outer-spin-button,
.gpk-calc-input__field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.gpk-calc-input__field::placeholder {
    color: #A0A6B2;
    font-weight: 500;
}

.gpk-calc-results {
    margin-top: 6px;
}

.gpk-calc-results[hidden] {
    display: none;
}

.gpk-calc-results__heading {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
}

.gpk-calc-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 560px) {
    .gpk-calc-options {
        grid-template-columns: 1fr;
    }
}

/* Individual combo tile — same visual language as the box choices
 * (.gpk-box-choice) but tuned a bit smaller to fit inside the popup. */
.gpk-calc-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 84px;
    padding: 14px 12px;
    font-family: inherit;
    background: var(--gpk-surface);
    border: 2px solid var(--gpk-line);
    border-radius: var(--gpk-radius);
    text-align: center;
    cursor: pointer;
    transition: border-color 140ms ease, transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.gpk-calc-option:hover {
    border-color: var(--gpk-red);
    background: var(--gpk-red-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(227, 6, 19, 0.10);
}

.gpk-calc-option:focus-visible {
    outline: none;
    border-color: var(--gpk-red);
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.18);
}

.gpk-calc-option__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gpk-navy);
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.gpk-calc-option:hover .gpk-calc-option__title {
    color: var(--gpk-red-dark);
}

.gpk-calc-option__total {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gpk-muted);
}

.gpk-calc-option:hover .gpk-calc-option__total {
    color: var(--gpk-red-dark);
}

.gpk-calc-error {
    margin: 10px 0 0;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gpk-red-dark);
    background: var(--gpk-red-soft);
    border: 1px solid rgba(227, 6, 19, 0.25);
    border-radius: var(--gpk-radius-sm);
    line-height: 1.4;
}

.gpk-calc-error[hidden] {
    display: none;
}

/* -- Checkout billing: company + VAT on one row -------------------- */

.woocommerce-checkout #billing_company_field.form-row-first,
.woocommerce-checkout #billing_gpk_vat_number_field.form-row-last {
    width: 48%;
    float: left;
    clear: none;
}

.woocommerce-checkout #billing_gpk_vat_number_field.form-row-last {
    float: right;
}

.woocommerce-checkout #billing_address_1_field {
    clear: both;
}

@media (max-width: 768px) {
    .woocommerce-checkout #billing_company_field.form-row-first,
    .woocommerce-checkout #billing_gpk_vat_number_field.form-row-last {
        width: 100%;
        float: none;
        clear: both;
    }
}
