/* ==========================================================
   NEW YORK COOKIES — base: tokens, tipografía, navegación, UI común
   Paleta extraída del logo, la mascota y las fotos reales.
   ========================================================== */

@font-face { font-family: 'Bagel Fat One'; src: url('../assets/fonts/bagel-fat-one.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Paytone One'; src: url('../assets/fonts/paytone-one.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('../assets/fonts/dm-sans.woff2') format('woff2'); font-weight: 100 1000; font-display: swap; }

:root {
  /* Logo: chocolate sobre manteca */
  --butter: #F8EFC6;
  --butter-50: #FDF9E6;
  --butter-300: #EFE0A3;
  --choc: #56361A;
  --choc-900: #2E1A0B;
  --choc-700: #724A29;
  /* Mascota Liberty: menta y mejillas rosadas */
  --mint: #8FD5C0;
  --mint-300: #C3EADF;
  --mint-600: #3F9D8A;
  --mint-800: #22645A;
  --blush: #F4B3A7;
  /* Cookies */
  --caramel: #D98E3F;
  --berry: #C61F52;

  --paper: #FFFCF0;
  --ink: var(--choc);
  --line: color-mix(in srgb, var(--choc) 16%, transparent);

  --f-display: 'Bagel Fat One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --f-serif: 'Fraunces', Georgia, serif;
  --f-body: 'DM Sans', system-ui, sans-serif;
  --f-flavor: 'Paytone One', 'Arial Rounded MT Bold', system-ui, sans-serif;   /* nombres de los sabores */

  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --nav-h: 64px;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --r-lg: 28px;
  --r-md: 18px;
  --shadow-soft: 0 18px 40px -18px rgba(70, 38, 10, .45);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; overflow-x: clip; }
body {
  margin: 0; background: var(--butter); color: var(--ink);
  font: 400 clamp(15px, 1.05vw + 9px, 18px)/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
em { font-family: var(--f-serif); font-style: italic; font-weight: 600; letter-spacing: -.01em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--mint-600); outline-offset: 3px; border-radius: 6px; }

.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--choc); color: var(--butter); padding: 10px 16px; border-radius: 999px; transition: top .2s; }
.skip:focus { top: 12px; }

.logo-mask {
  display: block; aspect-ratio: 765 / 595; background: currentColor;
  -webkit-mask: var(--logo-url) center / contain no-repeat;
  mask: var(--logo-url) center / contain no-repeat;
}

.eyebrow {
  font: 700 .72rem/1 var(--f-body); letter-spacing: .22em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: .7em; color: var(--mint-800);
}
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }

h2 {
  font: 400 clamp(2.4rem, 6.4vw, 5.6rem)/.92 var(--f-display); letter-spacing: -.015em; text-wrap: balance;
}
h2 em { font-weight: 700; letter-spacing: -.03em; color: var(--mint-800); }
.lede { font-size: clamp(1rem, 1.2vw + .6rem, 1.3rem); max-width: 46ch; opacity: .86; text-wrap: pretty; }

/* ---------- Botones ---------- */
.btn {
  --bg: var(--choc); --fg: var(--butter);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: 0 1.7em; border-radius: 999px;
  font: 700 1rem/1 var(--f-body); letter-spacing: .01em; text-decoration: none;
  background: var(--bg); color: var(--fg); border: 2px solid var(--bg);
  transition: transform .35s var(--ease), background .25s, color .25s, box-shadow .35s var(--ease);
  box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--bg) 55%, #000);
}
.btn svg { width: 1.2em; height: 1.2em; transition: transform .35s var(--ease); }
.btn:hover { transform: translateY(-3px); box-shadow: 0 9px 0 -1px color-mix(in srgb, var(--bg) 55%, #000); }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 -1px color-mix(in srgb, var(--bg) 55%, #000); }
.btn--choc { --bg: var(--choc); --fg: var(--butter); }
.btn--ghost { --bg: transparent; --fg: var(--choc); border-color: var(--choc); box-shadow: none; }
.btn--ghost:hover { background: var(--choc); color: var(--butter); box-shadow: none; }
.btn--butter { --bg: var(--butter); --fg: var(--choc); }
.btn--mint { --bg: var(--mint); --fg: var(--choc-900); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; box-shadow: none; }
.btn--sm { min-height: 42px; padding: 0 1.2em; font-size: .92rem; }

/* ---------- NAV ---------- */
.nav {
  position: fixed; z-index: 60; top: 12px; left: 0; right: 0; margin: 0 auto;
  width: min(calc(100% - 24px), 1280px); height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 10px 0 22px; border-radius: 999px;
  background: color-mix(in srgb, var(--butter-50) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border: 1.5px solid var(--line);
  transition: transform .5s var(--ease), background .3s;
}
.nav.is-hidden { transform: translateY(-140%); }
.nav__logo { width: 78px; color: var(--choc); display: block; }
.nav__links { display: flex; gap: 6px; }
.nav__links a {
  text-decoration: none; font-weight: 600; font-size: .95rem; padding: 10px 16px; border-radius: 999px;
  transition: background .25s, color .25s;
}
.nav__links a:hover, .nav__links a.is-active { background: var(--choc); color: var(--butter); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.cart-btn {
  display: inline-flex; align-items: center; gap: .55em; height: 46px; padding: 0 8px 0 18px; border-radius: 999px;
  background: var(--choc); color: var(--butter); font-weight: 700; font-size: .95rem;
  transition: transform .3s var(--ease);
}
.cart-btn:hover { transform: scale(1.04); }
.cart-btn svg { width: 22px; height: 22px; }
.cart-btn__count {
  min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px;
  background: var(--mint); color: var(--choc-900); font-weight: 800; font-size: .88rem; font-variant-numeric: tabular-nums;
}
.menu-btn { display: none; width: 46px; height: 46px; border-radius: 50%; position: relative; border: 1.5px solid var(--line); }
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 2.5px; background: var(--choc); border-radius: 3px; transition: transform .35s var(--ease), top .35s var(--ease); }
.menu-btn span:nth-child(1) { top: 18px; } .menu-btn span:nth-child(2) { top: 26px; }
.menu-btn[aria-expanded="true"] span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { top: 22px; transform: rotate(-45deg); }

.menu-sheet {
  position: fixed; inset: 0; z-index: 55; background: var(--butter); display: flex; flex-direction: column; justify-content: center;
  gap: 4px; padding: 90px var(--gutter) 40px; clip-path: circle(0 at calc(100% - 40px) 40px); transition: clip-path .6s var(--ease-io);
}
.menu-sheet.is-open { clip-path: circle(150% at calc(100% - 40px) 40px); }
.menu-sheet a { font: 400 clamp(2.4rem, 11vw, 4rem)/1.1 var(--f-display); text-decoration: none; padding: 6px 0; }

/* ---------- Tape ---------- */
.tape-wrap { position: relative; z-index: 3; overflow: hidden; margin: -28px 0; padding: 28px 0; pointer-events: none; }
.tape { position: relative; margin: 0 -3vw; transform: rotate(-1.4deg); background: var(--choc); color: var(--butter); overflow: hidden; padding: 16px 0; }
.tape__track { display: flex; width: max-content; align-items: center; gap: 28px; animation: tape 36s linear infinite; font: 400 clamp(1.1rem, 2.2vw, 1.6rem)/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; padding-right: 28px; }
.tape__track i { width: 18px; height: 18px; border-radius: 50%; background: var(--mint); flex: none; box-shadow: inset -3px -3px 0 rgba(0,0,0,.18); }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------- Propuesta ---------- */
.proposal-pill {
  position: fixed; z-index: 58; left: 14px; bottom: 14px; display: inline-flex; align-items: center; gap: .55em;
  padding: 11px 16px; border-radius: 999px; background: var(--choc-900); color: var(--butter); font-weight: 700; font-size: .85rem;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.45); transition: transform .3s var(--ease), bottom .4s var(--ease);
}
/* sube sobre la barra fija del total para no taparlo */
body.in-builder .proposal-pill { bottom: 104px; }
.proposal-pill:hover { transform: translateY(-3px); }
.proposal-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); animation: pulse 2s infinite; }
.proposal-pill__demo { font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; background: var(--blush); color: #6B1D12; padding: 3px 6px; border-radius: 5px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(143, 213, 192, 0); } 0% { box-shadow: 0 0 0 0 rgba(143, 213, 192, .7); } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 300; left: 50%; bottom: 90px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { background: var(--choc-900); color: var(--butter); padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: .92rem; opacity: 0; transform: translateY(14px) scale(.96); transition: .4s var(--ease); text-align: center; }
.toast.is-in { opacity: 1; transform: none; }

/* ---------- Reveal on scroll helper (set by JS) ---------- */
[data-reveal] { will-change: transform, opacity; }

@media (max-width: 860px) {
  .nav { padding-left: 18px; }
  .nav__links { display: none; }
  .menu-btn { display: block; }
  .cart-btn__label { display: none; }
  .cart-btn { padding: 0 8px 0 14px; }
  .proposal-pill { bottom: 12px; left: 12px; padding: 9px 13px; transition: transform .3s var(--ease), bottom .4s var(--ease); }
  body.in-builder .proposal-pill { bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tape__track { animation: none; }
  .proposal-pill .dot { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}


