/* Gift certificate presentation within the studio's existing page shell. */
.gift-home-banner { margin-block: clamp(22px, 4vw, 46px); }
.gift-home-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px 36px;
  padding: clamp(24px, 4vw, 45px);
  border: 1px solid #dfd4e2;
  border-radius: 20px;
  background: linear-gradient(115deg, #f2e8f5 0%, #f8f4eb 68%, #eae3f0 100%);
  color: var(--plum-900);
}
body.reference-home .gift-home-panel h2 { margin: 0 0 8px; font-size: clamp(31px, 4vw, 48px); }
.gift-home-panel p { margin: 0; }
.gift-home-panel .btn { justify-self: start; }
.gift-service-button { background: var(--bg-card); color: var(--plum-900); }
.gift-service-button:hover { background: var(--lavender-100); }

.gift-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(20px, 5vw, 62px);
  padding-block: clamp(38px, 6vw, 82px) clamp(28px, 6vw, 68px);
}
body.reference-page-gifts .gift-staging {
  width: fit-content;
  margin: 0 0 14px;
  padding: 5px 10px;
  border: 1px solid #dfd4e2;
  border-radius: 6px;
  background: #f3e9f5;
  color: #543853;
  font-size: 13px;
}
body.reference-page-gifts .gift-hero h1 {
  margin: 0 0 14px;
  color: var(--plum-900);
  font-size: clamp(51px, 7vw, 100px);
  line-height: .94;
}
body.reference-page-gifts .gift-hero-intro { max-width: 32em; margin: 0 0 14px; font-size: clamp(16px, 1.8vw, 19px); }
body.reference-page-gifts .gift-hero-promise { max-width: 31em; margin: 0; color: #543853; }

.gift-art {
  display: grid;
  place-items: center;
  min-height: clamp(205px, 29vw, 370px);
  padding: clamp(15px, 3.5vw, 42px);
  border-radius: 20px;
  background:
    linear-gradient(143deg, transparent 32%, #fdfaffb8 46%, transparent 67%),
    radial-gradient(ellipse at 70% 15%, #f5edf1 0%, transparent 55%),
    linear-gradient(32deg, #bfb2cf 0%, #eee3f1 52%, #b8a9c8 100%);
  overflow: hidden;
}
.gift-paper {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: min(100%, 360px);
  min-height: clamp(150px, 20vw, 236px);
  padding: 24px 27px;
  isolation: isolate;
  background: linear-gradient(165deg, #fffdf2 0%, #f4eade 100%);
  box-shadow: 0 13px 26px #422b4d30;
  color: #5d3e58;
  text-align: center;
  transform: rotate(-5deg);
}
.gift-paper::before, .gift-paper::after { content: ''; position: absolute; pointer-events: none; }
.gift-paper::before { inset: 7px; border: 1px solid #846680; }
.gift-paper::after { inset: 10px; border: 1px solid #ae96a9; }
.gift-paper-brand { font: 500 clamp(13px, 1.6vw, 19px)/1.2 var(--f-display); letter-spacing: .13em; }
.gift-paper-title { margin-top: 9px; font: italic 400 clamp(28px, 4.5vw, 55px)/.9 var(--f-display); }
.gift-paper-branch { position: absolute; color: #836180; width: 40px; height: 25px; }
.gift-paper-branch-top { top: 15px; left: 15px; }
.gift-paper-branch-bottom { right: 15px; bottom: 15px; transform: rotate(180deg); }
.gift-paper-branch::before {
  content: ''; position: absolute; top: 8px; left: 9px; width: 32px; height: 17px;
  border-top: 1px solid; border-radius: 60% 0 0 0; transform: rotate(-19deg);
}
.gift-paper-branch i { position: absolute; width: 11px; height: 6px; border: 1px solid; border-radius: 80% 10%; }
.gift-paper-branch i:nth-child(1) { top: 5px; left: 17px; transform: rotate(51deg); }
.gift-paper-branch i:nth-child(2) { top: 8px; left: 27px; transform: rotate(-7deg); }
.gift-paper-branch i:nth-child(3) { top: 13px; left: 18px; transform: rotate(14deg); }
.gift-paper-branch i:nth-child(4) { top: 17px; left: 8px; transform: rotate(-38deg); }

.gift-catalog { padding-block: 0 36px; }
.gift-catalog h2, .gift-purchase h2 { margin: 0 0 18px; color: var(--plum-900); }
.gift-catalog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.gift-product {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(21px, 3.5vw, 34px);
  border: 1px solid #ded4df;
  border-radius: 16px;
  background: #fcfaf4;
}
.gift-product-selected { border-color: #846680; box-shadow: inset 0 0 0 1px #846680; }
body.reference-page-gifts .gift-product h3 { margin: 0 0 10px; color: var(--plum-900); font-size: clamp(29px, 3.5vw, 42px); }
body.reference-page-gifts .gift-price { margin: auto 0 16px; padding-top: 6px; font-size: 23px; font-weight: 600; }
.gift-notice { margin: 0 0 22px; padding: 12px 16px; border-radius: 8px; background: #f3e9f5; color: #543853; }

.gift-purchase { padding-bottom: 36px; scroll-margin-top: 90px; }
.gift-purchase-panel { padding: clamp(20px, 4vw, 39px); border: 1px solid #ded4df; border-radius: 16px; background: #fcfaf4; }
.gift-purchase-product { display: flex; flex-wrap: wrap; gap: 6px 16px; color: #543853; }
.gift-purchase .gift-people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; margin: 20px 0; }
.gift-purchase fieldset { min-width: 0; padding: 11px 15px 16px; border: 1px solid #cfc0d0; border-radius: 10px; }
.gift-purchase legend { padding-inline: 5px; color: #543853; font-weight: 600; }
.gift-delivery-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.gift-delivery-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #cfc0d0;
  border-radius: 9px;
  background: #fffdf8;
  cursor: pointer;
}
.gift-delivery-options label:has(input:checked) { border-color: #846680; background: #f3e9f5; }
.gift-delivery-options input { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: #715174; }
.gift-delivery p { margin: 10px 0 0; color: #543853; font-size: .88rem; }
.gift-purchase .gift-people label { display: block; margin: 0 0 3px; font-size: .88rem; }
.gift-email-fields { margin-top: 10px; }
.gift-email-fields small { display: block; margin-top: 4px; color: #543853; }
.gift-purchase .gift-people input {
  background: #fffdf8;
  border: 1px solid #a994aa;
  color: var(--text-primary);
  border-radius: 7px;
  width: 100%;
  min-height: 44px;
  padding: 7px 9px;
  font: inherit;
}
.gift-confirm-terms { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 17px; }
.gift-confirm-terms input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0; accent-color: #715174; }

.gift-terms { padding-bottom: clamp(48px, 8vw, 86px); }
.gift-terms details { padding-inline: clamp(16px, 3vw, 28px); border: 1px solid #ded4df; border-radius: 14px; background: #fcfaf4; }
.gift-terms summary { padding-block: 13px; cursor: pointer; color: var(--plum-900); }
body.reference-page-gifts .gift-terms summary h2 { display: inline; margin: 0; font-size: clamp(27px, 4vw, 36px); }
.gift-terms ul { display: grid; gap: 9px; margin: 0 0 20px; padding-left: 23px; }

@media (max-width: 900px) {
  .gift-hero { gap: 22px; }
}
@media (max-width: 680px) {
  .gift-hero, .gift-home-panel, .gift-purchase .gift-people, .gift-catalog-grid, .gift-delivery-options { grid-template-columns: 1fr; }
  .gift-hero { padding-block-start: 30px; }
  .gift-art { min-height: 207px; }
  .gift-paper { width: min(90%, 320px); }
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] .gift-home-panel {
    background: linear-gradient(115deg, #362838 0%, var(--surface) 66%, #302838 100%);
    border-color: var(--line);
    color: var(--ink);
  }

  :root[data-theme="system"] :is(.gift-home-panel h2, .gift-hero h1, .gift-catalog h2,
    .gift-product h3, .gift-price, .gift-purchase h2, .gift-terms summary) {
    color: var(--ink);
  }

  :root[data-theme="system"] :is(.gift-home-panel p, .gift-hero-promise, .gift-purchase-product,
    .gift-delivery p, .gift-email-fields small) {
    color: var(--muted);
  }

  :root[data-theme="system"] .gift-service-button {
    background: var(--surface);
    border-color: #98809d;
    color: var(--ink);
  }

  :root[data-theme="system"] .gift-service-button:hover {
    background: #403048;
    border-color: var(--bar);
  }

  :root[data-theme="system"] :is(.gift-staging, .gift-notice) {
    background: #403048;
    border-color: var(--line);
    color: var(--ink);
  }

  :root[data-theme="system"] .gift-art {
    background:
      linear-gradient(143deg, transparent 32%, #aa8db044 46%, transparent 67%),
      radial-gradient(ellipse at 70% 15%, #503c50 0%, transparent 55%),
      linear-gradient(32deg, #211c2b 0%, #372a3d 52%, #2c2839 100%);
  }

  /* Keep the illustrated paper true to the printable certificate. */
  :root[data-theme="system"] .gift-paper {
    box-shadow: 0 13px 26px #110c17a0;
  }

  :root[data-theme="system"] :is(.gift-product, .gift-purchase-panel, .gift-terms details) {
    background: var(--surface);
    border-color: var(--line);
    color: var(--ink);
    --focus-gap: var(--surface);
  }

  :root[data-theme="system"] .gift-product-selected {
    border-color: var(--bar);
    box-shadow: inset 0 0 0 1px var(--bar);
  }

  :root[data-theme="system"] .gift-purchase fieldset {
    border-color: var(--line);
  }

  :root[data-theme="system"] .gift-purchase legend {
    color: var(--ink);
  }

  :root[data-theme="system"] :is(.gift-delivery-options label, .gift-purchase .gift-people input) {
    background: var(--field-bg);
    border-color: #98809d;
    color: var(--field-ink);
  }

  :root[data-theme="system"] .gift-delivery-options label:has(input:checked) {
    background: #403048;
    border-color: var(--bar);
    color: var(--ink);
  }

  :root[data-theme="system"] :is(.gift-purchase input, .gift-purchase button) {
    color-scheme: dark;
  }

  :root[data-theme="system"] :is(.gift-delivery-options input, .gift-confirm-terms input) {
    accent-color: var(--bar);
  }
}
