/* Gifting (GIFTING_ENABLED): checkout toggle, /gift/<token> reveal page and the printable card. V6 palette and type. */

/* ---- checkout: "It's a gift" */
.gift-block{margin:4px 0 14px;border:1px solid var(--line);border-radius:16px;background:#fff;transition:border-color .2s,box-shadow .2s}
.gift-block.is-on{border-color:#f0cfc6;box-shadow:0 8px 26px rgba(232,115,90,.08);background:linear-gradient(160deg,#FBF8F4,#fff 60%,#fff8fa)}
.gift-toggle{display:flex;align-items:center;gap:12px;padding:14px 16px;cursor:pointer;min-height:44px}
.gift-toggle input{position:absolute;opacity:0;width:1px;height:1px}
.gift-switch{flex:0 0 auto;width:42px;height:24px;border-radius:99px;background:#e8e0dc;position:relative;transition:background .2s}
.gift-switch::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.18);transition:transform .2s}
.gift-toggle input:checked+.gift-switch{background:var(--purple)}.gift-toggle input:checked+.gift-switch::after{transform:translateX(18px)}
.gift-toggle input:focus-visible+.gift-switch{outline:3px solid #E8735A;outline-offset:2px}
.gift-toggle-text strong{display:block;font-size:15px;letter-spacing:-.02em;color:var(--ink)}.gift-toggle-text small{display:block;font-size:12px;color:#5f5a72;margin-top:1px}
.gift-fields{padding:0 16px 14px}
.gift-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.gift-fields .form-field{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:800;color:#23232B;margin:0 0 10px}
.gift-fields input,.gift-fields textarea{width:100%;font:inherit;font-size:16px;font-weight:500;padding:11px 12px;border:1px solid #ead9d3;border-radius:12px;background:#fff;color:var(--ink)}
.gift-fields textarea{resize:vertical;min-height:76px;line-height:1.45}
.gift-fields input:focus,.gift-fields textarea:focus{outline:none;border-color:var(--purple);box-shadow:0 0 0 3px rgba(194,79,53,.16)}
.gift-fields [aria-invalid=true]{border-color:#d4536d}
.gift-opt{font-weight:600;color:#8f8aa3}
.gift-hint{font-size:12px;line-height:1.5;color:#6c6780;margin:-4px 0 10px}
.gift-count{font-size:11px;color:#8f8aa3;text-align:right;margin:-6px 0 8px}.gift-count.over{color:#c03a57;font-weight:800}
.gift-date-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}.gift-date-row .form-field{flex:1 1 170px}
.gift-chips{display:flex;gap:6px;margin-bottom:10px}
.gift-chip{font:inherit;font-size:12px;font-weight:800;padding:10px 12px;min-height:40px;border-radius:99px;border:1px solid #f0cfc6;background:#fff5f2;color:#C24F35;cursor:pointer}
.gift-chip:hover{background:#fde8e2}
.gift-error{font-size:13px;font-weight:700;color:#b3263f;background:#fff1f4;border-radius:10px;padding:9px 12px;margin:4px 0 0}
@media(max-width:600px){.gift-grid{grid-template-columns:1fr;gap:0}}

/* ---- reveal page */
.gift-page{min-height:100vh;background:radial-gradient(1200px 600px at 10% -10%,#fff1ec 0,transparent 60%),radial-gradient(900px 500px at 110% 10%,#ffe3ec 0,transparent 55%),var(--canvas)}
.gift-main{padding:28px 0 64px}
.gift-stage{display:none}
.gift-js .gift-stage{display:flex;justify-content:center;align-items:center;min-height:min(72vh,640px)}
.gift-js .gift-reveal{display:none}
.gift-js.gift-opened .gift-stage{display:none}.gift-js.gift-opened .gift-reveal{display:grid}
.gift-wrap{position:relative;display:flex;flex-direction:column;align-items:center;gap:14px;font:inherit;color:var(--ink);background:none;border:0;padding:24px 28px;border-radius:28px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.gift-wrap:focus-visible{outline:3px solid #E8735A;outline-offset:6px}
.gift-tag{margin-bottom:26px;font-size:13px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:#C24F35;background:#fff;border:1px solid #f0cfc6;border-radius:99px;padding:8px 16px;box-shadow:0 6px 18px rgba(232,115,90,.10)}
.gift-parcel{position:relative;display:block;width:min(240px,62vw);height:calc(min(240px,62vw)*.86)}
.gift-body{position:absolute;left:6%;right:6%;bottom:0;height:72%;border-radius:18px;background:linear-gradient(90deg,transparent 43%,#ffd2de 43%,#ffd2de 57%,transparent 57%),linear-gradient(135deg,#E8735A,#C24F35);box-shadow:0 24px 50px rgba(194,79,53,.22),inset 0 -10px 0 rgba(0,0,0,.06)}
.gift-lid{position:absolute;left:0;right:0;top:12%;height:22%;border-radius:14px;background:linear-gradient(90deg,transparent 42%,#ffc2d3 42%,#ffc2d3 58%,transparent 58%),linear-gradient(135deg,#E8735A,#C24F35);box-shadow:0 8px 16px rgba(194,79,53,.18);transform-origin:20% 100%;z-index:2}
.gift-bow{position:absolute;left:50%;top:-38%;width:0;height:0}
.gift-bow i{position:absolute;bottom:0;width:46px;height:34px;border:9px solid #ffb3c8;border-radius:50% 50% 50% 50%/60% 60% 40% 40%;background:transparent}
.gift-bow i:first-child{right:2px;transform:rotate(-24deg)}.gift-bow i:last-child{left:2px;transform:rotate(24deg)}
.gift-cta{font-size:clamp(26px,6vw,38px);font-weight:800;letter-spacing:-.045em}
.gift-sub{font-size:15px;color:#625d72}
.gift-sparkles{position:absolute;inset:0;pointer-events:none}
.gift-sparkles i{position:absolute;width:10px;height:10px;border-radius:50%;background:#ffd2de;opacity:.9}
.gift-sparkles i:nth-child(1){left:8%;top:22%;background:#ccf4e7}.gift-sparkles i:nth-child(2){right:10%;top:16%;width:8px;height:8px}
.gift-sparkles i:nth-child(3){left:4%;bottom:30%;width:7px;height:7px;background:#ffe2ca}.gift-sparkles i:nth-child(4){right:6%;bottom:36%;background:#F0CFC6}
.gift-sparkles i:nth-child(5){left:30%;top:4%;width:6px;height:6px;background:#F0CFC6}.gift-sparkles i:nth-child(6){right:28%;bottom:8%;width:7px;height:7px;background:#ccf4e7}
@media (prefers-reduced-motion:no-preference){
  .gift-js:not(.gift-opened) .gift-parcel{animation:giftBob 2.8s ease-in-out infinite}
  .gift-sparkles i{animation:giftTwinkle 2.4s ease-in-out infinite}.gift-sparkles i:nth-child(2n){animation-delay:.8s}.gift-sparkles i:nth-child(3n){animation-delay:1.5s}
  .gift-wrap:hover .gift-lid{transform:translateY(-4px) rotate(-2deg);transition:transform .25s}
  .gift-opening .gift-parcel{animation:none}
  .gift-opening .gift-lid{animation:giftLid .7s cubic-bezier(.2,.7,.3,1) forwards}
  .gift-opening .gift-body{animation:giftBody .9s ease forwards}
  .gift-opening .gift-cta,.gift-opening .gift-sub,.gift-opening .gift-tag{transition:opacity .4s;opacity:0}
  .gift-opening .gift-sparkles i{animation:giftBurst .9s ease-out forwards}
  .gift-opened .gift-reveal{animation:giftIn .8s cubic-bezier(.2,.7,.3,1) both}
  .gift-opened .gift-frame img{animation:giftImg 1.2s ease both}
}
@keyframes giftBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
@keyframes giftTwinkle{0%,100%{transform:scale(.6);opacity:.4}50%{transform:scale(1.2);opacity:1}}
@keyframes giftLid{to{transform:translate(-10%,-140%) rotate(-28deg);opacity:0}}
@keyframes giftBody{60%{transform:scale(1.04)}to{transform:scale(.9) translateY(14px);opacity:0}}
@keyframes giftBurst{to{transform:scale(2.4) translateY(-30px);opacity:0}}
@keyframes giftIn{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
@keyframes giftImg{from{opacity:0;transform:scale(1.03)}to{opacity:1;transform:none}}
.gift-reveal{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:44px;align-items:start;max-width:1040px;margin:0 auto}
.gift-frame img{opacity:1;transform:none}
.gift-copy h1{font-size:clamp(32px,4.4vw,52px);line-height:1.04;letter-spacing:-.05em;margin:8px 0 18px}
.gift-copy h1:focus{outline:none}
.gift-message{margin:0 0 22px;padding:18px 22px;border-left:4px solid #e889a8;border-radius:14px;background:#fff7fa}
.gift-message blockquote{margin:0 0 8px;font-size:18px;line-height:1.55;color:var(--ink);font-style:italic;overflow-wrap:anywhere}
.gift-message figcaption{font-size:14px;color:#8f8aa3;font-weight:700}.gift-message figcaption::before{content:"— "}
.gift-from-line{font-size:16px;color:#625d72;margin:0 0 20px}
.gift-primary{margin-bottom:14px}
.gift-files-box{display:block;background:#fff;border:1px solid var(--line);border-radius:16px;padding:14px 16px;margin-bottom:14px}
.gift-files-box .files-heading{font-size:15px;margin:0 0 6px}
.gift-fine{font-size:13px;color:#5f5a72}.gift-fine a,.keep-note a{color:#C24F35;font-weight:700}
.gift-gone{max-width:560px;padding:72px 0}
@media(max-width:820px){.gift-reveal{grid-template-columns:1fr;gap:22px}.gift-art{max-width:420px;width:100%;margin:0 auto}.gift-main{padding-top:16px}}

/* ---- printable card (/gift/<token>/card) */
.gift-card-page{background:#F4EFE8;margin:0;font-family:var(--font);color:var(--ink)}
.card-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;max-width:900px;margin:0 auto;padding:18px 20px}
.card-toolbar strong{display:block;font-size:16px}.card-toolbar span{font-size:13px;color:#625d72}
.card-actions{display:flex;gap:8px;flex-wrap:wrap}.card-actions .btn{padding:11px 16px;font-size:13px}.card-actions .is-on{border-color:var(--purple);color:var(--purple)}
.gift-card{box-sizing:border-box;width:148mm;height:210mm;margin:0 auto 40px;background:#fffdfb;border-radius:4mm;box-shadow:0 18px 50px rgba(35,35,43,.16);padding:12mm 12mm 10mm;display:flex;flex-direction:column;align-items:center;text-align:center;position:relative;overflow:hidden;
  background-image:radial-gradient(60mm 40mm at 0 0,#fff1ec,transparent 70%),radial-gradient(60mm 40mm at 100% 100%,#ffe9f0,transparent 70%);-webkit-print-color-adjust:exact;print-color-adjust:exact}
.size-a4 .gift-card{width:210mm;height:297mm;padding:18mm 18mm 14mm}
.gc-eyebrow{font-size:9pt;font-weight:800;letter-spacing:.2em;color:#C24F35}
.gc-top h1{font-size:24pt;line-height:1.05;letter-spacing:-.04em;margin:2mm 0 5mm}
.gc-art{flex:0 1 auto;height:84mm;aspect-ratio:2/3;border-radius:3mm;overflow:hidden;border:0.4mm solid #efe8e3;box-shadow:0 3mm 8mm rgba(35,35,43,.10);background:#F4EFE8}
.size-a4 .gc-art{height:120mm}
.gc-art img{width:100%;height:100%;object-fit:cover;display:block}
.gc-pet{font-size:13pt;font-weight:800;letter-spacing:-.02em;margin:3.5mm 0 0}
.gc-message{font-size:11pt;line-height:1.45;font-style:italic;max-width:110mm;margin:3mm auto 0;color:#23232B;overflow-wrap:anywhere}
.size-a4 .gc-message{font-size:13pt;max-width:150mm}
.gc-from{font-size:10pt;color:#5f5a72;margin:2.5mm 0 0;font-weight:700}
.gc-qr{margin-top:auto;display:flex;align-items:center;gap:5mm;text-align:left;border-top:0.3mm dashed #ead9d3;padding-top:4mm;width:100%}
.gc-qr .gift-qr{width:28mm;height:28mm;flex:0 0 auto}
.size-a4 .gc-qr .gift-qr{width:36mm;height:36mm}
.gc-qr strong{display:block;font-size:11pt}.gc-qr span{display:block;font-size:9pt;color:#625d72}.gc-qr small{display:block;font-size:6.5pt;color:#8f8aa3;word-break:break-all;margin-top:1.5mm;font-family:ui-monospace,Menlo,Consolas,monospace}
.gc-brand{position:absolute;right:10mm;top:9mm;font-size:10pt;font-weight:800;letter-spacing:-.03em;margin:0}.gc-brand span{color:#E8735A}
@media screen and (max-width:640px){.gift-card{transform-origin:top center;transform:scale(calc((100vw - 20px) / 148mm));margin-left:calc(50% - 74mm);margin-right:0;margin-bottom:calc(210mm * ((100vw - 20px) / 148mm) - 210mm + 30px)}
  .size-a4 .gift-card{transform:scale(calc((100vw - 20px) / 210mm));margin-left:calc(50% - 105mm);margin-right:0;margin-bottom:calc(297mm * ((100vw - 20px) / 210mm) - 297mm + 30px)}}
@media print{.no-print{display:none!important}html,body,.gift-card-page{background:#fff!important;margin:0}
  .gift-card{margin:0;box-shadow:none;border-radius:0;transform:none!important;page-break-after:avoid;break-inside:avoid}}

/* Below the files (recipient): room previews, printing tips, make your own. Shown once the gift is unwrapped. */
.gift-more{max-width:1040px;margin:0 auto}
.gift-js .gift-more{display:none}.gift-js.gift-opened .gift-more{display:block}
/* Phones: cap the portrait so the main download button is on the first screen. */
@media(max-width:520px){.gift-art{max-width:min(100%,calc(40vh * 2 / 3),calc(40svh * 2 / 3))}}
/* sender-name-1030: first + last name stay side by side on phones; optional "Let them reply to me" (shown once their email is filled in) */
@media(max-width:600px){.gift-grid.gift-names{grid-template-columns:1fr 1fr;gap:10px}}
.gift-reply{display:flex;gap:10px;align-items:flex-start;font-size:13.5px;line-height:1.45;margin:2px 0 12px;padding:10px 12px;border:1.5px solid #e4dff2;border-radius:12px;background:#fff;min-height:44px;box-sizing:border-box;cursor:pointer}
.gift-reply input{width:18px;height:18px;margin-top:1px;flex:none;accent-color:#C24F35}
.gift-reply[hidden]{display:none}

/* ios-16px-1030: iOS Safari zooms into any form field under 16px on focus. Mobile only (desktop unchanged); the viewport
 * meta never locks zoom. No field on the site is above 16px, so 16px == max(16px, current). */
@media (max-width:600px){:root body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]):not([type=file]):not([type=color]):not([type=image]),:root body select,:root body textarea{font-size:16px!important}}
/* Very narrow phones (320px): stack the name pair at 16px. */
@media(max-width:359px){.gift-grid.gift-names{grid-template-columns:1fr}}

/* ---- Item 6 (v3): "In memory of a pet" reveal. No parcel, bow or sparkles: a soft keepsake glow, "Tap to open", a gentle fade. */
.gift-memory.gift-page{background:radial-gradient(1100px 560px at 10% -10%,#fbf3ee 0,transparent 60%),radial-gradient(900px 500px at 110% 10%,#f3eef7 0,transparent 55%),var(--canvas)}
.gift-keepsake{position:relative;display:block;width:min(200px,54vw);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 50% 42%,#fff 0,#fdf4ee 46%,#f6e4da 100%);box-shadow:0 22px 50px rgba(194,79,53,.12),inset 0 0 0 1px rgba(194,79,53,.10)}
.gift-keepsake span{position:absolute;inset:16%;border-radius:50%;border:1.5px solid rgba(194,79,53,.28)}
.gift-keepsake span::after{content:"";position:absolute;left:50%;top:50%;width:26px;height:24px;transform:translate(-50%,-46%);background:no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21s-8.5-5.3-10.6-10.3C-.1 6.4 2.6 2 6.7 2c2.3 0 4 1.3 5.3 3.1C13.3 3.3 15 2 17.3 2c4.1 0 6.8 4.4 5.3 8.7C20.5 15.7 12 21 12 21z' fill='%23E8735A' fill-opacity='.55'/%3E%3C/svg%3E")}
.gift-memory .gift-tag{text-transform:none;letter-spacing:.01em;font-size:15px;font-weight:700}
.gift-memory .gift-cta{font-family:'Cormorant',Georgia,serif;font-weight:500;letter-spacing:-.02em;font-size:clamp(32px,7vw,44px)}
@media (prefers-reduced-motion:no-preference){
  .gift-js:not(.gift-opened) .gift-memory .gift-keepsake{animation:keepsakeGlow 4.2s ease-in-out infinite}
  .gift-opening .gift-memory .gift-keepsake{animation:none;transition:opacity .6s ease,transform .6s ease;opacity:0;transform:scale(1.03)}
  .gift-opened .gift-memory .gift-reveal{animation:keepsakeIn .9s ease both}
  .gift-opened .gift-memory .gift-frame img{animation:keepsakeIn 1.2s ease both}
}
@keyframes keepsakeGlow{0%,100%{box-shadow:0 22px 50px rgba(194,79,53,.10),inset 0 0 0 1px rgba(194,79,53,.10)}50%{box-shadow:0 22px 60px rgba(194,79,53,.20),inset 0 0 0 1px rgba(194,79,53,.16)}}
@keyframes keepsakeIn{from{opacity:0}to{opacity:1}}

/* Item 6 (v3): checkout gift form "A gift | In memory" switch and the "They'll see" line. */
.gift-fields .gift-mode{margin:4px 0 12px}
.gift-see{margin:2px 0 10px;padding:10px 12px;border:1px dashed #E7DED6;border-radius:10px;background:#FBF8F5;font:500 12.5px/1.45 "DM Sans",system-ui,sans-serif;color:#5c5852}
.gift-see strong{color:#23232B}
