/* ============================================================
   TYYC Gift Widgets — scoped component styles
   Ported from the prototype's styles.css + components.css.
   Everything is namespaced under .tyfd so design tokens never
   leak onto the theme's global header/footer.
   ============================================================ */

/* Design tokens — scoped to the widget wrapper (zero specificity via :where). */
:where(.tyfd) {
  --cream:        #FDF3EA;
  --cream-2:      #FBE8D6;
  --white:        #FFFFFF;
  --ink:          #20203A;
  --ink-soft:     #5C5C75;
  --ink-faint:    #9A9AAE;
  --line:         #ECE6DD;

  --yellow:       #F7C948;
  --yellow-deep:  #E7A82E;
  --yellow-soft:  #FDF0C8;

  --lav:          #8B86CC;
  --lav-deep:     #6E5BD6;
  --lav-soft:     #EEEBF9;

  --tan:          #E7C07E;
  --tan-soft:     #F8ECD3;

  --green:        #4C9A6B;

  --display: "Fredoka", system-ui, sans-serif;
  --body:    "Nunito", system-ui, sans-serif;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(32,32,58,.06);
  --shadow-md: 0 14px 40px -18px rgba(32,32,58,.22);
  --shadow-lg: 0 30px 70px -30px rgba(32,32,58,.34);
}

.tyfd, .tyfd * { box-sizing: border-box; }
.tyfd { font-family: var(--body); color: var(--ink); }
.tyfd h1, .tyfd h2, .tyfd h3, .tyfd h4 {
  font-family: var(--display); font-weight: 600; line-height: 1.04;
  letter-spacing: -0.01em; margin: 0; text-wrap: balance;
}
.tyfd p { margin: 0; line-height: 1.6; }
.tyfd a { color: inherit; text-decoration: none; }
.tyfd img { display: block; max-width: 100%; }
.tyfd button { font-family: var(--body); cursor: pointer; border: none; background: none; }

/* ---------- Kicker (used inside finder / bundle headers) ---------- */
.tyfd .kicker {
  font-family: var(--body); font-weight: 800; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--lav-deep);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.tyfd .kicker::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }

/* ---------- Buttons ---------- */
.tyfd .btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 500; font-size: 16px;
  padding: 15px 26px; border-radius: var(--r-pill);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.tyfd .btn:active { transform: translateY(1px) scale(.99); }
.tyfd .btn-primary { background: var(--yellow); color: var(--ink); box-shadow: 0 10px 24px -10px rgba(231,168,46,.7); }
.tyfd .btn-primary:hover { background: var(--yellow-deep); transform: translateY(-2px); }
.tyfd .btn-dark { background: var(--ink); color: #fff; }
.tyfd .btn-dark:hover { background: #2c2c4d; transform: translateY(-2px); }
.tyfd .btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.tyfd .btn-ghost:hover { background: var(--ink); color: #fff; }
.tyfd .btn-sm { padding: 11px 18px; font-size: 14px; }
.tyfd .btn[disabled] { opacity: .5; cursor: not-allowed; }
.tyfd .btn .arrow { transition: transform .2s ease; display: inline-flex; }
.tyfd .btn:hover .arrow { transform: translateX(4px); }

/* ---------- Pills ---------- */
.tyfd .pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: 800; font-size: 13px; padding: 7px 13px; border-radius: var(--r-pill);
  background: var(--lav-soft); color: var(--lav-deep);
}
.tyfd .pill.warm { background: var(--yellow-soft); color: var(--yellow-deep); }
.tyfd .pill.tan  { background: var(--tan-soft); color: #9a6f1f; }
.tyfd .pill.eco  { background: #E4F2EA; color: var(--green); }

/* ---------- Image placeholder (swap with real photos) ---------- */
.tyfd .ph {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(32,32,58,.045) 0 12px, rgba(32,32,58,0) 12px 24px),
    var(--ph-bg, var(--lav-soft));
  display: flex; align-items: flex-end; isolation: isolate;
}
.tyfd .ph::after {
  content: attr(data-label);
  font-family: "Nunito", monospace; font-weight: 800; font-size: 11px;
  letter-spacing: .06em; text-transform: uppercase; color: rgba(32,32,58,.45);
  margin: 10px; padding: 5px 9px; border-radius: 7px;
  background: rgba(255,255,255,.7); backdrop-filter: blur(3px);
}
.tyfd .ph.tan  { --ph-bg: var(--tan-soft); }
.tyfd .ph.warm { --ph-bg: var(--yellow-soft); }
.tyfd .ph.cream{ --ph-bg: var(--cream-2); }
.tyfd .ph img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }

/* ---------- Hero countdown row ---------- */
/* The countdown root carries BOTH classes (class="tyfd countdown"), so it needs a
   compound selector — a descendant selector (.tyfd .countdown) would never match it. */
.tyfd.countdown, .tyfd .countdown { display:inline-flex; gap:10px; align-items:center; flex-wrap: wrap; }
.tyfd .cd-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 7px 11px; text-align:center; box-shadow: var(--shadow-sm); min-width: 52px; }
.tyfd .cd-box b { font-family: var(--display); font-size: 22px; display:block; line-height:1; }
.tyfd .cd-box span { font-size: 10px; font-weight:800; letter-spacing:.1em; color: var(--ink-faint); text-transform: uppercase; }

/* ---------- Hero collage ---------- */
.tyfd.hero-collage { position: relative; }
.tyfd.hero-collage .stack { display: grid; grid-template-columns: 1.2fr .8fr; grid-template-rows: 1.3fr 1fr; gap: 16px; height: clamp(380px, 44vw, 540px); }
.tyfd.hero-collage .ph.a { grid-row: 1 / 3; }
.tyfd.hero-collage .float {
  position: absolute; bottom: -18px; left: -18px;
  background: #fff; border-radius: var(--r-md); padding: 14px 16px;
  box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 12px;
}
.tyfd.hero-collage .float .av { width: 38px; height: 38px; border-radius: 50%; background: var(--lav); flex:none; }
.tyfd.hero-collage .float b { font-family: var(--display); font-weight: 600; font-size: 15px; display:block; }
.tyfd.hero-collage .float span { font-size: 12px; color: var(--ink-soft); }
.tyfd.hero-collage .badge-deal { position:absolute; top:-14px; right:-6px; background: var(--lav-deep); color:#fff; font-family: var(--display); font-weight:600; font-size:15px; padding:12px 16px; border-radius: 16px; transform: rotate(6deg); box-shadow: var(--shadow-md); }
@media (max-width: 860px){ .tyfd.hero-collage .float { left: 8px; } }

/* ---------- Gift Finder quiz ---------- */
.tyfd.finder-wrap { /* outer wrapper used by the widget root */ }
.tyfd .finder { background: radial-gradient(120% 120% at 0% 0%, var(--lav-soft) 0%, var(--cream) 60%); border-radius: var(--r-lg); overflow:hidden; }
.tyfd .finder .inner { display:grid; grid-template-columns: 1fr 1fr; min-height: 460px; }
.tyfd .finder .side { padding: clamp(28px,4vw,52px); display:flex; flex-direction:column; justify-content:center; }
.tyfd .finder .side.media-side { padding: 0; }
.tyfd .finder .side .ph { width:100%; height:100%; border-radius:0; flex:1; }
.tyfd .finder .panel { background:#fff; }
.tyfd .finder .qtitle { font-family: var(--display); font-weight:600; font-size: clamp(22px,2.4vw,30px); margin-bottom: 6px; }
.tyfd .finder .progress { height:6px; background: var(--line); border-radius:6px; overflow:hidden; margin: 18px 0 24px; }
.tyfd .finder .progress i { display:block; height:100%; background: var(--lav-deep); border-radius:6px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.tyfd .finder .opts { display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tyfd .finder .opt {
  text-align:left; padding: 16px 18px; border-radius: var(--r-md);
  background: var(--cream); border: 1.5px solid transparent; transition:.2s;
  display:flex; align-items:center; gap:12px; font-weight:700; color: var(--ink); font-size:15px; width:100%;
}
.tyfd .finder .opt:hover { border-color: var(--lav); background:#fff; box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.tyfd .finder .opt .emoji { font-size: 24px; }
.tyfd .finder .opt.sel { border-color: var(--lav-deep); background: var(--lav-soft); }
.tyfd .finder .qnav { display:flex; justify-content:space-between; align-items:center; margin-top: 26px; }
.tyfd .finder .back { font-weight:800; color: var(--ink-soft); font-size:14px; }
.tyfd .finder .back:hover { color: var(--ink); }
.tyfd .finder .muted { font-size:13px; color: var(--ink-faint); font-weight:700; }
.tyfd .finder .result .rgrid { display:grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.tyfd .finder .result .mini { display:flex; gap:12px; align-items:center; background: var(--cream); border-radius: var(--r-md); padding:12px; }
.tyfd .finder .result .mini .ph { width:64px; height:64px; flex:none; border-radius:12px; }
.tyfd .finder .result .mini b { font-family:var(--display); font-weight:500; font-size:15px; display:block; }
.tyfd .finder .result .mini .p { font-weight:800; font-size:14px; color: var(--lav-deep); }
.tyfd .finder [hidden] { display:none !important; }
@media (max-width: 820px){
  .tyfd .finder .inner { grid-template-columns: 1fr; }
  .tyfd .finder .side.media-side { min-height: 220px; }
  .tyfd .finder .opts { grid-template-columns:1fr; }
  .tyfd .finder .result .rgrid { grid-template-columns: 1fr; }
}

/* ---------- Bundle builder ---------- */
.tyfd .bundle { background: var(--ink); color:#fff; border-radius: var(--r-lg); overflow:hidden; }
.tyfd .bundle .head { padding: clamp(28px,4vw,46px) clamp(28px,4vw,46px) 0; }
.tyfd .bundle .head h2 { color:#fff; font-size: clamp(28px,3.4vw,42px); }
.tyfd .bundle .head .lede { color: rgba(255,255,255,.66); margin-top:12px; max-width: 56ch; }
.tyfd .bundle .steps { display:grid; grid-template-columns: repeat(3,1fr); gap: 18px; padding: 26px clamp(28px,4vw,46px); }
.tyfd .bstep h4 { font-family: var(--display); font-weight:500; font-size:17px; margin-bottom:4px; display:flex; align-items:center; gap:9px; color:#fff; }
.tyfd .bstep h4 .n { width:24px;height:24px;border-radius:50%; background: var(--yellow); color: var(--ink); display:grid;place-items:center; font-size:13px; font-weight:800; }
.tyfd .bstep .pick-row { display:flex; gap:10px; margin-top:14px; overflow-x:auto; padding-bottom:6px; }
.tyfd .bpick {
  flex:none; width: 96px; border-radius: 14px; overflow:hidden; background: rgba(255,255,255,.06);
  border: 2px solid transparent; transition:.18s; text-align:center; padding-bottom:8px; color:#fff;
}
.tyfd .bpick:hover { border-color: rgba(255,255,255,.4); }
.tyfd .bpick.sel { border-color: var(--yellow); background: rgba(247,201,72,.12); }
.tyfd .bpick .ph { height: 88px; border-radius:0; }
.tyfd .bpick .bn { font-size:11.5px; font-weight:800; padding: 7px 6px 0; line-height:1.2; }
.tyfd .bpick .bp { font-size:11px; color: rgba(255,255,255,.6); font-weight:700; }
.tyfd .bundle .summary { background: rgba(255,255,255,.05); border-top:1px solid rgba(255,255,255,.1); padding: 22px clamp(28px,4vw,46px); display:flex; align-items:center; gap:20px; flex-wrap:wrap; }
.tyfd .bundle .summary .tot { font-family:var(--display); font-weight:600; font-size: 30px; white-space:nowrap; }
.tyfd .bundle .summary .tot small { font-size:14px; color: rgba(255,255,255,.6); font-weight:700; font-family: var(--body); }
.tyfd .bundle .summary .save-tag { background: var(--green); color:#fff; font-weight:800; font-size:13px; padding:6px 12px; border-radius: var(--r-pill); }
.tyfd .bundle .summary .save-tag[hidden] { display:none; }
.tyfd .bundle .summary .grow { flex:1; }
@media (max-width: 820px){ .tyfd .bundle .steps { grid-template-columns: 1fr; } }

/* ---------- Curated combos (also reusable) ---------- */
.tyfd .combos { display:grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.tyfd .combo { background:#fff; border:1px solid var(--line); border-radius: var(--r-md); overflow:hidden; transition:.25s; }
.tyfd .combo:hover { box-shadow: var(--shadow-md); transform: translateY(-5px); }
.tyfd .combo .ph { height: 200px; border-radius:0; }
.tyfd .combo .b { padding: 18px; }
.tyfd .combo .b h4 { font-family:var(--display); font-weight:600; font-size: 19px; }
.tyfd .combo .b p { font-size:13.5px; color: var(--ink-soft); margin-top:6px; }
@media (max-width: 820px){ .tyfd .combos { grid-template-columns: 1fr; } }

/* ---------- Personalisation callout ---------- */
.tyfd .perso { background: var(--lav-soft); border-radius: var(--r-lg); overflow:hidden; }
.tyfd .perso .g { display:grid; grid-template-columns: 1fr 1fr; align-items:center; gap: clamp(24px,4vw,56px); }
.tyfd .perso .copy { padding: clamp(30px,4vw,56px); }
.tyfd .perso h2 { font-size: clamp(28px,3.4vw,44px); }
.tyfd .perso p { margin-top:14px; color: var(--ink-soft); max-width: 44ch; }
.tyfd .perso .demo { padding: clamp(24px,3vw,44px); }
.tyfd .perso .preview { background:#fff; border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 22px; position:relative; }
.tyfd .perso .preview .ph { height: 230px; }
.tyfd .perso .namefield { display:flex; gap:10px; margin-top:16px; }
.tyfd .perso .namefield input { flex:1; font-family: var(--body); font-weight:700; font-size:15px; padding: 13px 16px; border-radius: var(--r-pill); border:1.5px solid var(--line); outline:none; }
.tyfd .perso .namefield input:focus { border-color: var(--lav-deep); }
.tyfd .perso .mock-name { position:absolute; left:50%; top:calc(50% - 30px); transform: translate(-50%,-50%); font-family: var(--display); font-weight:600; font-size: clamp(22px,3vw,34px); color: var(--ink); z-index:3; pointer-events:none; }
.tyfd .perso .preview .meta-row { display:flex; align-items:center; justify-content:space-between; margin-top:16px; }
.tyfd .perso .preview .meta-row .mname { font-family:var(--display); font-weight:600; font-size:18px; }
@media (max-width: 820px){ .tyfd .perso .g { grid-template-columns: 1fr; } }

/* ---------- Sticky add-to-cart bar ---------- */
.tyfd-stickybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: rgba(32,32,58,.97); backdrop-filter: blur(10px);
  color: #fff; transform: translateY(120%); transition: transform .35s cubic-bezier(.2,.7,.2,1);
  font-family: var(--body);
}
.tyfd-stickybar.show { transform: none; }
.tyfd-stickybar .in { max-width: 1200px; margin: 0 auto; padding: 12px clamp(18px,4vw,56px); display: flex; align-items: center; gap: 18px; }
.tyfd-stickybar .thumb { width: 46px; height: 46px; border-radius: 12px; background: var(--yellow); flex: none; display:grid; place-items:center; font-size:22px; }
.tyfd-stickybar .txt { line-height: 1.2; }
.tyfd-stickybar .txt b { font-family: var(--display); font-weight: 600; font-size: 16px; }
.tyfd-stickybar .txt span { display:block; font-size: 12.5px; color: rgba(255,255,255,.65); }
.tyfd-stickybar .grow { flex: 1; }
.tyfd-stickybar .count { font-size: 13px; color: rgba(255,255,255,.7); }
@media (max-width: 640px){ .tyfd-stickybar .txt span, .tyfd-stickybar .count { display:none; } }

/* ============================================================
   Native Elementor helpers — applied to CORE widgets (heading/text)
   via _css_classes, so they are NOT under the .tyfd namespace.
   ============================================================ */

/* Kicker: leading dash + inline layout, matching the design's section eyebrow. */
.tyfd-kicker .elementor-heading-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: "Nunito", system-ui, sans-serif;
}
.tyfd-kicker .elementor-heading-title::before {
  content: ""; width: 22px; height: 2px; border-radius: 2px;
  background: currentColor; flex: none;
}

/* Buttons: the Minimog theme's .elementor-button styles win over Elementor's
   per-widget colour controls, so force the design's button look here. Classes are
   put on the BUTTON widget via _css_classes, hence "<class> .elementor-button". */
.tyfd-btn .elementor-button {
  font-family: "Fredoka", system-ui, sans-serif !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
  padding: 15px 26px !important;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.tyfd-btn .elementor-button:hover { transform: translateY(-2px); }

.tyfd-btn-primary .elementor-button {
  background-color: #F7C948 !important; color: #20203A !important;
  box-shadow: 0 10px 24px -10px rgba(231,168,46,.7);
}
.tyfd-btn-primary .elementor-button:hover { background-color: #E7A82E !important; color: #20203A !important; }

.tyfd-btn-ghost .elementor-button {
  background-color: transparent !important; color: #20203A !important;
  box-shadow: inset 0 0 0 1.5px #20203A;
}
.tyfd-btn-ghost .elementor-button:hover { background-color: #20203A !important; color: #fff !important; }

/* Budget chips: white pill, hairline border, dark on hover. */
.tyfd-chip .elementor-button {
  background-color: #fff !important; color: #20203A !important;
  border: 1.5px solid #ECE6DD !important; border-radius: 999px !important;
  font-family: "Fredoka", system-ui, sans-serif !important; font-weight: 500 !important;
  padding: 13px 24px !important;
}
.tyfd-chip .elementor-button:hover { border-color: #20203A !important; transform: translateY(-2px); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tyfd *, .tyfd-stickybar { transition: none !important; }
}

/* ============================================================
   LIGHT SKIN — Father's Day "Light" design (gift-finder only).
   Activated by the widget's Skin = Light control, which adds
   `.skin-light` to the .tyfd.finder-wrap root. Overrides the
   scoped tokens to the warm-white / amber / lilac palette on
   GORDITA (the Minimog-bundled font — no Google Fonts), and
   collapses the finder to a single column (left image hidden).
   Tokens cascade to the existing .tyfd .finder rules, so most
   of the restyle is just variable reassignment.
   ============================================================ */
.tyfd.skin-light {
  --cream:        #FBF9F6;
  --cream-2:      #FBF3E2;
  --ink:          #1B1A22;
  --ink-soft:     #454250;
  --ink-faint:    #8C8896;
  --line:         #EAE6DF;

  --yellow:       #E8A13C;   /* amber accent */
  --yellow-deep:  #D8922F;
  --yellow-soft:  #F7ECD9;

  --lav:          #A78BC8;
  --lav-deep:     #8E72B8;   /* slightly deeper for text contrast */
  --lav-soft:     #F0EAF5;

  --tan-soft:     #F7ECD9;
  --green:        #1B7A4B;

  --display: "Gordita", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body:    "Gordita", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.tyfd.skin-light h1, .tyfd.skin-light h2, .tyfd.skin-light h3, .tyfd.skin-light h4 {
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.12;
}
/* Single-column light card; the left media panel is hidden. */
.tyfd.skin-light .finder {
  background: linear-gradient(180deg, var(--lav-soft), var(--cream));
  border: 1px solid var(--line);
}
.tyfd.skin-light .finder .inner { grid-template-columns: 1fr; min-height: 0; }
.tyfd.skin-light .finder .side.media-side { display: none; }
.tyfd.skin-light .finder .panel { background: transparent; }
.tyfd.skin-light .finder .side { padding: clamp(24px, 4vw, 40px); }
.tyfd.skin-light .finder .qtitle { font-weight: 700; letter-spacing: -0.01em; }
.tyfd.skin-light .finder .kicker, .tyfd.skin-light .kicker { color: var(--lav); }
.tyfd.skin-light .finder .opt { font-weight: 600; }
.tyfd.skin-light .finder .opt.sel {
  border-color: var(--lav); background: var(--lav-soft);
  box-shadow: 0 0 0 3px rgba(167,139,200,.18);
}
.tyfd.skin-light .finder .result .mini { background: #fff; border: 1px solid var(--line); }
.tyfd.skin-light .pill.warm { background: var(--lav-soft); color: var(--lav-deep); }
/* Primary CTA in the light design is INK (not amber). */
.tyfd.skin-light .btn-primary { background: var(--ink); color: #fff; box-shadow: none; }
.tyfd.skin-light .btn-primary:hover { background: #33323d; transform: translateY(-2px); }
.tyfd.skin-light .btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.tyfd.skin-light .btn-ghost:hover { background: var(--ink); color: #fff; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Sticky cart — LIGHT skin (warm-white, mobile-only, Gordita). */
.tyfd-stickybar.skin-light {
  background: rgba(255,255,255,.96); color: #1B1A22; border-top: 1px solid #EAE6DF;
  font-family: "Gordita", -apple-system, sans-serif;
}
.tyfd-stickybar.skin-light .thumb { background: #F7ECD9; }
.tyfd-stickybar.skin-light .txt b { color: #1B1A22; font-family: "Gordita", sans-serif; font-weight: 700; }
.tyfd-stickybar.skin-light .txt span,
.tyfd-stickybar.skin-light .count { color: #8C8896; }
.tyfd-stickybar.skin-light .btn {
  background: #1B1A22; color: #fff; font-weight: 700; border-radius: 999px;
  padding: 11px 18px; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; font-family: "Gordita", sans-serif;
}
.tyfd-stickybar.skin-light .btn:hover { background: #33323d; }
/* The Light design's sticky bar is mobile-only. */
@media (min-width: 920px) { .tyfd-stickybar.skin-light { display: none !important; } }
