.gift-page {
    color-scheme: dark;
    --ground: #151310;
    --card: #211d18;
    --cream: #f5ecde;
    --muted: #c3b8a8;
    --gold: #d6b981;
    --border: #50463a;
    font-family: 'Inter', sans-serif;
    line-height: 1.55;
    background: var(--ground);
    color: var(--cream);
    padding-top: clamp(7.5rem, 13vw, 9.5rem);
}

.gift-page * { box-sizing: border-box; }
.gift-page [hidden] { display: none !important; }
.gift-page a { color: inherit; }
.gift-page :focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.gift-page .gift-shell { width: min(calc(100% - 2.5rem), 72rem); margin-inline: auto; }

.gift-page .inline-link {
    color: var(--gold);
    font-size: .875rem;
    font-weight: 600;
    text-underline-offset: .24em;
}

.gift-page .gift-intro {
    position: relative;
    display: grid;
    align-items: end;
    min-height: clamp(26rem, 43vw, 36rem);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    isolation: isolate;
}

.gift-page .gift-photo, .gift-page .gift-intro::after {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.gift-page .gift-photo {
    object-fit: cover;
    object-position: center 59%;
    z-index: -2;
}

.gift-page .gift-intro::after {
    content: "";
    background: linear-gradient(90deg, #15110dea 0%, #15110dd1 39%, #15110d24 80%),
        linear-gradient(0deg, #15110dc4, transparent 57%);
    z-index: -1;
}

.gift-page .gift-intro-copy { padding: clamp(1.3rem, 5.5vw, 4rem); }
.gift-page .gift-kicker {
    color: var(--gold);
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .13em;
    font-weight: 700;
    margin: 0;
}

.gift-page h1, .gift-page h2 { font-family: 'EB Garamond', Georgia, serif; font-weight: 500; line-height: 1.01; }
.gift-page h1 {
    max-width: 10ch;
    margin: .52rem 0 0;
    font-size: clamp(3.25rem, 7.1vw, 6.3rem);
    letter-spacing: -.025em;
}
.gift-page h2 { margin: 0; font-size: clamp(2.2rem, 4vw, 3.4rem); }
.gift-page .gift-intro-copy > p:not(.gift-kicker) {
    color: #ede7dc;
    margin: .95rem 0 0;
    max-width: 44ch;
}
.gift-page .gift-intro .gift-actions { margin-top: 1.3rem; }

.gift-page .gift-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(0, .78fr);
    align-items: start;
    gap: clamp(1.45rem, 5vw, 4.4rem);
    margin-block: clamp(2rem, 5.6vw, 4rem);
}

.gift-page .gift-card {
    scroll-margin-top: 7rem;
    padding: clamp(1.1rem, 3.75vw, 2rem);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.gift-page .gift-deal {
    font-size: .9rem;
    color: var(--muted);
    border-left: 2px solid var(--gold);
    padding: .32rem 0 .32rem .68rem;
    margin: .82rem 0 1.35rem;
}

.gift-page .gift-deal strong { color: var(--gold); font-weight: 700; }
.gift-page .gift-fields label { display: block; font-size: .85rem; margin-bottom: .37rem; }
.gift-page .gift-fields select, .gift-page .gift-fields input {
    width: 100%;
    min-width: 0;
    min-height: 47px;
    padding: .65rem .55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--ground);
    color: var(--cream);
    font: inherit;
    font-size: 1rem;
}

.gift-page .gift-fields select:disabled { opacity: .64; }
.gift-page .gift-when { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .9rem; }
.gift-page .gift-when > div { min-width: 0; }
.gift-page .gift-status, .gift-page .gift-helper { font-size: .82rem; color: var(--muted); margin: .7rem 0; }
.gift-page .gift-status { min-height: 2.55em; }
.gift-page .gift-status.is-error { color: #efc4ad; }
.gift-page .gift-costs { margin: .9rem 0 .25rem; border-top: 1px solid var(--border); padding-top: .45rem; }
.gift-page .gift-costs > div { display: flex; justify-content: space-between; gap: .75rem; padding: .32rem 0; font-size: .91rem; }
.gift-page .gift-costs dd { margin: 0; white-space: nowrap; }
.gift-page .gift-total { border-top: 1px solid var(--border); margin-top: .45rem; padding-top: .65rem !important; font-weight: 700; color: var(--gold); }

.gift-page .gift-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; margin-top: 1rem; }
.gift-page .gift-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: .62rem 1rem;
    background: var(--gold);
    color: #21180d;
    text-decoration: none;
    border-radius: 6px;
    font-size: .86rem;
    font-weight: 700;
}
.gift-page .gift-button:hover { background: #ead2a1; }
.gift-page .preview-label { margin-bottom: 0; }

.gift-page .gift-guide { align-self: start; }
.gift-page .gift-guide ol {
    margin: 1.35rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: gift-step;
}
.gift-page .gift-guide li {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    align-items: start;
    gap: .8rem;
    padding: .86rem 0;
    border-bottom: 1px solid var(--border);
    counter-increment: gift-step;
}
.gift-page .gift-guide li:first-child { padding-top: 0; }
.gift-page .gift-guide li::before {
    content: counter(gift-step, decimal-leading-zero);
    font-size: .8rem;
    color: var(--gold);
    margin-top: .16rem;
    font-weight: 700;
}
.gift-page .gift-guide strong { font-size: 1rem; }
.gift-page .gift-guide p { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }

.gift-page .gift-occasion {
    display: grid;
    grid-template-columns: minmax(0, .66fr) minmax(0, 1.34fr);
    align-items: stretch;
    overflow: hidden;
    margin-bottom: clamp(2rem, 5.6vw, 4rem);
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #21241b;
}
.gift-page .gift-occasion > img { width: 100%; height: 100%; max-height: 21rem; object-fit: cover; object-position: center 57%; }
.gift-page .gift-occasion-copy { padding: clamp(1.4rem, 4.9vw, 3.35rem); }
.gift-page .gift-occasion-copy h2 { margin-top: .58rem; max-width: 17ch; }
.gift-page .gift-occasion-copy > p:not(.gift-kicker) { color: var(--muted); max-width: 48ch; margin: .85rem 0 .75rem; }
.gift-page .gift-occasion-link { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 780px) {
    .gift-page { padding-top: 7rem; }
    .gift-page .gift-shell { width: min(calc(100% - 2rem), 72rem); }
    .gift-page .gift-layout { grid-template-columns: 1fr; }
    .gift-page .gift-intro { min-height: 28rem; }
    .gift-page .gift-intro::after { background: linear-gradient(0deg, #15110d 2%, #15110de6 38%, #15110d55 80%); }
    .gift-page .gift-photo { object-position: 63% center; }
}

@media (max-width: 540px) {
    .gift-page .gift-intro { min-height: 26rem; }
    .gift-page .gift-intro .gift-actions { gap: .7rem; }
    .gift-page .gift-occasion { grid-template-columns: 1fr; }
    .gift-page .gift-occasion > img { height: 11rem; object-position: center 47%; }
}

@media (max-width: 380px) {
    .gift-page .gift-when { grid-template-columns: 1fr; }
}

.gift-page .gift-designs {
    padding-block: clamp(2rem, 5.5vw, 4rem);
    margin-block: .5rem clamp(1.75rem, 4vw, 3rem);
    border-top: 1px solid var(--border);
    scroll-margin-top: 7rem;
}

.gift-page .gift-designs-head p {
    margin: .7rem 0 1.25rem;
    color: var(--muted);
    max-width: 62ch;
}

.gift-page .gift-design-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(.75rem, 1.8vw, 1.3rem);
}

.gift-page .gift-design {
    display: grid;
    align-content: start;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
}

.gift-page .gift-design:hover,
.gift-page .gift-design:focus-within,
.gift-page .gift-design.is-selected { border-color: var(--gold); }

.gift-page .gift-design-photo {
    display: block;
    position: relative;
    border-radius: 7px 7px 0 0;
}

.gift-page .gift-design-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
}

.gift-page .gift-design-photo span {
    position: absolute;
    right: .65rem;
    bottom: .65rem;
    padding: .35rem .65rem;
    border-radius: 5px;
    background: #151310ed;
    color: var(--cream);
    font-size: .78rem;
    font-weight: 600;
}

.gift-page .gift-design-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding-inline: .85rem;
    font-size: .9rem;
}

.gift-page .gift-design-select {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
}

.gift-page .gift-preview-dialog {
    width: min(calc(100% - 1rem), 64rem);
    max-width: none;
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    padding: clamp(.7rem, 1.7vw, 1.2rem);
    margin: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    overscroll-behavior: contain;
    background: var(--ground);
    color: var(--cream);
    box-shadow: 0 1rem 4rem #0009;
}

.gift-page .gift-preview-dialog::backdrop { background: #0b0908df; }

.gift-page .gift-preview-header,
.gift-page .gift-preview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .55rem 1rem;
}

.gift-page .gift-preview-header { margin-bottom: .65rem; }
.gift-page .gift-preview-header h3 {
    margin: 0;
    font: 500 clamp(1.45rem, 3vw, 2rem)/1.05 'EB Garamond', Georgia, serif;
}
.gift-page .gift-preview-header form { margin: 0; }
.gift-page .gift-preview-actions { margin-top: .65rem; }

.gift-page .gift-preview-stage {
    overflow: auto;
    max-height: max(8rem, calc(100vh - 11rem));
    max-height: max(8rem, calc(100dvh - 11rem));
    overscroll-behavior: contain;
    border-radius: 4px;
    background: var(--card);
}

.gift-page .gift-preview-stage > img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: max(8rem, calc(100vh - 11rem));
    max-height: max(8rem, calc(100dvh - 11rem));
    margin-inline: auto;
}

.gift-page .gift-preview-stage.is-zoomed > img {
    width: max(130%, 47rem);
    max-width: none;
    max-height: none;
    margin: 0;
}

.gift-page .gift-preview-control {
    min-height: 44px;
    padding: .45rem .7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card);
    color: var(--cream);
    font: inherit;
    font-size: .84rem;
    cursor: pointer;
}

.gift-page .gift-preview-control:hover,
.gift-page .gift-preview-control[aria-pressed="true"] { border-color: var(--gold); }

@media (max-width: 600px) {
    .gift-page .gift-design-grid { grid-template-columns: 1fr; }
}

.gift-page .gift-trap {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.gift-page .gift-order-fields {
    padding: 1rem 0 0;
    margin: 1.5rem 0 0;
    min-width: 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.gift-page .gift-order-fields legend {
    padding: 0 .7rem 0 0;
    color: var(--cream);
    font-weight: 700;
}

.gift-page .gift-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .75rem;
    margin-bottom: .9rem;
}

.gift-page .gift-fields textarea {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 5.4rem;
    padding: .65rem .65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--ground);
    color: var(--cream);
    font: inherit;
    resize: vertical;
}

.gift-page .gift-fields textarea::placeholder { color: var(--muted); }

.gift-page .gift-fields .gift-consent {
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr);
    align-items: start;
    gap: .5rem;
    margin-top: 1rem;
    color: var(--muted);
}

.gift-page .gift-consent input {
    width: 1rem;
    height: 1rem;
    min-height: 0;
    margin: .15rem 0 0;
    padding: 0;
    accent-color: var(--gold);
}

.gift-page .gift-consent a {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: .18em;
}

.gift-page .gift-turnstile {
    min-width: 0;
    margin: 1rem 0 .3rem;
}

.gift-page button.gift-button {
    border: 0;
    cursor: pointer;
}

.gift-page button.gift-button:disabled { opacity: .6; cursor: wait; }
.gift-page .gift-helper.is-error { color: #efc4ad; }
.gift-page #gift-order-status:empty { display: none; }
.gift-page #gift-order-status {
    padding: .75rem .9rem;
    border-left: 2px solid var(--gold);
    background: #272118;
    font-size: .9rem;
}

@media (max-width: 540px) {
    .gift-page .gift-order-row { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
    .gift-page .gift-turnstile { margin-inline: -.75rem; }
}

.gift-page .gift-style-feedback { color: var(--gold); font-weight: 600; }
