.shop-main {
  --shop-ink: #23382f;
  --shop-muted: #52615a;
  --shop-paper: #fbfaf6;
  --shop-line: #d5d8cc;
  --shop-leaf: #4a5b44;
  box-sizing: border-box;
  max-width: 1300px;
  margin: 0 auto;
  padding: clamp(42px, 5.5vw, 86px) clamp(22px, 5.5vw, 86px) clamp(68px, 8vw, 120px);
  color: var(--shop-ink);
  font-family: "DM Sans", Arial, sans-serif;
}
.shop-main *, .shop-main *::before, .shop-main *::after { box-sizing: border-box; }
.shop-main #shop-status:empty, .shop-main [hidden] { display: none !important; }
.shop-main h1, .shop-main h2, .shop-form legend {
  color: var(--shop-ink);
  font: 400 2rem/1.12 Georgia, "Times New Roman", serif;
  letter-spacing: -.04em;
  margin: 0;
}
.shop-intro { margin: 0 0 clamp(30px, 3.6vw, 56px); }
.shop-intro .shop-kicker {
  margin: 0 0 14px;
  text-transform: uppercase;
  font-weight: 650;
  font-size: .69rem;
  line-height: 1.3;
  letter-spacing: .16em;
  color: var(--shop-leaf);
}
.shop-intro h1 { font-size: clamp(2.6rem, 5.4vw, 5.25rem); line-height: 1.01; }
.shop-intro h1 em { font-weight: 400; }
.shop-intro > p:last-child { margin: 16px 0 0; max-width: 52ch; font-size: 1.02rem; line-height: 1.55; color: var(--shop-muted); }
.builder-layout { display: grid; grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr); gap: clamp(32px, 6.4vw, 92px); align-items: start; }
.card-display { min-width: 0; position: sticky; top: 30px; margin: 0; }
.card-stage {
  --stage: #d6d9c9;
  --envelope: #c4c7b1;
  --card-stock: #f8f2e2;
  --card-ink: #364531;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  --stage-ratio: 1.17;
  grid-template-columns: 100%;
  background: linear-gradient(136deg, #ffffff35, transparent 62%), var(--stage);
}
.card-stage[data-design="couple"] { --stage: #e4d5c8; --envelope: #d7baa8; --card-stock: #fbf1e9; --card-ink: #614b3d; }
.card-stage[data-design="solo"] { --stage: #d8dbe0; --envelope: #bfc7cb; --card-stock: #f7f6ee; --card-ink: #31464a; }
/* The backdrop sets a minimum height. A longer dedication can grow the same grid row. */
.card-stage::before { content: ""; grid-area: 1 / 1; width: 100%; aspect-ratio: var(--stage-ratio); }
.paper-envelope {
  position: absolute;
  width: 78%;
  aspect-ratio: 1.6;
  transform: translate(-.5%, 5%) rotate(-10deg);
  background: linear-gradient(152deg, #ffffff39 41%, #ffffff05 41.4%), var(--envelope);
  box-shadow: 0 6px 12px #2e33251c;
}
.printed-card {
  position: relative;
  grid-area: 1 / 1;
  width: 84%;
  margin-block: clamp(14px, 3vw, 28px);
  aspect-ratio: 1.63;
  display: grid;
  grid-template-columns: 47% 53%;
  grid-template-rows: 1fr auto;
  background: var(--card-stock);
  color: var(--card-ink);
  border: 1px solid #ffffff5c;
  transform: rotate(-2deg);
  box-shadow: 0 15px 24px -12px #302e2d59, 0 2px 5px #453b2122;
  container-type: inline-size;
}
.printed-details { grid-area: 1 / 1; min-width: 0; padding: 11% 10% 0; display: flex; flex-direction: column; align-items: flex-start; }
.printed-brand { font: 400 clamp(19px, 5.6cqw, 34px)/.99 Georgia, serif; letter-spacing: -.04em; }
html:lang(de) .printed-brand { font-size: clamp(15px, 5.6cqw, 34px); }
.printed-rule { flex: 0 0 1px; width: 20%; margin-top: auto; background: currentColor; opacity: .45; }
.printed-details strong { font: 400 clamp(28px, 9.8cqw, 60px)/1.25 Georgia, serif; letter-spacing: -.06em; margin: 3% 0 1%; }
.printed-card img { grid-area: 1 / 2 / 3 / 3; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.printed-dedication { grid-area: 2 / 1; min-width: 0; padding: 0 10% 11%; overflow-wrap: anywhere; }
#card-recipient { display: block; font-size: clamp(11px, 2.6cqw, 16px); line-height: 1.25; }
.printed-card.personalized .printed-details { min-height: 45cqw; padding-bottom: 5%; }
.printed-card.personalized img { grid-row: 1 / 2; }
.card-stage[data-design="family"] .printed-card.personalized img { object-position: center 33%; }
.printed-card.personalized .printed-dedication { grid-column: 1 / -1; padding: 2.3% 4.7% 3%; border-top: 1px solid color-mix(in srgb, var(--card-ink) 18%, transparent); }
.printed-card.personalized #card-recipient { font-weight: 600; }
#preview-note { margin: .25em 0 0; font: italic clamp(14px, 3.4cqw, 20px)/1.32 Georgia, serif; white-space: pre-line; text-wrap: pretty; }
.preview-caption { display: flex; justify-content: space-between; gap: 12px; color: var(--shop-muted); margin-top: 13px; font-size: .79rem; }
.preview-caption span:first-child { font-weight: 650; color: var(--shop-ink); }
.shop-form, .builder-controls { min-width: 0; }
.shop-form fieldset { border: 0; min-width: 0; margin: 0 0 30px; padding: 0; }
.shop-form legend { padding: 0; margin-bottom: 15px; font-size: 1.6rem; }
.design-options, .amount-options { display: grid; gap: 9px; }
.design-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.design-option, .amount-options label { position: relative; display: block; cursor: pointer; }
.design-option input, .amount-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.design-option img { display: block; width: 100%; aspect-ratio: 1.65; height: auto; object-fit: cover; border: 2px solid transparent; padding: 2px; }
.design-option input:checked + img { border-color: var(--shop-ink); }
.design-option span { display: block; margin: 5px 0 0 3px; font-size: .85rem; }
.design-option input:checked ~ span { font-weight: 700; }
.design-option:hover img { border-color: #899783; }
.shop-main :is(a, button, input, textarea):focus-visible, .design-option input:focus-visible + img, .amount-options input:focus-visible + span {
  outline: 3px solid #716835; outline-offset: 3px;
}
.amount-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.amount-options span { display: grid; place-items: center; min-height: 44px; border: 1px solid #aab2a4; border-radius: 2px; font-size: .92rem; }
.amount-options input:checked + span { background: var(--shop-ink); border-color: var(--shop-ink); color: white; }
.amount-options label:hover span { border-color: var(--shop-ink); }
.shop-form .custom-amount { margin-top: 15px; }
.shop-form label[for] { display: block; margin-bottom: 7px; font-size: .88rem; font-weight: 600; }
.shop-form input:not([type=radio]), .shop-form textarea {
  display: block; width: 100%; border: 1px solid #aab2a4; border-radius: 2px; padding: 11px 13px;
  background: #ffffff62; color: var(--shop-ink); font: inherit; font-size: 1rem; line-height: 1.4;
}
.shop-form input::placeholder, .shop-form textarea::placeholder { color: #6c746d; opacity: 1; }
.shop-form textarea { resize: vertical; min-height: 65px; }
.shop-form input + label { margin-top: 16px; }
.field-optional, .field-help { font-weight: 400; color: var(--shop-muted); }
.field-help { margin: 6px 0 0; font-size: .8rem; line-height: 1.5; }
#message-help { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-variant-numeric: tabular-nums; }
#custom-value[aria-invalid="true"] { border-color: #904a35; }
#custom-value[aria-invalid="true"] + .field-help { color: #833f2c; }
.shop-button {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 26px; border: 1px solid var(--shop-ink); border-radius: 2px;
  min-height: 48px; padding: 12px 20px; background: var(--shop-ink); color: white; font: 600 .95rem/1.3 "DM Sans", Arial, sans-serif;
  cursor: pointer;
}
.shop-button span { font-size: 1.25rem; line-height: 1; }
.shop-button:hover:enabled { background: #394f42; }
.shop-button:disabled { background: #e1e4d9; color: #536354; border-color: #ccd1c2; cursor: default; }
.shop-main .shop-link {
  display: inline-block; padding: 5px 0; border: 0; background: none; color: var(--shop-ink); font: 600 .9rem/1.5 "DM Sans", Arial, sans-serif;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.shop-link:disabled { opacity: .55; cursor: default; }
.shop-main .preview-jump { display: none; }
.shop-notice { padding: 12px 15px; margin: 17px 0 6px; background: #edf0e5; border-left: 2px solid #758160; color: #37493c; font-size: .9rem; line-height: 1.55; }
.builder-alerts:has(.shop-notice:not([hidden])) { margin: 0 0 22px; }
.builder-alerts .shop-notice { margin-top: 0; }
.gift-review h2, .account-surface h2 { font-size: clamp(1.65rem, 2.6vw, 2.15rem); }
.review-rows { margin: 19px 0 25px; }
.review-rows > div { display: grid; grid-template-columns: minmax(74px, .52fr) minmax(0, 1fr); column-gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--shop-line); font-size: .92rem; }
.review-rows dt { color: var(--shop-muted); }
.review-rows dd { margin: 0; text-align: right; white-space: pre-wrap; overflow-wrap: anywhere; }
.review-rows .summary-amount { align-items: center; }
.summary-amount dd { font: 400 1.8rem/1 Georgia, serif; }
.review-actions { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.checkout-return { border-block: 1px solid var(--shop-line); padding: 28px 0; }
.checkout-return > p { max-width: 52ch; margin: 12px 0 22px; }
.prior-checkout { background: #eef0e6; padding: 13px 16px; font-size: .92rem; margin-bottom: 18px; }
.prior-checkout p { margin: 0 0 5px; }
.prior-checkout a { margin-right: 16px; }
.account-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); background: #f1f1e8; }
.account-surface { align-self: center; min-width: 0; padding: clamp(27px, 5.5vw, 72px); }
.account-surface section > p, #empty-orders p { margin: 12px 0 21px; font-size: .98rem; line-height: 1.6; color: var(--shop-muted); }
.account-surface .shop-form { max-width: 360px; }
.account-surface .shop-form .shop-button { margin-top: 18px; }
#new-link { display: block; margin-top: 12px; }
.account-photo { position: relative; min-height: 350px; }
.account-photo img { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.orders-heading { display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.order-list { margin: 18px 0 0; padding: 0; list-style: none; }
.order-list li { padding: 16px 0; border-top: 1px solid #c9cfc3; overflow-wrap: anywhere; }
.order-list h3 { font: 400 1.35rem/1.35 Georgia, serif; margin: 0 0 6px; }
.order-list dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 15px; margin: 0; font-size: .85rem; line-height: 1.4; }
.order-list dt { color: var(--shop-muted); }
.order-list dd { margin: 0; }
@media (max-width: 820px) {
  .builder-layout { gap: 28px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .shop-main { padding-inline: 26px; }
  .card-stage { --stage-ratio: 1; }
  .account-surface { padding: 28px; }
}
@media (max-width: 680px) {
  .shop-main { padding-inline: 20px; padding-top: 39px; }
  .builder-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .card-display { position: static; }
  .card-stage { --stage-ratio: 1.48; }
  .printed-card { width: 76%; }
  .paper-envelope { width: 72%; }
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-photo { width: 100%; min-width: 0; min-height: 135px; max-height: 230px; aspect-ratio: 2.4; }
  .account-surface { padding: 25px 20px; }
}

.gift-main .builder-shell { position: relative; }
.gift-main .printed-details .fractional-value { font-size: clamp(21px, 9.5cqw, 54px); }
.gift-main .gift-modes {
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--shop-line);
  border-radius: 5px;
  background: #f0f1e9;
}
html:lang(en-AE) #amount-choices { container-type: inline-size; }
@container (max-width: 375px) {
  html:lang(en-AE) #amount-choices .amount-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html:is(:lang(en-AE), :lang(de-CH)) #card-value { font-size: clamp(14px, 7.3cqw, 42px); }
html:is(:lang(en-AE), :lang(de-CH)) #card-value.fractional-value { font-size: clamp(13px, 6.1cqw, 35px); }
.gift-modes label span { min-height: 44px; border-color: transparent; font-weight: 600; }
.gift-main .gift-choice-panel { margin: 18px 0 0; }
.gift-choice-panel legend {
  margin-bottom: 9px;
  font: 600 .92rem/1.4 "DM Sans", Arial, sans-serif;
  letter-spacing: normal;
}
.package-options { display: grid; gap: 7px; }
.package-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid #aab2a4;
  border-radius: 2px;
  cursor: pointer;
}
.package-option:hover, .package-option:has(:checked) { border-color: var(--shop-ink); }
.package-option:has(:checked) { background: #eff1e8; box-shadow: inset 0 0 0 1px var(--shop-ink); }
.package-option:has(:focus-visible) { outline: 3px solid #716835; outline-offset: 2px; }
.package-option input { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--shop-ink); }
.package-copy, .package-price { display: grid; gap: 3px; }
.package-copy strong, .package-price strong { font: 400 1.18rem/1.2 Georgia, serif; }
.package-spec, .package-fit, .package-help, .gift-credit-note { font-size: .85rem; line-height: 1.45; }
.package-spec { font-weight: 600; }
.package-fit, .package-help { color: var(--shop-muted); }
.package-price { justify-items: end; }
.package-price small { font-size: .7rem; font-weight: 650; }
.package-help { margin: 12px 0 0; }
.gift-credit-note { margin: 12px 0 0; padding-left: 10px; border-left: 2px solid #89957d; }
.gift-credit-note:empty { display: none; }
.gift-main .builder-summary {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: clamp(16px, 2.5vw, 24px);
  border: 1px solid #c6cdbd;
  border-radius: 4px;
  background: #f2f3ea;
}
.gift-main .summary-selection { display: grid; gap: 2px; font-size: .92rem; }
.gift-main #summary-format { font-weight: 650; }
.gift-main #summary-design { color: var(--shop-muted); font-size: .82rem; }
.gift-main .summary-costs { display: grid; gap: 8px; margin: 0; }
.gift-main .summary-costs > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 12px; }
.gift-main .summary-costs dt { color: var(--shop-muted); font-size: .88rem; }
.gift-main .summary-costs dd { margin: 0; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gift-main .summary-total { border-top: 1px solid #bec8b6; margin-top: 4px; padding-top: 10px; }
.gift-main .summary-total dd { font: 400 clamp(1.4rem, 2.5vw, 1.8rem)/1.1 Georgia, serif; letter-spacing: -.045em; }
.gift-main .builder-summary .shop-button { justify-content: center; }
.gift-main .gift-box-option {
  display: grid;
  grid-template-columns: clamp(64px, 7vw, 98px) minmax(0, 1fr) auto;
  grid-template-areas: "photo description check";
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #aab2a4;
  border-radius: 3px;
  cursor: pointer;
}
.gift-main .gift-box-option:hover, .gift-main .gift-box-option:has(:checked) { border-color: var(--shop-ink); }
.gift-main .gift-box-option:has(:checked) { background: #eff1e8; }
.gift-main .gift-box-option:has(:focus-visible) { outline: 3px solid #716835; outline-offset: 3px; }
.gift-main .gift-box-option img {
  grid-area: photo;
  width: 100%; height: auto;
  aspect-ratio: 3/2; object-fit: cover; background: #ecebe0;
}
.gift-main .shop-form .gift-box-option input[type="checkbox"] {
  grid-area: check;
  align-self: start;
  width: 20px; height: 20px;
  padding: 0; margin: 2px 0 0;
  accent-color: var(--shop-ink);
}
.gift-main .gift-box-copy { grid-area: description; display: grid; gap: 4px; font-size: .86rem; line-height: 1.4; }
.gift-main #gift-box-title { font-size: 1.03rem; }
.gift-main #gift-box-price { font-weight: 650; }
.gift-main #review-box-preview { margin: 0 0 17px; }
.gift-main #checkout-button[hidden] + #edit-button {
  padding: 10px 17px; min-height: 44px; color: white; background: var(--shop-ink); border-radius: 2px; text-decoration: none;
}
.gift-main .message-suggestion {
  padding: 14px 16px 9px;
  margin-top: 15px;
  border-left: 2px solid #89957d;
  color: var(--shop-ink);
  background: #eff1e8;
}
.gift-main #suggestion-label { font-size: .8rem; font-weight: 600; }
.gift-main #suggestion-note { font: italic 1.08rem/1.4 Georgia, serif; margin-top: 3px; }
.gift-main .message-suggestion button { min-height: 44px; }
.gift-main .builder-shell :is(input, textarea, button, a) { scroll-margin-block: 12px; }
@media (max-width: 680px) {
  .gift-main .shop-intro { margin-bottom: 22px; }
  .gift-main .builder-layout { gap: 22px; }
  .gift-main .builder-controls,
  .gift-main .builder-controls > .shop-form { display: contents; }
  .gift-main .shop-form > fieldset,
  .gift-main .gift-review { order: 3; margin-bottom: 0; }
  .gift-main .shop-form > fieldset:first-child { order: 0; }
  .gift-main .card-display { order: 1; }
  .gift-main .preview-jump { display: inline-block; margin-top: 10px; }
  .gift-main .builder-controls > .builder-alerts { order: 2; margin: 0; }
  .gift-main .builder-controls > .builder-alerts:has(.shop-notice[hidden]):has(button[hidden]) { display: none; }
  .gift-main .builder-summary { order: 4; }
}
@media (max-width: 420px) {
  .gift-main .gift-box-option {
    grid-template-columns: 68px minmax(0, 1fr) auto;
    grid-template-areas: "photo title check" "description description description" "price price price";
    gap: 8px 12px;
  }
  .gift-main .gift-box-copy { display: contents; }
  .gift-main #gift-box-title { grid-area: title; }
  .gift-main #gift-box-description { grid-area: description; font-size: .88rem; line-height: 1.45; }
  .gift-main #gift-box-price { grid-area: price; font-size: .85rem; }
  .gift-main .gift-box-option input[type="checkbox"] { align-self: center; }
}
@media (max-height: 480px) {
  .gift-main .card-display { position: static; }
}
