:root {
  --paper: #ffffff;
  --mist: #f3f5f2;
  --line: #e2e6e1;
  --ink: #141614;
  --ink-2: #4a514b;
  --muted: #646b65;
  --pine: #123d2c;
  --pine-2: #1b5a41;
  --pine-ink: #cfe3d6;
  --red: #c11a2b;
  --red-2: #a3121f;
  --radius: 14px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --font: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--font);
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; }
h1, h2, h3 { margin: 0; line-height: 1.05; text-wrap: balance; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Browser surfaces */
::selection { background: var(--pine); color: #fff; }
input { caret-color: var(--red); }
:focus-visible { outline: 2px solid var(--pine-2); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: #c4cbc4 var(--paper); }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span {
  font-variation-settings: "wdth" 125; font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.brand b { font-weight: 500; color: var(--muted); }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--ink-2); font-size: 0.95rem; font-weight: 500; white-space: nowrap; transition: color 160ms ease; }
.nav-links a:hover { color: var(--ink); }
.cart-btn {
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: 9px 10px 9px 16px; font: 600 0.92rem var(--font); cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}
.cart-btn:hover { background: #2a2e2a; }
.cart-btn:active { transform: scale(0.97); }
.cart-btn em {
  font-style: normal; font-variant-numeric: tabular-nums; min-width: 24px; height: 24px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 999px; background: var(--red); font-size: 0.78rem;
}
.cart-btn em.pop { animation: pop 320ms var(--ease-out); }
@keyframes pop { 40% { transform: scale(1.22); } }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font: 600 1rem var(--font); text-decoration: none; cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-2); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--mist); }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink); }
.btn-light { background: #fff; color: var(--pine); }
.btn-light:hover { background: var(--pine-ink); }
.btn-block { width: 100%; }

/* ---------- HERO ---------- */
.hero {
  max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 80px); align-items: center;
  padding: clamp(40px, 7vw, 96px) clamp(18px, 4vw, 56px) clamp(56px, 7vw, 104px);
}
.hero h1 {
  font-variation-settings: "wdth" 118; font-weight: 800;
  font-size: clamp(2.7rem, 5.6vw, 5.2rem); letter-spacing: -0.03em; line-height: 0.98;
}
.hero h1 span { display: block; color: var(--pine-2); }
.lead { color: var(--ink-2); font-size: clamp(1.05rem, 1.35vw, 1.2rem); max-width: 34em; margin: 26px 0 34px; }
.hero-cta { display: flex; gap: 8px; flex-wrap: wrap; }
.hero-note { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; max-width: 30em; }
.hero-note strong { color: var(--ink); font-variant-numeric: tabular-nums; }

/* Signature moment: product photos "print" in, layer by layer */
.hero-stage {
  display: grid; gap: 12px;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 0.9fr;
  aspect-ratio: 1 / 0.92;
}
.hero-stage figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--mist); }
.hero-stage figure:nth-child(1) { grid-row: 1 / 3; }
.hero-stage figure:nth-child(4) { grid-column: 2 / 4; }
.hero-stage figure:nth-child(5) { grid-row: 3; grid-column: 1; }
.hero-stage figure:nth-child(n + 6) { display: none; }
.hero-stage img { width: 100%; height: 100%; object-fit: cover; }
.hero-stage figure:not(.print) img { opacity: 0; }
.hero-stage figure.print img { animation: print 1100ms steps(22, end) both; animation-delay: var(--d, 0ms); }
.hero-stage figure.print::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; bottom: 0;
  background: var(--red); box-shadow: 0 0 0 1px rgba(193, 26, 43, 0.15);
  animation: nozzle 1100ms steps(22, end) both; animation-delay: var(--d, 0ms);
}
@keyframes print { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes nozzle { from { transform: translateY(0); opacity: 1; } 99% { opacity: 1; } to { transform: translateY(calc(-1 * var(--h, 300px))); opacity: 0; } }

/* Novix, la mascota */
.hero-visual { position: relative; }
.novix {
  position: absolute; right: 4%; bottom: -7%; width: 31%; margin: 0; z-index: 2;
  pointer-events: none;
}
.novix img { width: 100%; height: auto; filter: drop-shadow(0 18px 22px rgba(20, 22, 20, 0.22)); }
.novix-bubble {
  position: absolute; right: 88%; top: 14%; width: max-content; max-width: 15em;
  padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--ink); color: #fff;
  font-size: 0.88rem; font-weight: 600; line-height: 1.3;
  box-shadow: 0 8px 20px rgba(20, 22, 20, 0.18);
}
.novix { animation: novix-in 620ms var(--ease-out) 1250ms both; }
.novix-bubble { transform-origin: 100% 100%; animation: bubble-in 360ms var(--ease-out) 1750ms both; }
@keyframes novix-in { from { opacity: 0; transform: translateY(24px) scale(0.96); } }
@keyframes bubble-in { from { opacity: 0; transform: scale(0.9); } }

/* ---------- COLECCIÓN (piezas reales de Novart) ---------- */
.coleccion { background: var(--mist); border-block: 1px solid var(--line); }
.coleccion-inner { max-width: 1360px; margin: 0 auto; padding: clamp(56px, 7vw, 96px) clamp(18px, 4vw, 56px); }
.coleccion-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 36px; }
.coleccion-head h2 {
  font-variation-settings: "wdth" 115; font-weight: 800; letter-spacing: -0.025em;
  font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.02; max-width: 14em;
}
.coleccion-lead { color: var(--ink-2); margin-top: 12px; max-width: 36em; }
.coleccion .thumb { background: #fff; }
.lic.lic-novart { color: #fff; background: var(--pine); }

/* ---------- CATALOG ---------- */
.catalog { max-width: 1360px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(18px, 4vw, 56px) clamp(64px, 8vw, 112px); }
.catalog-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.catalog-head h2, .how h2 {
  font-variation-settings: "wdth" 115; font-weight: 800; letter-spacing: -0.025em;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
}
#resultCount { font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search {
  flex: 1 1 340px; display: flex; align-items: center; gap: 10px; min-height: 50px;
  padding: 0 18px; border-radius: 999px; background: var(--mist); color: var(--muted);
  border: 1px solid transparent; transition: border-color 160ms ease, background-color 160ms ease;
}
.search:focus-within { background: var(--paper); border-color: var(--ink); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--ink); font: inherit; }
.search input::placeholder { color: #5c635d; }
.select select {
  appearance: none; min-height: 50px; padding: 0 44px 0 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); color: var(--ink); font: 500 0.95rem var(--font);
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23141614' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center;
}
.toggle { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: var(--ink-2); font-size: 0.95rem; font-weight: 500; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.track { width: 42px; height: 24px; border-radius: 999px; background: #cfd5cf; position: relative; transition: background-color 200ms ease; }
.track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(20, 22, 20, 0.25); transition: transform 200ms var(--ease-out);
}
.toggle input:checked + .track { background: var(--pine-2); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--pine-2); outline-offset: 3px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -2px 30px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink-2);
  font: 500 0.92rem var(--font); cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip small { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; transition: color 160ms ease; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip[aria-pressed="true"] small { color: #b9c0ba; }
@media (hover: hover) and (pointer: fine) {
  .chip:hover:not([aria-pressed="true"]) { border-color: var(--ink); color: var(--ink); }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 36px 22px; }
.item { display: flex; flex-direction: column; gap: 12px; }
.grid.enter .item { animation: rise 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--mist); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .item:hover .thumb img { transform: scale(1.04); }
}
.lic {
  position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 8px; border-radius: 999px; background: #fff; color: var(--pine);
  font-size: 0.74rem; font-weight: 600; box-shadow: 0 2px 8px rgba(20, 22, 20, 0.12);
}
.item-info { display: flex; flex-direction: column; gap: 4px; }
.item-cat { color: var(--muted); font-size: 0.82rem; }
.item h3 {
  font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em;
}
.item-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.item-meta span { display: inline-flex; align-items: center; gap: 5px; }
.item-meta a { display: inline-flex; align-items: center; gap: 3px; text-decoration: none; color: var(--ink-2); }
.item-meta a:hover { color: var(--ink); text-decoration: underline; }
.add {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; width: 100%;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: 600 0.92rem var(--font); cursor: pointer;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.add:active { transform: scale(0.97); }
.add.in { background: var(--pine); border-color: var(--pine); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .add:not(.in):hover { border-color: var(--ink); }
}
.more { display: flex; justify-content: center; margin-top: 52px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 72px 0; }
.empty button { margin-top: 16px; }

/* ---------- HOW (pine field) ---------- */
.how { background: var(--pine); color: #fff; }
.how-inner { max-width: 1360px; margin: 0 auto; padding: clamp(64px, 8vw, 112px) clamp(18px, 4vw, 56px); }
.steps { list-style: none; padding: 0; margin: 48px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 clamp(24px, 4vw, 56px); }
.steps li { padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.22); }
.step-n {
  display: block; font-variation-settings: "wdth" 125; font-weight: 800; font-size: 3rem; line-height: 1;
  color: var(--pine-ink); margin-bottom: 22px; font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.steps p { color: var(--pine-ink); max-width: 30em; }
.custom {
  margin-top: clamp(56px, 7vw, 96px); padding: clamp(26px, 4vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  border-radius: 20px; background: var(--pine-2);
}
.custom { position: relative; }
.custom-text { flex: 1 1 320px; }
.custom-novix { width: 132px; height: auto; margin: -78px 0 -14px; flex: none; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.28)); }
.custom h3 { font-variation-settings: "wdth" 112; font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.custom p { color: var(--pine-ink); }

/* ---------- FOOTER ---------- */
.footer {
  max-width: 1360px; margin: 0 auto; padding: 48px clamp(18px, 4vw, 56px);
  display: flex; align-items: center; gap: 32px; flex-wrap: wrap;
}
.footer-logo { width: 86px; height: auto; }
.footer-text { display: grid; gap: 4px; }

/* ---------- DRAWER ---------- */
.drawer { position: fixed; inset: 0; z-index: 50; visibility: hidden; transition: visibility 0s linear 380ms; }
.drawer::before {
  content: ""; position: absolute; inset: 0; background: rgba(20, 22, 20, 0.35);
  opacity: 0; transition: opacity 300ms ease;
}
.drawer.open { visibility: visible; transition: visibility 0s; }
.drawer.open::before { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%);
  display: flex; flex-direction: column; background: var(--paper);
  box-shadow: -24px 0 60px rgba(20, 22, 20, 0.16);
  transform: translateX(100%); transition: transform 380ms var(--ease-drawer);
}
.drawer.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.25rem; font-weight: 700; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: transparent; color: var(--ink); cursor: pointer; transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.icon-btn:hover { background: var(--mist); }
.icon-btn:active { transform: scale(0.94); }
.cart-list { list-style: none; margin: 0; padding: 8px 24px; overflow-y: auto; flex: 1; }
.cart-list li { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-list li.empty-cart { display: block; border: 0; padding: 40px 8px; text-align: center; color: var(--muted); }
.cart-list li.empty-cart img { display: block; width: 96px; height: auto; margin: 0 auto 14px; background: none; border-radius: 0; object-fit: contain; }
.cart-list img { width: 60px; height: 60px; object-fit: cover; border-radius: 10px; background: var(--mist); }
.cart-list p { font-size: 0.92rem; line-height: 1.35; }
.qty { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; }
.qty button {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer;
  transition: border-color 160ms ease, transform 160ms var(--ease-out);
}
.qty button:hover { border-color: var(--ink); }
.qty button:active { transform: scale(0.92); }
.drawer-foot { display: grid; gap: 8px; padding: 18px 24px 24px; border-top: 1px solid var(--line); }
.drawer-foot p { margin-bottom: 6px; }
.btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* ---------- TOAST ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(20, 22, 20, 0.2);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none;
  transition: opacity 200ms ease, transform 300ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 640px; }
  .steps { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 12px; }
  .nav-links { display: none; }
  .cart-btn { margin-left: auto; }
  .cart-label { display: none; }
  .cart-btn { padding: 9px 9px 9px 13px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .toolbar .select, .toolbar .toggle { flex: 1 1 auto; }
  .select select { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .item h3 { font-size: 0.92rem; }
  .item-meta .likes { display: none; }
  .novix { right: 2%; bottom: -8%; width: 34%; }
  .novix-bubble { display: none; }
  .custom-novix { width: 104px; margin: -64px 0 -8px; }
  .add { font-size: 0.86rem; }
  .custom .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-stage figure.print img, .hero-stage figure.print::after,
  .grid.enter .item, .cart-btn em.pop, .novix, .novix-bubble { animation: none; }
  .hero-stage figure.print::after { display: none; }
  .hero-stage figure:not(.print) img { opacity: 1; }
  .drawer-panel, .toast { transition: opacity 200ms ease; }
  .thumb img { transition: none; }
}
