/* ============================================================================
   Juventino.shop — Hoja de estilos principal
   Estética editorial de moda: papel cálido, tinta profunda, acento bermellón.
   ========================================================================== */

/* ------------------------------------------------------------- variables */
:root {
  --paper:      #f5f1e8;
  --paper-2:    #efe9dd;
  --paper-3:    #e7e0d1;
  --ink:        #16130e;
  --ink-soft:   #4a4237;
  --muted:      #8b8171;
  --line:       rgba(22, 19, 14, 0.14);
  --line-soft:  rgba(22, 19, 14, 0.08);
  --accent:     #c4432a;
  --accent-2:   #e0603f;
  --accent-ink: #fff6f1;
  --gold:       #a8813f;
  --ok:         #2f6b46;

  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(22, 19, 14, 0.06), 0 4px 14px rgba(22, 19, 14, 0.05);
  --shadow-md: 0 10px 30px rgba(22, 19, 14, 0.10);
  --shadow-lg: 0 24px 60px rgba(22, 19, 14, 0.18);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --header-h: 68px;
}

/* ----------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

/* Trama sutil de papel sobre todo el documento. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.24'/%3E%3C/svg%3E");
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -0.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

body.no-scroll { overflow: hidden; }

/* Las reglas de display de los componentes pueden anular el atributo hidden,
   así que lo forzamos para que alternar vistas funcione siempre. */
[hidden] { display: none !important; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ------------------------------------------------------------- tipografía */
.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.display {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.serif-italic { font-style: italic; font-weight: 400; }

.lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 46ch;
}

/* -------------------------------------------------------------- layout */
.wrap { width: min(1280px, calc(100% - 3rem)); margin-inline: auto; }
.wrap--narrow { width: min(880px, calc(100% - 3rem)); margin-inline: auto; }
.section { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.section--tight { padding: clamp(2rem, 5vw, 3.5rem) 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { font-size: clamp(1.8rem, 4vw, 3rem); }
.section-head p { color: var(--muted); max-width: 44ch; margin-top: 0.5rem; }

/* -------------------------------------------------------------- botones */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-radius: var(--r-pill);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn--solid { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); }
.btn--solid:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line); }
.btn--ghost:hover { --btn-bg: var(--ink); --btn-fg: var(--paper); border-color: var(--ink); }

.btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink); }
.btn--light:hover { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); }

.btn--block { width: 100%; }
.btn--sm { padding: 0.55rem 1rem; font-size: 0.72rem; }
.btn .ico { width: 1.05em; height: 1.05em; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  position: relative;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--paper-3); }
.icon-btn .ico { width: 20px; height: 20px; }

.ico { width: 24px; height: 24px; flex: none; }

/* --------------------------------------------------------------- cabecera */
.site-header {
  position: sticky;
  top: 0;
  z-index: 400;
  background: var(--paper);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-stuck { box-shadow: 0 8px 30px rgba(22, 19, 14, 0.08); background: rgba(245, 241, 232, 0.94); backdrop-filter: blur(10px); }

.announce {
  background: var(--ink);
  color: var(--paper-2);
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.55rem 1rem;
  font-weight: 500;
}

.bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
  width: min(1280px, calc(100% - 3rem));
  margin-inline: auto;
}

.brand { display: flex; align-items: center; gap: 0.6rem; margin-right: auto; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-style: italic;
  transition: background 0.3s var(--ease);
}
.brand:hover .brand__mark { background: var(--accent); }
.brand__text {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.brand__dot { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  position: relative;
  padding: 0.4rem 0;
  color: var(--ink-soft);
  transition: color 0.2s var(--ease);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a.is-active::after { transform: scaleX(1); }
.nav a.is-active { color: var(--ink); }

.bar__actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }

.cart-count {
  position: absolute;
  top: 2px; right: 1px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.63rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.burger { display: none; flex-direction: column; gap: 4px; }
.burger span { display: block; width: 18px; height: 1.6px; background: var(--ink); transition: transform 0.3s var(--ease), opacity 0.2s var(--ease); }
.site-header.menu-open .burger span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.site-header.menu-open .burger span:nth-child(2) { opacity: 0; }
.site-header.menu-open .burger span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  padding: 1rem 1.5rem 2rem;
  gap: 0.25rem;
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
}
.mobile-menu a {
  padding: 0.9rem 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  border-bottom: 1px solid var(--line-soft);
}
.mobile-menu__cta { color: var(--accent); font-style: italic; }

/* ----------------------------------------------------------------- hero */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem);
}
.hero__copy { max-width: 40ch; }
.hero__title { margin: 1rem 0 1.5rem; }
.hero__title em { color: var(--accent); font-style: italic; }
.hero__cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

.hero__meta {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.hero__meta div strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.hero__meta div span { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.hero__art { position: relative; }
.hero__art img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.hero__art::after {
  content: '';
  position: absolute;
  inset: -14px -14px 22px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  z-index: -1;
}
.hero__tag {
  position: absolute;
  bottom: 1.5rem;
  left: -1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.6rem 1.1rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hero__tag .ico { width: 16px; height: 16px; color: var(--accent); }

/* -------------------------------------------------------------- marquesina */
.marquee {
  border-block: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
  padding: 0.9rem 0;
}
.marquee__track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  width: max-content;
  animation: slide 38s linear infinite;
}
.marquee span {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 3rem;
}
.marquee span::after { content: '✦'; color: var(--accent); font-size: 0.75rem; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ------------------------------------------------------------ categorías */
.cat-strip { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.chip {
  padding: 0.5rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  transition: all 0.22s var(--ease);
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------------------------------------------------------------- filtros */
.toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.toolbar__search {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.6rem 1.1rem;
  background: var(--paper-2);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.toolbar__search:focus-within { border-color: var(--ink); background: var(--paper); }
.toolbar__search .ico { width: 18px; height: 18px; color: var(--muted); }
.toolbar__search input { flex: 1; border: 0; background: none; outline: none; font-size: 0.9rem; }
.toolbar__search input::placeholder { color: var(--muted); }

.select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0.6rem 2.4rem 0.6rem 1.1rem;
  background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238b8171' stroke-width='1.6'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 1rem center;
  font-size: 0.82rem;
  cursor: pointer;
}
.select:focus { outline: none; border-color: var(--ink); }

.result-count { font-size: 0.8rem; color: var(--muted); margin-left: auto; }

/* ------------------------------------------------------- tarjeta producto */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem) clamp(0.75rem, 1.8vw, 1.5rem);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  animation: rise 0.5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--paper-3);
  aspect-ratio: 3 / 4;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.card:hover .card__media img { transform: scale(1.05); }

.card__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 19, 14, 0.28), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}
.card:hover .card__veil { opacity: 1; }

.card__badges { position: absolute; top: 0.75rem; left: 0.75rem; display: flex; flex-direction: column; gap: 0.35rem; z-index: 2; }
.card__badge {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink);
}
.card__badge--off { background: var(--accent); color: var(--accent-ink); }
.card__badge--out { background: var(--ink); color: var(--paper); }

.card__body { padding: 0.9rem 0.15rem 0; display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.card__cat { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.card__name { font-size: 1.06rem; font-weight: 500; font-family: var(--font-body); letter-spacing: -0.005em; }
.card__name a { transition: color 0.2s var(--ease); }
.card__name a:hover { color: var(--accent); }

.card__price { display: flex; align-items: baseline; gap: 0.5rem; margin-top: 0.35rem; }
.price { font-weight: 600; font-size: 0.98rem; }
.price--old { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 0.85rem; }

.card__add {
  margin-top: 0.75rem;
  padding: 0.6rem;
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.25s var(--ease);
}
.card__add:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.card__add:disabled { border-color: var(--line); color: var(--muted); cursor: not-allowed; }

/* ---------------------------------------------------------- ficha producto */
.pdp { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.pdp__media { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.pdp__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-md); }
.pdp__title { font-size: clamp(1.9rem, 4.5vw, 3.2rem); margin: 0.5rem 0 1rem; }
.pdp__price { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 1.5rem; }
.pdp__price .price { font-size: 1.6rem; }
.pdp__desc { color: var(--ink-soft); margin-bottom: 2rem; max-width: 50ch; }
.pdp__block { margin-bottom: 1.5rem; }
.pdp__block h4 { font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 0.7rem; }
.swatches { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.swatch {
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  transition: all 0.2s var(--ease);
}
.swatch:hover { border-color: var(--ink); }
.swatch.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pdp__buy { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }
.pdp__facts { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); display: grid; gap: 0.75rem; }
.pdp__facts div { display: flex; gap: 0.7rem; align-items: center; font-size: 0.86rem; color: var(--ink-soft); }
.pdp__facts .ico { width: 18px; height: 18px; color: var(--accent); }

.back-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }
.back-link:hover { color: var(--accent); }
.back-link .ico { width: 16px; height: 16px; transform: rotate(180deg); }

/* --------------------------------------------------------------- carrito */
.drawer { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.drawer.is-open { pointer-events: auto; }
.drawer__scrim {
  position: absolute; inset: 0;
  background: rgba(22, 19, 14, 0.45);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  backdrop-filter: blur(2px);
}
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer__panel {
  position: absolute;
  top: 0; right: 0;
  height: 100%;
  width: min(440px, 100%);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.42s var(--ease);
  box-shadow: var(--shadow-lg);
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.drawer__head h2 { font-size: 1.35rem; }
.drawer__body { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; }
.drawer__foot { padding: 1.25rem 1.5rem 1.75rem; border-top: 1px solid var(--line); display: grid; gap: 0.6rem; background: var(--paper-2); }

.cart-item { display: grid; grid-template-columns: 72px 1fr auto; gap: 0.9rem; padding-bottom: 1.1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line-soft); }
.cart-item:last-child { border-bottom: 0; margin-bottom: 0; }
.cart-item img { width: 72px; height: 92px; object-fit: cover; border-radius: var(--r-sm); }
.cart-item__info h3 { font-family: var(--font-body); font-size: 0.92rem; font-weight: 600; line-height: 1.3; }
.cart-item__meta { font-size: 0.76rem; color: var(--muted); margin-top: 0.15rem; }
.cart-item__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.6rem; }
.cart-item__price { font-weight: 600; font-size: 0.9rem; }
.cart-item__del { color: var(--muted); align-self: flex-start; padding: 0.2rem; }
.cart-item__del:hover { color: var(--accent); }
.cart-item__del .ico { width: 17px; height: 17px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-pill); overflow: hidden; }
.stepper button { width: 30px; height: 30px; display: grid; place-items: center; font-size: 1rem; transition: background 0.2s var(--ease); }
.stepper button:hover { background: var(--paper-3); }
.stepper input { width: 34px; border: 0; text-align: center; background: none; outline: none; font-size: 0.85rem; font-weight: 600; }

.cart-empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); display: grid; gap: 1rem; justify-items: center; }
.cart-empty .ico { width: 44px; height: 44px; color: var(--line); }

.totals { display: grid; gap: 0.5rem; margin-bottom: 0.75rem; }
.totals__row { display: flex; justify-content: space-between; font-size: 0.88rem; color: var(--ink-soft); }
.totals__row--grand { padding-top: 0.6rem; margin-top: 0.2rem; border-top: 1px solid var(--line); font-size: 1.05rem; color: var(--ink); }
.totals__row--grand strong { font-family: var(--font-display); font-size: 1.35rem; }

/* -------------------------------------------------------------- avisos */
.toast-host { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 1200; display: grid; gap: 0.5rem; width: max-content; max-width: calc(100% - 2rem); }
.toast {
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--ink); color: var(--paper);
  padding: 0.8rem 1.3rem;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
.toast__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex: none; }
.toast--warn .toast__dot { background: var(--gold); }

/* -------------------------------------------------------------- checkout */
.checkout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2.25rem); }
.panel--plain { background: transparent; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.7rem 0.9rem;
  background: var(--paper);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  font-size: 0.92rem;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(196, 67, 42, 0.1); }
.field textarea { resize: vertical; min-height: 88px; }
.field__hint { font-size: 0.74rem; color: var(--muted); }
.field__error { font-size: 0.74rem; color: var(--accent); }

/* Imagen del hero en Ajustes: botones de carga y vista previa. */
.hero-upload { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.hero-upload .btn { display: inline-flex; align-items: center; gap: 0.4rem; }
[data-hero-preview] img { width: 100%; max-width: 420px; display: block; }

.summary-line { display: flex; gap: 0.85rem; padding-bottom: 0.9rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--line-soft); }
.summary-line img { width: 54px; height: 68px; object-fit: cover; border-radius: var(--r-sm); }
.summary-line h4 { font-family: var(--font-body); font-size: 0.88rem; font-weight: 600; }
.summary-line p { font-size: 0.76rem; color: var(--muted); }

.confirm { text-align: center; padding: clamp(2.5rem, 6vw, 5rem) 0; display: grid; gap: 1rem; justify-items: center; }
.confirm__mark { width: 68px; height: 68px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.confirm__mark .ico { width: 32px; height: 32px; }

/* --------------------------------------------------------------- valores */
.values { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.value { background: var(--paper); padding: 1.75rem 1.5rem; display: grid; gap: 0.5rem; }
.value .ico { width: 26px; height: 26px; color: var(--accent); }
.value h3 { font-family: var(--font-body); font-size: 0.95rem; font-weight: 600; }
.value p { font-size: 0.85rem; color: var(--muted); }

/* -------------------------------------------------------------- nosotros */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.split img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r-lg); }
.split__text h2 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: 1.25rem; }
.split__text p + p { margin-top: 1rem; }
.split__text p { color: var(--ink-soft); }

/* -------------------------------------------------------------- boletín */
.newsletter { background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: clamp(2rem, 5vw, 3.5rem); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.newsletter h2 { color: var(--paper); font-size: clamp(1.6rem, 3.5vw, 2.6rem); }
.newsletter p { color: rgba(245, 241, 232, 0.68); margin-top: 0.6rem; }
.newsletter form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.newsletter input {
  flex: 1 1 200px;
  background: rgba(245, 241, 232, 0.08);
  border: 1px solid rgba(245, 241, 232, 0.22);
  border-radius: var(--r-pill);
  padding: 0.85rem 1.2rem;
  color: var(--paper);
  outline: none;
}
.newsletter input::placeholder { color: rgba(245, 241, 232, 0.45); }
.newsletter input:focus { border-color: var(--accent-2); }

/* -------------------------------------------------------------- pie */
.site-footer { border-top: 1px solid var(--line); padding: 3.5rem 0 2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 2.5rem; }
.footer-grid h4 { font-family: var(--font-body); font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; font-weight: 600; }
.footer-grid a, .footer-grid li { display: block; font-size: 0.88rem; color: var(--ink-soft); padding: 0.28rem 0; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand p { color: var(--muted); font-size: 0.88rem; max-width: 34ch; margin-top: 0.9rem; }
.footer-bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); }

/* -------------------------------------------------------------- estados */
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); font-size: 0.95rem; }
.skeleton { background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================================================================== */
/*  PANEL DE ADMINISTRACIÓN                                             */
/* ==================================================================== */

.admin-body { background: var(--paper-2); }

.admin-shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }

.admin-side {
  background: var(--ink);
  color: var(--paper-2);
  padding: 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-side .brand { color: var(--paper); margin: 0 0 1.75rem; padding: 0 0.5rem; }
.admin-side .brand__mark { background: var(--accent); }
.admin-side__label { font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(245, 241, 232, 0.4); padding: 0.9rem 0.6rem 0.4rem; }
.admin-nav { display: grid; gap: 0.15rem; }
.admin-nav button {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.72rem 0.9rem;
  border-radius: var(--r-md);
  font-size: 0.87rem;
  color: rgba(245, 241, 232, 0.72);
  text-align: left;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  width: 100%;
}
.admin-nav button:hover { background: rgba(245, 241, 232, 0.08); color: var(--paper); }
.admin-nav button.is-active { background: var(--accent); color: var(--accent-ink); }
.admin-nav .ico { width: 18px; height: 18px; }
.admin-nav__badge { margin-left: auto; font-size: 0.66rem; background: rgba(245, 241, 232, 0.16); padding: 0.1rem 0.45rem; border-radius: var(--r-pill); }
.admin-nav button.is-active .admin-nav__badge { background: rgba(255, 246, 241, 0.24); }
.admin-side__foot { margin-top: auto; display: grid; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid rgba(245, 241, 232, 0.12); }
.admin-side__foot a, .admin-side__foot button { font-size: 0.82rem; color: rgba(245, 241, 232, 0.66); display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: var(--r-sm); width: 100%; text-align: left; }
.admin-side__foot a:hover, .admin-side__foot button:hover { color: var(--paper); background: rgba(245, 241, 232, 0.08); }
.admin-side__user { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.6rem; font-size: 0.8rem; color: rgba(245, 241, 232, 0.55); }
.admin-side__user span { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.admin-main { padding: clamp(1.25rem, 3vw, 2.5rem); max-width: 1400px; width: 100%; }
.admin-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.admin-top h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.admin-top p { color: var(--muted); font-size: 0.88rem; margin-top: 0.35rem; }
.admin-top__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.admin-mobile-bar { display: none; }

/* --- métricas --- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.metric {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 0.35rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.metric:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.metric::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.metric__label { font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.metric__value { font-family: var(--font-display); font-size: 1.95rem; font-weight: 600; letter-spacing: -0.02em; }
.metric__foot { font-size: 0.76rem; color: var(--muted); }
.metric--warn::before { background: var(--gold); }
.metric--ok::before { background: var(--ok); }

/* --- tarjeta / tabla --- */
.card-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1.5rem; }
.card-block__head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-block__head h2 { font-size: 1.15rem; }
.card-block__body { padding: 1.4rem; }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
th {
  text-align: left;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
  white-space: nowrap;
}
td { padding: 0.85rem 1.4rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover { background: var(--paper-2); }
tbody tr:last-child td { border-bottom: 0; }

.cell-product { display: flex; align-items: center; gap: 0.8rem; min-width: 220px; }
.cell-product img { width: 44px; height: 56px; object-fit: cover; border-radius: var(--r-sm); flex: none; }
.cell-product strong { font-weight: 600; font-size: 0.9rem; display: block; }
.cell-product span { font-size: 0.74rem; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pill--ok { background: rgba(47, 107, 70, 0.12); color: var(--ok); }
.pill--warn { background: rgba(168, 129, 63, 0.16); color: #8a6a2e; }
.pill--bad { background: rgba(196, 67, 42, 0.12); color: var(--accent); }
.pill--info { background: rgba(22, 19, 14, 0.08); color: var(--ink-soft); }

.row-actions { display: flex; gap: 0.35rem; justify-content: flex-end; }
.row-actions button {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--muted);
  transition: all 0.2s var(--ease);
}
.row-actions button:hover { background: var(--paper-3); color: var(--ink); }
.row-actions button.is-danger:hover { background: rgba(196, 67, 42, 0.12); color: var(--accent); }
.row-actions .ico { width: 16px; height: 16px; }

.admin-toolbar { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }
.admin-toolbar .toolbar__search { flex: 1 1 260px; }

/* --- modal --- */
.modal { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 1.5rem; pointer-events: none; }
.modal.is-open { pointer-events: auto; }
.modal__scrim { position: absolute; inset: 0; background: rgba(22, 19, 14, 0.5); opacity: 0; transition: opacity 0.3s var(--ease); backdrop-filter: blur(3px); }
.modal.is-open .modal__scrim { opacity: 1; }
.modal__box {
  position: relative;
  background: var(--paper);
  border-radius: var(--r-lg);
  width: min(760px, 100%);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.modal.is-open .modal__box { opacity: 1; transform: none; }
.modal__head { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal__head h2 { font-size: 1.3rem; }
.modal__body { padding: 1.5rem; overflow-y: auto; }
.modal__foot { padding: 1.1rem 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 0.6rem; background: var(--paper-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.tag-input { display: flex; flex-wrap: wrap; gap: 0.4rem; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.5rem; background: var(--paper); min-height: 46px; }
.tag-input input { flex: 1 1 90px; border: 0; background: none; outline: none; padding: 0.35rem; font-size: 0.9rem; }
.tag { display: inline-flex; align-items: center; gap: 0.35rem; background: var(--paper-3); border-radius: var(--r-pill); padding: 0.28rem 0.35rem 0.28rem 0.7rem; font-size: 0.8rem; }
.tag button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--muted); }
.tag button:hover { background: var(--line); color: var(--ink); }
.tag .ico { width: 12px; height: 12px; }

.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.85rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--line); position: relative; transition: background 0.25s var(--ease); flex: none; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--paper); transition: transform 0.25s var(--ease); box-shadow: var(--shadow-sm); }
.switch input:checked + .switch__track { background: var(--ok); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }

/* --- acceso --- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; position: relative; overflow: hidden; }
.login-wrap::before {
  content: '';
  position: absolute;
  width: 620px; height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 67, 42, 0.16), transparent 68%);
  top: -220px; right: -160px;
}
.login-card {
  position: relative;
  width: min(420px, 100%);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-lg);
}
.login-card .brand { margin-bottom: 1.75rem; }
.login-card h1 { font-size: 1.8rem; margin-bottom: 0.4rem; }
.login-card > p { color: var(--muted); font-size: 0.88rem; margin-bottom: 1.75rem; }
.login-hint { margin-top: 1.5rem; padding: 0.85rem 1rem; background: var(--paper-2); border: 1px dashed var(--line); border-radius: var(--r-md); font-size: 0.78rem; color: var(--muted); }
.login-hint code { background: var(--paper-3); padding: 0.1rem 0.35rem; border-radius: 4px; font-size: 0.78rem; color: var(--ink); }

.admin-view { display: none; animation: rise 0.4s var(--ease) both; }
.admin-view.is-active { display: block; }

.mini-chart { display: flex; align-items: flex-end; gap: 0.5rem; height: 150px; padding-top: 1rem; }
.mini-chart div { flex: 1; background: var(--paper-3); border-radius: var(--r-sm) var(--r-sm) 0 0; position: relative; transition: background 0.25s var(--ease); min-height: 4px; }
.mini-chart div:hover { background: var(--accent); }
.mini-chart div span { position: absolute; bottom: -1.5rem; left: 50%; transform: translateX(-50%); font-size: 0.62rem; color: var(--muted); white-space: nowrap; }

.order-detail__items { display: grid; gap: 0.75rem; margin: 1rem 0; }
.order-detail__items div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.86rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line-soft); }

/* ------------------------------------------------------- responsivo */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero__art { order: -1; max-width: 520px; }
  .hero__tag { left: 1rem; }
  .pdp, .checkout, .split, .newsletter { grid-template-columns: 1fr; }
  .pdp__media { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: fixed; inset: 0 auto 0 0;
    width: 262px; z-index: 800;
    transform: translateX(-100%);
    transition: transform 0.35s var(--ease);
  }
  .admin-side.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .admin-mobile-bar {
    display: flex; align-items: center; gap: 0.75rem;
    position: sticky; top: 0; z-index: 700;
    background: var(--ink); color: var(--paper);
    padding: 0.7rem 1rem;
    margin: -1.25rem -1.25rem 1.25rem;
  }
  .admin-mobile-bar .brand__text { font-size: 1.05rem; }
  .admin-mobile-bar .icon-btn:hover { background: rgba(245, 241, 232, 0.12); }
  .admin-mobile-bar .icon-btn { color: var(--paper); }
}

@media (max-width: 820px) {
  .nav { display: none; }
  .burger { display: flex; }
  .site-header.menu-open .mobile-menu { display: flex; }
  /* Tablets: columnas automáticas a partir de 190px (3-4 por fila). */
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.25rem 0.85rem; }
  .card__name { font-size: 0.95rem; }
  .card__add { padding: 0.5rem; font-size: 0.68rem; }
  .form-grid { grid-template-columns: 1fr; }
  .values { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .wrap, .wrap--narrow, .bar { width: calc(100% - 2rem); }
  .hero__meta { gap: 1.5rem; }
  .drawer__panel { width: 100%; }
  .admin-main { padding: 1.25rem; }
  .admin-mobile-bar { margin: -1.25rem -1.25rem 1.25rem; }
  th, td { padding-inline: 1rem; }
  .card-block__body { padding: 1rem; }
}

@media (max-width: 600px) {
  /* Teléfonos: dos columnas fijas, como en Mercado Libre. Con auto-fill el
     ancho mínimo (190px) hacía que en pantallas de 360px o menos cupiera una
     sola columna. */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem 0.65rem; }
  .card__body { padding: 0.7rem 0.1rem 0; gap: 0.15rem; }
  .card__cat { font-size: 0.6rem; letter-spacing: 0.1em; }
  .card__name { font-size: 0.86rem; line-height: 1.25; }
  .card__price { margin-top: 0.25rem; gap: 0.35rem; flex-wrap: wrap; }
  .price { font-size: 0.9rem; }
  .price--old { font-size: 0.76rem; }
  .card__add { margin-top: 0.55rem; padding: 0.5rem 0.4rem; font-size: 0.64rem; letter-spacing: 0.06em; }
  .card__badges { top: 0.5rem; left: 0.5rem; gap: 0.25rem; }
  .card__badge { font-size: 0.55rem; padding: 0.22rem 0.45rem; letter-spacing: 0.06em; }
}

@media (max-width: 520px) {
  .values { grid-template-columns: 1fr; }
  .metric__value { font-size: 1.6rem; }
  .bar__actions { gap: 0; }
  .icon-btn { width: 38px; height: 38px; }
  .cart-item { grid-template-columns: 62px 1fr auto; }
  .cart-item img { width: 62px; height: 80px; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------------- impresión */
@media print {
  .site-header, .drawer, .toast-host, .admin-side, .admin-mobile-bar, .btn { display: none !important; }
  body { background: #fff; }
}
