:root {
  --choco: #352824;
  --powder: #B9D1DC;
  --marfil: #F7F3ED;
  --stone: #A9A6A2;
  --ink: #394D5C;
  --paper: #FBF9F5;
  --line: rgba(53, 40, 36, .14);
  --muted: rgba(53, 40, 36, .62);
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;
  --serif: var(--sans);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --gutter: clamp(16px, 3.2vw, 48px);
  --header: 68px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--choco);
  font: 400 15px/1.6 var(--sans); letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--powder); }
:focus-visible { outline: 1px solid var(--choco); outline-offset: 3px; }

.eyebrow { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; }
.serif { font: inherit; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--header);
  padding-top: env(safe-area-inset-top, 0px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding-inline: var(--gutter);
  background: rgba(251, 249, 245, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: background .5s var(--ease), border-color .5s var(--ease), color .5s var(--ease);
}
.header.over { background: transparent; border-color: transparent; backdrop-filter: none; }
.nav { display: flex; gap: 28px; }
.nav a, .header-right button, .header-right a { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; position: relative; }
.nav a::after, .link-line::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease);
}
.nav a:hover::after, .nav a.active::after, .link-line:hover::after { transform: scaleX(1); transform-origin: left; }
.link-line { position: relative; }
.logo { font-size: 22px; font-weight: 400; letter-spacing: .42em; padding-left: .42em; }
.header-right { display: flex; justify-content: flex-end; gap: 24px; align-items: center; }
.menu-btn { display: none; }
.bag-count { display: inline-block; min-width: 1.2em; text-align: center; }

/* ---------- Layout ---------- */
main { min-height: 80vh; }
.page { padding-top: var(--header); }
.wrap { padding-inline: var(--gutter); }
.section { padding-block: clamp(56px, 9vw, 120px); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head h2 { margin: 0; font-weight: 400; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .02em; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.35fr 1fr; min-height: 100svh; }
.hero-media { position: relative; overflow: hidden; background: var(--marfil); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); animation: heroIn 2.2s var(--ease) forwards; }
@keyframes heroIn { to { transform: scale(1); } }
.hero-copy { display: flex; flex-direction: column; justify-content: flex-end; gap: 22px; padding: calc(var(--header) + 40px) var(--gutter) clamp(40px, 7vw, 96px); background: var(--marfil); }
.hero-copy h1 { margin: 0; font-weight: 300; font-size: clamp(40px, 5.4vw, 82px); line-height: 1.02; letter-spacing: -.01em; }
.hero-copy h1 .serif { display: block; }
.hero-copy p { margin: 0; max-width: 34ch; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 50px; padding: 0 32px; border: 1px solid var(--choco);
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  background: var(--choco); color: var(--marfil);
  transition: background .35s var(--ease), color .35s var(--ease), opacity .3s;
}
.btn:hover { background: transparent; color: var(--choco); }
.btn.ghost { background: transparent; color: var(--choco); }
.btn.ghost:hover { background: var(--choco); color: var(--marfil); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* ---------- Grilla de productos ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 14px; }
.card { display: block; }
.card-media { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--marfil); }
.card-media > :not(.badge) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity .6s var(--ease); }
.card:hover .card-media > :not(.badge) { transform: scale(1.035); }
.card-media .alt { opacity: 0; }
.card:hover .card-media .alt { opacity: 1; }
.badge { position: absolute; top: 12px; left: 12px; z-index: 2; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; background: var(--paper); padding: 5px 9px; }
.card-info { padding-top: 14px; display: grid; gap: 4px; }
.card-name { font-size: 13px; letter-spacing: .04em; }
.price { font-size: 13px; display: flex; gap: 10px; align-items: baseline; }
.price s { color: var(--muted); }
.price .off { color: var(--ink); font-size: 11px; letter-spacing: .12em; }
.dots { display: flex; gap: 6px; margin-top: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--line); }

/* Placeholder editorial cuando no hay foto */
.ph { display: grid; place-items: center; text-align: center; padding: 18%; transition: background-color .6s var(--ease); }
.ph .ph-mark { font-size: 10px; letter-spacing: .5em; padding-left: .5em; opacity: .55; }
.ph .ph-name { font-weight: 300; letter-spacing: .02em; font-size: clamp(16px, 1.6vw, 21px); line-height: 1.15; margin-top: 10px; }
.ph::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(255,255,255,.18), rgba(0,0,0,.06)); pointer-events: none; }

/* ---------- Editorial ---------- */
.editorial { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 6vw, 96px); align-items: center; }
.editorial img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.editorial h2 { margin: 18px 0; font-weight: 300; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.08; }
.editorial p { color: var(--muted); max-width: 42ch; }
.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border-top: 1px solid var(--line); }
.cats a { padding: 28px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; padding-right: 24px; transition: padding .45s var(--ease), color .3s; }
.cats a:hover { padding-left: 12px; }
.cats a span:last-child { transition: transform .45s var(--ease); }
.cats a:hover span:last-child { transform: translateX(6px); }

/* ---------- Tienda ---------- */
.shop-head { padding-top: clamp(32px, 5vw, 64px); }
.shop-head h1 { margin: 0 0 24px; font-weight: 300; font-size: clamp(32px, 4vw, 56px); letter-spacing: -.005em; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-block: 16px; border-block: 1px solid var(--line); margin-bottom: 36px; position: sticky; top: var(--header); background: var(--paper); z-index: 5; }
.filters { display: flex; gap: 22px; flex-wrap: wrap; }
.filters button { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); position: relative; transition: color .3s; }
.filters button.on, .filters button:hover { color: var(--choco); }
.filters button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; }
.select { appearance: none; background: transparent; border: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; padding-right: 18px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 6px center, right 2px center; background-size: 4px 4px; background-repeat: no-repeat; }
.empty { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------- Producto ---------- */
.product {
  --pdp-h: calc(100svh - var(--header) - 48px);
  display: grid; grid-template-columns: auto minmax(280px, 440px); justify-content: center; align-items: center;
  gap: clamp(32px, 5vw, 96px); padding-block: 24px; min-height: calc(100svh - var(--header));
}
.gallery { display: flex; gap: 10px; }
.gallery-main { position: relative; height: var(--pdp-h); max-height: 900px; aspect-ratio: 3 / 4; overflow: hidden; background: var(--marfil); }
.gallery-main > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; flex-direction: column; gap: 8px; order: -1; }
.thumbs button { width: 64px; aspect-ratio: 3/4; overflow: hidden; opacity: .55; transition: opacity .3s; }
.thumbs button.on, .thumbs button:hover { opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { display: grid; gap: 20px; max-height: var(--pdp-h); overflow-y: auto; scrollbar-width: none; }
.info::-webkit-scrollbar { display: none; }
.info .size { height: 40px; }
.info summary { padding: 13px 0; }
.crumbs { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.info h1 { margin: 0; font-weight: 400; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; letter-spacing: .01em; }
.info .price { font-size: 16px; margin-top: 10px; }
.opt-label { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 12px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; position: relative; border: 1px solid var(--line); transition: transform .3s var(--ease); }
.swatch::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid transparent; transition: border-color .3s; }
.swatch.on::after { border-color: var(--choco); }
.swatch:hover { transform: scale(1.08); }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.size { height: 44px; border: 1px solid var(--line); font-size: 12px; letter-spacing: .08em; transition: border-color .25s, background .25s, color .25s; }
.size:hover { border-color: var(--choco); }
.size.on { background: var(--choco); color: var(--marfil); border-color: var(--choco); }
.size[disabled] { color: var(--stone); text-decoration: line-through; pointer-events: none; }
.stock-note { font-size: 12px; color: var(--ink); min-height: 1.4em; margin-top: 10px; }
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { list-style: none; cursor: pointer; padding: 16px 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 14px; transition: transform .35s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

/* ---------- Bolsa (drawer) ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(53, 40, 36, .28); opacity: 0; pointer-events: none; transition: opacity .5s var(--ease); }
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(440px, 100%);
  background: var(--paper); display: grid; grid-template-rows: auto 1fr auto;
  transform: translateX(100%); transition: transform .6s var(--ease);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.drawer-body { overflow-y: auto; padding: 8px 24px; }
.drawer-foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.line { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); animation: fadeUp .5s var(--ease) both; }
.line-media { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--marfil); }
.line-media > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.line-media .ph { padding: 8px; } .line-media .ph-name { font-size: 12px; } .line-media .ph-mark { display: none; }
.line h4 { margin: 0 0 4px; font-weight: 400; font-size: 13px; }
.line small { color: var(--muted); font-size: 12px; display: block; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); margin-top: 10px; }
.qty button { width: 30px; height: 30px; }
.qty span { min-width: 24px; text-align: center; font-size: 12px; }
.remove { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); align-self: start; }
.row { display: flex; justify-content: space-between; font-size: 13px; }
.row.total { font-size: 15px; }

/* ---------- Checkout ---------- */
.checkout { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 6vw, 96px); padding-block: clamp(32px, 5vw, 64px) 120px; }
.checkout h1 { margin: 0 0 28px; font-weight: 300; font-size: clamp(28px, 3vw, 44px); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 10px 0; outline: none; transition: border-color .3s; border-radius: 0; }
.field input:focus, .field textarea:focus { border-color: var(--choco); }
.summary { background: var(--marfil); padding: clamp(20px, 3vw, 36px); align-self: start; display: grid; gap: 14px; position: sticky; top: calc(var(--header) + 24px); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--paper); padding: 0 12px; height: 44px; text-transform: uppercase; letter-spacing: .1em; }
.code-row .btn { height: 44px; padding: 0 18px; }
.msg { font-size: 12px; min-height: 1.3em; }
.msg.err { color: #9a3b2e; }
.msg.ok { color: var(--ink); }

.thanks { min-height: 80vh; display: grid; place-items: center; text-align: center; padding: 120px var(--gutter); }
.thanks h1 { font-weight: 300; font-size: clamp(34px, 5vw, 64px); margin: 18px 0; }

/* ---------- Footer ---------- */
.footer { background: var(--choco); color: var(--marfil); padding: 72px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer .logo { font-size: 26px; }
.footer h5 { margin: 0 0 14px; font-weight: 400; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; opacity: .6; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; }
.footer-bottom { margin-top: 56px; padding-top: 22px; border-top: 1px solid rgba(247,243,237,.18); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 11px; letter-spacing: .14em; opacity: .65; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; background: var(--choco); color: var(--marfil); padding: 14px 22px; font-size: 12px; letter-spacing: .1em; transition: opacity .4s var(--ease), transform .4s var(--ease); pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animaciones ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.page-enter { animation: fadeUp .7s var(--ease) both; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: var(--ease); }
::view-transition-group(product-media) { animation-duration: .65s; animation-timing-function: var(--ease); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Mobile ---------- */
.mobile-nav { position: fixed; inset: 0; z-index: 55; background: var(--paper); padding: calc(var(--header) + 40px) var(--gutter) 40px; display: grid; align-content: start; gap: 22px; transform: translateY(-100%); transition: transform .6s var(--ease); }
.mobile-nav.open { transform: none; }
.mobile-nav a { font-size: 28px; font-weight: 300; }

@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 780px) {
  :root { --header: 58px; }
  .nav { display: none; }
  .menu-btn { display: inline-block; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; justify-self: start; }
  .logo { font-size: 18px; }
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { aspect-ratio: 4/5; }
  .hero-copy { padding-top: 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 28px 10px; }
  .editorial, .product, .checkout { grid-template-columns: 1fr; }
  .product { min-height: 0; justify-content: stretch; padding-bottom: 56px; }
  .gallery { flex-direction: column; }
  .gallery-main { height: auto; width: 100%; max-height: none; }
  .thumbs { flex-direction: row; order: 0; }
  .info { max-height: none; overflow: visible; }
  .summary { position: static; }
  .form { grid-template-columns: 1fr; }
  .toolbar { top: var(--header); }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Outfits ---------- */
.grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.collage { position: absolute; inset: 0; display: grid; gap: 2px; background: var(--paper); }
.collage.n2 { grid-template-columns: 1fr 1fr; }
.collage.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage.n3 .cell:first-child { grid-row: span 2; }
.collage.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage .cell { position: relative; overflow: hidden; }
.collage .cell > * { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.collage .ph { padding: 10%; }
.collage .ph-name { font-size: clamp(12px, 1.1vw, 15px); }
.collage .ph-mark { display: none; }
.pieces { display: grid; gap: 18px; }
.piece { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.piece:last-child { border-bottom: 0; padding-bottom: 0; }
.piece .opt-label { margin-bottom: 10px; align-items: baseline; }
.piece-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.swatch.sm { width: 22px; height: 22px; }
.swatch.sm::after { inset: -4px; }
.sizes.compact { display: flex; flex-wrap: wrap; gap: 4px; }
.sizes.compact .size { height: 32px; min-width: 38px; padding: 0 8px; font-size: 11px; }
.pay-hint { font-size: 12px; color: var(--ink); margin-top: 6px; letter-spacing: .02em; }

/* ---------- Medios de pago ---------- */
.co-sub { font-weight: 300; font-size: 22px; margin: 40px 0 16px; }
.methods { display: grid; gap: 8px; }
.method { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); cursor: pointer; transition: border-color .3s, background .3s; font-size: 14px; }
.method:hover { border-color: var(--stone); }
.method.on { border-color: var(--choco); background: var(--marfil); }
.method input { accent-color: var(--choco); width: 16px; height: 16px; margin: 0; }
.method-tag { font-size: 11px; letter-spacing: .12em; color: var(--ink); }
.method-total { font-size: 14px; min-width: 90px; text-align: right; }

/* ---------- Pedido ---------- */
.order-box { margin: 28px 0; padding: 20px 22px; background: var(--marfil); display: grid; gap: 8px; text-align: left; font-size: 13px; }
.order-box .row.total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.instructions { font-family: var(--sans); white-space: pre-wrap; text-align: left; background: var(--paper); border: 1px solid var(--line); padding: 16px 18px; margin: 16px 0 0; font-size: 14px; line-height: 1.7; }
.order-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.thanks p { margin-inline: auto; max-width: 46ch; }

/* ---------- WhatsApp ---------- */
.wa-btn { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--choco); color: var(--marfil);
  box-shadow: 0 6px 24px rgba(53,40,36,.18); transition: transform .4s var(--ease), background .3s; }
.wa-btn:hover { transform: translateY(-2px); background: var(--ink); }

@media (max-width: 1024px) { .grid.grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 780px) {
  .method { grid-template-columns: auto 1fr auto; }
  .method-tag { display: none; }
}
