.gift-card-purchase {
    max-width: 2000px;
    margin: 0 auto;
    padding: 20px 12px 34px;
}

.gift-card-purchase__card {
    background: #FFFFFF;
    border: 1px solid #c9c9c9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
    padding: 22px;
}

.gift-card-purchase__intro {
    max-width: 760px;
    line-height: 1.5;
}

.gift-card-purchase__balance-link {
    margin: 8px 0 18px;
    font-size: 0.96rem;
}

.gift-card-purchase__balance-link a {
    color: var(--wwd-colour-dark-blue, #213663);
    font-weight: 700;
}

.gift-card-purchase__form label,
.gift-card-purchase__designs legend {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: bold;
    color: var(--wwd-colour-dark-blue, #213663);
}

.gift-card-purchase__form input[type="number"],
.gift-card-purchase__form textarea {
    width: 100%;
    max-width: 520px;
    box-sizing: border-box;
}

.gift-card-purchase__counter,
.gift-card-purchase__optional {
    font-size: 0.9rem;
    font-weight: normal;
    color: #666666;
}

.gift-card-purchase__designs {
    border: 0;
    padding: 0;
    margin: 20px 0 0;
}

.gift-card-purchase__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.gift-card-purchase__design {
    border: 2px solid #d4d8df;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    background: #FFFFFF;
}

.gift-card-purchase__design--selected,
.gift-card-purchase__design:focus-within {
    border-color: var(--wwd-colour-dark-blue, #213663);
    box-shadow: 0 0 0 2px rgba(33, 54, 99, 0.16);
}

.gift-card-purchase__design input {
    margin-bottom: 8px;
}

.gift-card-purchase__design img {
    display: block;
    width: 100%;
    height: 135px;
    object-fit: cover;
    border-radius: 5px;
}

.gift-card-purchase__design span {
    display: block;
    margin-top: 6px;
    text-align: center;
}

.gift-card-purchase__actions {
    margin-top: 20px;
}

@media (max-width: 640px) {
    .gift-card-purchase__card {
        padding: 16px;
    }

    .gift-card-purchase__design img {
        height: 120px;
    }
}

/* =========================================================
   LIVE GIFT CARD PREVIEW
   =========================================================

   The preview is intentionally browser-only. The actual gift-card number,
   barcode, PDF, and email are generated during checkout after the order exists.
   Activity logging remains in GiftCardController and checkout/PDF generation.

   Desktop preview rule:
       The separated front/inside preview takes a lot of horizontal space, so it
       is hidden on narrower screens instead of stacking into a crowded mobile
       layout.

   Sizing rule:
       Each preview side uses the exact folded-card proportion requested by the
       user: 5.5" wide x 4.25" high. That is the same ratio as a 396 x 306 PDF
       quadrant from the printable Letter landscape template.
   ========================================================= */

.gift-card-purchase__top {
    display: grid;
    grid-template-columns: minmax(280px, 520px) minmax(640px, 1fr);
    gap: 34px;
    align-items: start;
}

.gift-card-purchase__controls {
    min-width: 0;
}

.gift-card-purchase__preview {
    justify-self: stretch;
    width: 100%;
    margin-top: 2px;
    padding: 12px 12px 6px;
    border: 0;
    background: #a9a9a9;
    box-sizing: border-box;
}

.gift-card-purchase__preview h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.gift-card-preview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    align-items: start;
}

.gift-card-preview__side {
    margin: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gift-card-preview__card-face {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 22 / 17;
    padding: 0;
    background: #ffffff;
    border: 1px solid #8d8d8d;
    box-sizing: border-box;
}

.gift-card-preview__svg-wrap {
    width: 100%;
    height: 100%;
}

.gift-card-preview__svg {
    display: block;
    width: 100%;
    height: 100%;
    background: #ffffff;
}

.gift-card-preview__side-label {
    margin: 10px 0 0;
    color: #000000;
    font-size: clamp(2rem, 3vw, 3.65rem);
    line-height: 1;
    text-align: center;
}

@media (max-width: 1240px) {
    .gift-card-purchase__top {
        grid-template-columns: minmax(280px, 500px) minmax(600px, 1fr);
        gap: 24px;
    }

    .gift-card-preview {
        gap: 18px;
    }
}

@media (max-width: 980px) {
    .gift-card-purchase__top {
        grid-template-columns: 1fr;
    }

    .gift-card-purchase__preview {
        display: none;
    }
}

@media (max-width: 640px) {
    .gift-card-purchase__card {
        padding: 16px;
    }

    .gift-card-purchase__design img {
        height: 120px;
    }
}

/* =========================================================
   E-Gift Card delivery fields

   Activity-log note:
       These styles are display-only. Gift-card delivery selection and
       recipient-email validation are logged from GiftCardController and
       CheckoutController after durable server-side events.
   ========================================================= */

.gift-card-purchase__delivery {
    margin: 18px 0;
    padding: 14px;
    border: 1px solid rgba(33, 54, 99, 0.24);
    background: rgba(225, 228, 230, 0.35);
}

.gift-card-purchase__delivery legend {
    padding: 0 6px;
    font-weight: bold;
    color: #213663;
}

.gift-card-purchase__delivery-choice {
    display: block;
    margin: 8px 0;
    line-height: 1.35;
}

.gift-card-purchase__recipient-fields {
    margin: 18px 0;
    padding: 14px;
    border-left: 4px solid #213663;
    background: #f7f8fb;
}

