/* ── Voucher pop-up ──────────────────────────────────────────
   No Figma. The picture on the left, the words and the form on
   beamwood on the right (the fields are the enquiry form's,
   components/enquiry-form). Tablet and mobile: one column, the
   picture on top, the whole thing scrolling.
   ─────────────────────────────────────────────────────────── */

html:has(.voucher-popup[open]) {
    overflow: hidden;
}

.voucher-popup {
    width: min(100% - 2 * var(--pad-x), 1180px);
    max-width: none;
    height: min(100% - 80px, 820px);
    max-height: none;
    margin: auto;
    padding: 0;
    border: 0;
    background: var(--color-beamwood);
    overflow: hidden;
}

.voucher-popup[open] {
    display: flex;
}

.voucher-popup::backdrop {
    background: rgba(20, 13, 12, 0.85);
}

/* The picture: the chosen voucher's, fading in over the last; the words
   and form take the rest */
.voucher-popup__media {
    position: relative;
    flex: 0 0 42%;
    background: var(--color-walnut);
}

.voucher-popup__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 400ms ease;
}

.voucher-popup__image.is-active {
    opacity: 1;
}

/* The words and the form, scrolling on their own */
.voucher-popup__panel.enquiry-form {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    padding: 56px 56px 48px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.voucher-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color-on-dark);
    cursor: pointer;
    transition: opacity var(--transition);
}

.voucher-popup__close:hover {
    opacity: 0.7;
}

.voucher-popup__close:focus-visible {
    outline: 2px solid var(--color-on-dark);
    outline-offset: 2px;
}

.voucher-popup__close svg {
    width: 32px;
    height: 32px;
}

.voucher-popup__eyebrow {
    margin: 0;
    color: var(--color-candle-wax);
}

/* The drop-down: the form's own, a little bigger */
.voucher-popup__choose {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.voucher-popup__label {
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: 4.48px;
    text-transform: uppercase;
    color: var(--color-on-dark-muted);
}

.voucher-popup__choose select {
    font-size: 22px;
}

.voucher-popup__details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voucher-popup__details[hidden] {
    display: none;
}

.voucher-popup__title {
    margin: 0;
    font-size: 40px;
    font-style: italic;
    line-height: 1;
    letter-spacing: -0.6px;
    color: var(--color-canvas);
}

.voucher-popup__text {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-candle-wax);
}

.voucher-popup__price {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 22px;
    font-style: italic;
    color: var(--color-ochre);
}

.voucher-popup__intro {
    grid-column: 1 / -1; /* in the form, after Quantity (voucher-popup.js) */
    margin: 8px 0 0;
    padding-top: 24px;
    border-top: 1px solid rgba(240, 239, 236, 0.2);
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-candle-wax);
}

.voucher-popup__form {
    width: 100%;
}

/* Quantity: − the number + */
.voucher-popup__stepper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.voucher-popup__stepper input {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.voucher-popup__stepper .button--stepper {
    flex: none;
}

.voucher-popup__stepper .button--stepper:focus-visible {
    box-shadow: 0 0 0 3px var(--color-canvas);
}

.voucher-popup .wpforms-field.voucher-amount[hidden] {
    display: none;
}


/* Tablet and mobile — 1024px and below: one column, the picture on top */
@media (max-width: 1024px) {
    .voucher-popup {
        width: min(100% - 2 * var(--pad-x), 720px);
        height: auto;
        max-height: calc(100% - 48px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .voucher-popup[open] {
        flex-direction: column;
    }

    .voucher-popup__media {
        flex: none;
        aspect-ratio: 16 / 9;
    }

    .voucher-popup__panel.enquiry-form {
        position: static;
        flex: none;
        padding: 32px var(--pad-x) 40px;
        overflow: visible;
    }

    /* Over the picture, on a dark disc so it shows on any photo */
    .voucher-popup__close {
        top: 12px;
        right: 12px;
        border-radius: 50%;
        background: rgba(20, 13, 12, 0.6);
    }

    .voucher-popup__title {
        font-size: 32px;
    }
}

/* Mobile: edge to edge, the full height */
@media (max-width: 767px) {
    .voucher-popup {
        width: 100%;
        height: 100%;
        max-height: none;
    }
}
