/* Prototipo 03 · Boutique Atelier Sur — Kinetik Web Lab
   Arquetipo 3 (Cálido orgánico / editorial moda): arena, crema, espresso y un acento terracota. */

/* Respaldos con métricas ajustadas: el cambio de fuente (display=swap) no mueve el layout */
@font-face { font-family: "Cormorant Fallback"; src: local("Georgia"); size-adjust: 88.4%; ascent-override: 104.5%; descent-override: 32.5%; line-gap-override: 0%; }
@font-face { font-family: "DM Sans Fallback"; src: local("Arial"); size-adjust: 104%; ascent-override: 95.4%; descent-override: 29.8%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  --bg: #F6F1EA;          /* arena cálida */
  --card: #FBF8F4;        /* crema */
  --ink: #1E1B18;         /* espresso: 15,3:1 sobre arena */
  --ink-2: #5E554C;       /* 6,5:1 sobre arena */
  --line: #E4DDD3;
  --line-2: #CFC5B8;
  --acc: #9C4A35;         /* terracota: texto blanco 6,1:1 */
  --acc-h: #7E3826;       /* hover: texto blanco 8,5:1 */
  --acc-soft: #EFDDD5;
  --serif: "Cormorant Garamond", "Cormorant Fallback", Georgia, serif;
  --sans: "DM Sans", "DM Sans Fallback", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-1: 10px;
  --r-2: 14px;
  --gut: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --sec: clamp(88px, 11vw, 160px);
  --top: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); scrollbar-color: var(--line-2) var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; caret-color: var(--acc); }
body.is-locked { overflow: hidden; }
::selection { background: var(--acc); color: #FFFFFF; }
h1, h2, h3, p, ul, ol, dl, dd, dt, figure, fieldset, legend { margin: 0; padding: 0; }
fieldset { border: 0; min-width: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-underline-offset: .24em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 14px; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--acc); color: #FFFFFF; padding: 8px 14px; border-radius: 999px; z-index: 60; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }

/* Barra superior */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: var(--top);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 var(--gut); background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { justify-self: start; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; color: var(--ink); }
.brand__mark { flex: none; width: 26px; height: 26px; color: var(--acc); }
.brand__line { stroke: var(--ink); }
.brand__word { font: 600 19px/1 var(--serif); letter-spacing: .16em; text-transform: uppercase; }
.brand__city { font: 500 11px/1 var(--sans); letter-spacing: .2em; color: var(--ink-2); }
.brand__sep { color: var(--acc); }
.nav { display: flex; gap: 32px; font-size: 14px; letter-spacing: .04em; }
.nav a { text-decoration: none; color: var(--ink-2); transition: color .2s var(--ease); }
.nav a:hover { color: var(--ink); }
.cart-btn {
  justify-self: end; display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: border-color .2s var(--ease);
}
.cart-btn:hover { border-color: var(--ink); }
.cart-btn__count {
  min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700;
}
.cart-btn__count.is-bump { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.18); background: var(--acc); } }

/* Botones */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--acc); font: 500 15px/1 var(--sans); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.pill--ink { background: var(--acc); color: #FFFFFF; }
.pill--ink:hover { background: var(--acc-h); border-color: var(--acc-h); }
.pill:active { transform: scale(.98); }
.link { font-size: 15px; font-weight: 500; text-decoration: underline; text-decoration-color: var(--line-2); transition: text-decoration-color .2s var(--ease); }
.link:hover { text-decoration-color: var(--ink); }

/* Hero editorial */
.hero {
  max-width: var(--max); margin: 0 auto; padding: calc(var(--top) + clamp(40px, 6vw, 88px)) var(--gut) 0;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(48px, 7vw, 112px); align-items: end;
}
.eyebrow { white-space: nowrap; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--acc); font-weight: 500; }
.h1 { margin-top: 20px; font-size: clamp(46px, 6.6vw, 104px); line-height: .98; letter-spacing: -0.015em; max-width: 5.9em; text-wrap: balance; }
.lead { margin-top: 28px; max-width: 25em; font-size: clamp(16px, 1.3vw, 18px); color: var(--ink-2); text-wrap: pretty; }
.h-cta { margin-top: 36px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-bottom: clamp(8px, 2vw, 32px); }
.hero__fig { display: grid; gap: 12px; }
.hero__fig img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-2); background: var(--line); }
.hero__cap { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--ink-2); padding-top: 4px; border-top: 1px solid var(--line); }

/* Catálogo */
.cat { max-width: var(--max); margin: 0 auto; padding: var(--sec) var(--gut) 0; }
.cat__head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 16px 40px; padding-bottom: 24px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.cat__head h2 { font-size: clamp(36px, 4vw, 56px); line-height: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; cursor: pointer;
  font-size: 14px; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cat__count { white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 20px; }
.prod { display: grid; grid-template-rows: auto 1fr auto auto; gap: 14px; align-content: start; }
.prod[hidden] { display: none; }
.prod__img { aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--r-2); background: var(--line); }
.prod__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.prod:hover .prod__img img { transform: scale(1.03); }
.prod__info { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.prod__cat { grid-column: 1 / -1; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.prod__name { font: 600 22px/1.15 var(--serif); }
.prod__price { font-size: 15px; font-weight: 700; }
.prod__desc { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }
.sizes { display: flex; gap: 6px; }
.size { position: relative; flex: 1 1 0; }
.size input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.size span {
  display: grid; place-items: center; height: 38px; border: 1px solid var(--line-2); border-radius: var(--r-1);
  font-size: 13px; font-weight: 500; background: var(--card); transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.size:hover span { border-color: var(--ink); }
.size input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.size input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 2px; }
.prod__add { width: 100%; min-height: 44px; font-size: 14px; }
.prod__add.is-done { background: var(--ink); border-color: var(--ink); }

/* Envíos */
.info { max-width: var(--max); margin: var(--sec) auto 0; padding: 48px var(--gut) 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 32px clamp(40px, 6vw, 96px); }
.info__t { font-size: clamp(30px, 3.2vw, 44px); line-height: 1.05; }
.info__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.info__list h3 { font: 600 15px/1.3 var(--sans); margin-bottom: 8px; }
.info__list p { font-size: 15px; color: var(--ink-2); }

/* Pie */
.foot { max-width: var(--max); margin: var(--sec) auto 0; padding: 28px var(--gut) 104px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.foot__brand { font: 600 18px/1.2 var(--serif); letter-spacing: .08em; text-transform: uppercase; }
.sign { justify-self: start; display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--ink-2); font-size: 13px; text-decoration: none; transition: color .2s var(--ease); }
.sign:hover { color: var(--ink); }
.sign__mark { flex: none; width: 20px; height: 20px; }

/* Carrito (panel lateral) */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(30, 27, 24, .32); opacity: 0; transition: opacity .3s var(--ease); }
.scrim.is-on { opacity: 1; }
.scrim[hidden] { display: none; }
.cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(440px, 100vw);
  display: grid; grid-template-rows: auto auto 1fr auto; background: var(--card); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .38s var(--ease); visibility: hidden;
}
.cart.is-open { transform: none; visibility: visible; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.cart__t { font-size: 30px; line-height: 1; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: 50%; background: transparent; cursor: pointer; transition: border-color .2s var(--ease); }
.icon-btn:hover { border-color: var(--ink); }
.ship { padding: 16px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.ship__msg b { color: var(--ink); font-weight: 700; }
.ship__msg.is-free { color: var(--acc); font-weight: 500; }
.ship__bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.ship__bar i { display: block; height: 100%; width: 100%; background: var(--acc); transform-origin: left; transform: scaleX(0); transition: transform .4s var(--ease); }
.cart__items { overflow-y: auto; overscroll-behavior: contain; padding: 0 24px; }
.cart__empty { padding: 32px 24px; color: var(--ink-2); align-self: start; }
.cart__empty[hidden] { display: none; }
.item { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.item img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--line); }
.item__name { font: 600 18px/1.15 var(--serif); }
.item__meta { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.qty { display: inline-flex; align-items: center; margin-top: 10px; border: 1px solid var(--line-2); border-radius: 999px; }
.qty button { width: 32px; height: 32px; border: 0; background: transparent; cursor: pointer; font-size: 16px; border-radius: 50%; }
.qty button:hover { background: var(--bg); }
.qty output { min-width: 24px; text-align: center; font-size: 14px; font-weight: 500; }
.item__side { display: grid; justify-items: end; align-content: space-between; }
.item__price { font-size: 15px; font-weight: 700; }
.item__rm { border: 0; background: transparent; padding: 4px 0; font-size: 13px; color: var(--ink-2); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.item__rm:hover { color: var(--acc); }
.cart__foot { padding: 20px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 14px; background: var(--card); }
.totals { display: grid; gap: 6px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--ink-2); }
.totals__total { padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 18px; font-weight: 700; }
.totals__total dt { color: var(--ink); }
.cart__checkout { width: 100%; min-height: 52px; }
.cart__checkout[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.cart__note { text-align: center; font-size: 13px; }

/* Revelado al scroll (solo con JS) */
.js .reveal { opacity: 0; }

/* Escríbenos (WhatsApp): fijo, no afecta el layout (CLS 0); se oculta con el carrito abierto */
.wa { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: grid; justify-items: end; gap: 12px; transition: opacity .2s var(--ease); }
body.cart-open .wa { opacity: 0; visibility: hidden; pointer-events: none; }
.wa-fab {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px 0 16px; position: relative;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none;
  font: 500 14px/1 var(--sans); box-shadow: 0 6px 24px rgba(30,27,24,.07); transition: border-color .2s var(--ease);
}
.wa-fab:hover, .wa-fab[aria-expanded="true"] { border-color: var(--ink); }
.wa-ico { flex: none; display: block; }
.wa-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2E8B57; box-shadow: 0 0 0 3px rgba(46,139,87,.14); }
.wa-dot--fab { position: absolute; top: 9px; left: 30px; box-shadow: 0 0 0 2px var(--card); }
.wa-panel {
  width: min(340px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2);
  box-shadow: 0 18px 48px rgba(30,27,24,.12); overflow: hidden; transform-origin: bottom right; animation: wa-in .22s var(--ease);
}
.wa-panel[hidden] { display: none; }
@keyframes wa-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.wa-panel__head { display: flex; justify-content: space-between; align-items: start; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--line); }
.wa-panel__title { font-weight: 500; font-size: 15px; line-height: 1.3; }
.wa-panel__sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.wa-close { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; transition: border-color .2s var(--ease); }
.wa-close:hover { border-color: var(--ink); }
.wa-form { display: grid; gap: 12px; padding: 16px 18px 18px; }
.wa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wa-chip { font: 400 13px/1.2 var(--sans); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 9px 12px; cursor: pointer; text-align: left; transition: border-color .2s var(--ease), background .2s var(--ease); }
.wa-chip:hover { border-color: var(--ink); }
.wa-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.wa-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.wa-text { width: 100%; resize: none; font: 400 16px/1.45 var(--sans); color: var(--ink); background: #FFFFFF; border: 1px solid var(--line-2); border-radius: var(--r-1); padding: 10px 12px; }
.wa-text::placeholder { color: #6B6157; }
.wa-text:focus { outline: none; border-color: var(--ink); }
.wa-send { width: 100%; gap: 10px; min-height: 46px; }

@media (prefers-reduced-motion: reduce) {
  .wa-panel { animation: none; }
  .js .reveal { opacity: 1; }
  .cart, .scrim, .ship__bar i, .prod__img img { transition: none; }
  .cart-btn__count.is-bump { animation: none; }
}

/* Tablet */
@media (max-width: 1023px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .h1 { font-size: clamp(40px, 5.6vw, 56px); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat__head { grid-template-columns: 1fr auto; }
  .filters { grid-column: 1 / -1; grid-row: 2; }
  .info { grid-template-columns: minmax(0, 1fr); }
}

/* Móvil */
@media (max-width: 639px) {
  :root { --top: 60px; }
  .brand__word { display: grid; gap: 4px; font-size: 16px; letter-spacing: .14em; }
  .brand__sep { display: none; }
  .brand__city { font-size: 9.5px; letter-spacing: .22em; }
  .cart-btn { padding: 0 6px 0 12px; height: 40px; }
  .cart-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .hero { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .h-cta .pill { width: 100%; }
  .hero__fig { max-width: 420px; }
  .grid { gap: 32px 12px; }
  .prod__info { grid-template-columns: minmax(0, 1fr); }
  .prod__name { font-size: 19px; }
  .prod__desc { display: none; }
  .sizes { gap: 4px; }
  .size span { height: 34px; font-size: 12px; }
  .prod__add { min-height: 42px; padding: 0 10px; font-size: 13px; }
  .info__list { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gut) * -1); padding: 0 var(--gut); }
  .chip { flex: none; }
  .cart__head, .ship, .cart__foot { padding-left: 18px; padding-right: 18px; }
  .cart__items { padding: 0 18px; }
  .wa-fab { width: 48px; padding: 0; justify-content: center; }
  .wa-fab__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .wa-dot--fab { top: 8px; left: auto; right: 9px; }
}
