/* ==================================================================
   OYEPANA — Sistema de diseño
   Dos temas sobre los mismos tokens: "Mercado nocturno" (oscuro)
   y "Mercado de día" (claro). El tema se controla con
   <html data-theme="dark|light">.
   ================================================================== */

/* ---------- 1. TOKENS · TEMA OSCURO (por defecto) ---------- */
:root,
:root[data-theme="dark"] {
  --bg:            #0C0A12;
  --bg-1:          #120E1C;
  --bg-2:          #17122A;
  --bg-3:          #1F1832;
  --bg-sunken:     #090711;
  --border:        rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text:          #F6F3FF;
  --text-muted:    #A79FC0;
  --text-dim:      #756C90;

  --brand:         #FFC93C;
  --brand-strong:  #E8A317;
  --brand-on:      #14101E;
  --brand-text:    #FFC93C;
  --brand-soft:    rgba(255, 201, 60, .12);
  --brand-line:    rgba(255, 201, 60, .34);

  --accent:        #17C3B2;
  --accent-text:   #17C3B2;
  --accent-soft:   rgba(23, 195, 178, .12);
  --danger:        #FF4D6D;
  --danger-text:   #FF8098;
  --danger-soft:   rgba(255, 77, 109, .12);
  --ok:            #2FBF71;
  --ok-soft:       rgba(47, 191, 113, .12);

  /* Vitrina de producto: superficie clara incluso en tema oscuro.
     En fondo negro los aretes y pulseras se apagan; en claro se venden. */
  --shop-surface:      #FBF8F2;
  --shop-surface-2:    #F3EDE2;
  --shop-line:         rgba(20, 16, 30, .09);
  --on-shop:           #191320;
  --on-shop-muted:     #6B6280;
  --on-shop-dim:       #9A90A6;

  --shadow:        0 18px 44px rgba(0, 0, 0, .48);
  --shadow-sm:     0 6px 18px rgba(0, 0, 0, .34);
  --header-bg:     rgba(12, 10, 18, .84);
  --header-line:   rgba(255, 255, 255, .07);
  --skeleton:      linear-gradient(90deg, #17122A 25%, #221A38 50%, #17122A 75%);
  color-scheme: dark;
}

/* ---------- 2. TOKENS · TEMA CLARO ---------- */
:root[data-theme="light"] {
  --bg:            #FAF7F2;
  --bg-1:          #FFFFFF;
  --bg-2:          #FFFFFF;
  --bg-3:          #F1EBE1;
  --bg-sunken:     #EFE8DC;
  --border:        rgba(25, 19, 32, .10);
  --border-strong: rgba(25, 19, 32, .20);
  --text:          #191320;
  --text-muted:    #6B6280;
  --text-dim:      #8B8199;

  --brand:         #F5B82E;
  --brand-strong:  #D99A0F;
  --brand-on:      #241A05;
  --brand-text:    #8A6410;
  --brand-soft:    rgba(245, 184, 46, .16);
  --brand-line:    rgba(217, 154, 15, .40);

  --accent:        #0E9E8F;
  --accent-text:   #0B8175;
  --accent-soft:   rgba(14, 158, 143, .12);
  --danger:        #D6304F;
  --danger-text:   #B82440;
  --danger-soft:   rgba(214, 48, 79, .10);
  --ok:            #1F9D5B;
  --ok-soft:       rgba(31, 157, 91, .12);

  --shop-surface:      #FFFFFF;
  --shop-surface-2:    #F7F2EA;
  --shop-line:         rgba(25, 19, 32, .10);
  --on-shop:           #191320;
  --on-shop-muted:     #6B6280;
  --on-shop-dim:       #8B8199;

  --shadow:        0 16px 40px rgba(25, 19, 32, .12);
  --shadow-sm:     0 5px 16px rgba(25, 19, 32, .08);
  --header-bg:     rgba(250, 247, 242, .87);
  --header-line:   rgba(25, 19, 32, .09);
  --skeleton:      linear-gradient(90deg, #F1EBE1 25%, #E7DECF 50%, #F1EBE1 75%);
  color-scheme: light;
}

/* ---------- 3. RESET ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .28s ease, color .28s ease;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--brand); color: var(--brand-on); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-sunken); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; border: 2px solid var(--bg-sunken); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-strong); }

/* ---------- 4. TIPOGRAFÍA ---------- */
:root {
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.14; letter-spacing: -.02em; }

.t-display { font-family: var(--font-display); font-size: clamp(34px, 8vw, 62px); font-weight: 900; line-height: 1.04; letter-spacing: -.035em; }
.t-h1 { font-size: clamp(28px, 5.4vw, 44px); }
.t-h2 { font-size: clamp(24px, 4.4vw, 34px); }
.t-h3 { font-size: clamp(19px, 2.6vw, 23px); }
.t-h4 { font-size: 17px; font-weight: 700; }

.t-body  { font-size: 16px; }
.t-sm    { font-size: 14.5px; }
.t-xs    { font-size: 13px; }
.muted   { color: var(--text-muted); }
.dim     { color: var(--text-dim); }
.eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-text); }
.center  { text-align: center; }
.serif   { font-family: var(--font-display); }

/* ---------- 5. LAYOUT ---------- */
.wrap        { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 18px; }
.wrap-page   { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 18px; }
.wrap-narrow { width: 100%; max-width: 860px;  margin-inline: auto; padding-inline: 18px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.row     { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 10px; }
.grow    { flex: 1; }
.hide    { display: none !important; }
.section { padding-block: clamp(40px, 7vw, 74px); }
.section-alt { background: var(--bg-1); }

.grid-auto { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* ---------- 6. BOTONES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 11px 22px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 650; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: transform .18s cubic-bezier(.16,1,.3,1), background-color .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn:active { transform: scale(.975); }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

.btn-primary { background: var(--brand); color: var(--brand-on); box-shadow: 0 6px 18px rgba(255, 201, 60, .22); }
.btn-primary:hover { background: var(--brand-strong); }

.btn-solid { background: var(--text); color: var(--bg); }
.btn-solid:hover { opacity: .88; }

.btn-outline { border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--brand-line); color: var(--brand-text); background: var(--brand-soft); }

.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-3); }

.btn-danger { border-color: var(--danger); color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-soft); }

.btn-sm { min-height: 38px; padding: 8px 15px; font-size: 13.5px; }
.btn-lg { min-height: 54px; padding: 15px 30px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; }

/* ---------- 7. HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--header-line);
  transition: background-color .28s ease;
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 62px; }

.logo { display: inline-flex; align-items: baseline; gap: 1px; font-family: var(--font-display); font-size: 21px; font-weight: 900; letter-spacing: -.03em; }
.logo span { color: var(--brand-text); }
.logo small { display: block; font-family: var(--font-body); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim); }

.main-nav { display: none; gap: 4px; margin-left: 14px; }
.main-nav a {
  padding: 9px 13px; border-radius: 999px;
  font-size: 14.5px; font-weight: 550; color: var(--text-muted);
  transition: color .18s, background-color .18s;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--bg-3); }
.main-nav a.active { color: var(--brand-text); }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Buscador */
.search-toggle, .icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  color: var(--text-muted);
  transition: color .18s, background-color .18s;
}
.icon-btn:hover { color: var(--text); background: var(--bg-3); }
.icon-btn svg { width: 21px; height: 21px; }

.badge-count {
  position: absolute; top: 3px; right: 2px;
  min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
  border-radius: 999px; border: 2px solid var(--bg);
}
.badge-count:empty, .badge-count.is-empty { display: none; }

/* Toggle de tema */
.theme-toggle {
  position: relative;
  width: 62px; height: 34px; flex: 0 0 auto;
  border: 1px solid var(--border-strong);
  background: var(--bg-3);
  border-radius: 999px;
  transition: background-color .25s, border-color .25s;
}
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand);
  display: grid; place-items: center;
  font-size: 14px; line-height: 1;
  color: var(--brand-on);
  transition: transform .32s cubic-bezier(.34,1.56,.64,1);
}
:root[data-theme="light"] .theme-toggle .knob { transform: translateX(28px); }
.theme-toggle .i-sun, .theme-toggle .i-moon { position: absolute; transition: opacity .2s, transform .3s; }
.theme-toggle .i-moon { opacity: 1; }
.theme-toggle .i-sun  { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="light"] .theme-toggle .i-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
:root[data-theme="light"] .theme-toggle .i-sun  { opacity: 1; transform: none; }

/* Barra de búsqueda desplegable */
.search-panel {
  border-top: 1px solid var(--header-line);
  background: var(--bg-1);
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
}
.search-panel.open { max-height: 380px; }
.search-panel-inner { padding: 14px 0 18px; }
.search-input-wrap { position: relative; }
.search-input {
  width: 100%; min-height: 48px;
  padding: 12px 46px 12px 46px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 16px;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus { outline: none; border-color: var(--brand-line); background: var(--bg-2); }
.search-input-wrap > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--text-dim); pointer-events: none; }
.search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--text-dim); }
.search-clear:hover { color: var(--text); background: var(--bg-2); }

.search-results { margin-top: 12px; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.search-result { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; }
.search-result:hover { background: var(--bg-3); }
.search-result img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.search-result .nm { font-size: 14.5px; font-weight: 600; }
.search-result .pr { font-size: 13.5px; font-weight: 700; color: var(--brand-text); }

/* ---------- 8. BOTTOM NAV (móvil) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 22px rgba(0, 0, 0, .14);
  padding-bottom: env(safe-area-inset-bottom, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
.bottom-nav a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 2px 9px;
  font-size: 10.5px; font-weight: 650; letter-spacing: .01em;
  color: var(--text-dim);
  transition: color .18s;
  min-height: 56px;
}
.bottom-nav a svg { width: 22px; height: 22px; transition: transform .2s cubic-bezier(.16,1,.3,1); }
.bottom-nav a.active { color: var(--brand-text); font-weight: 750; }
.bottom-nav a.active svg { transform: translateY(-1px); }
.bottom-nav .badge-count { top: 4px; right: 50%; margin-right: -20px; }

/* Reserva el alto de la barra inferior, incluido el área segura del iPhone,
   para que ningún contenido quede tapado al final de la página. */
body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

/* ---------- 9. TARJETAS / SUPERFICIES ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}
.card-flat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 16px; }
.card-pad-sm { padding: 15px; }

/* ---------- 10. VITRINA DE PRODUCTO (superficie clara) ---------- */
.shop-surface {
  background: var(--shop-surface);
  color: var(--on-shop);
  border-radius: 24px;
  padding: clamp(16px, 3vw, 28px);
  transition: background-color .28s ease, color .28s ease;
}
.shop-title { color: var(--on-shop); }
.shop-muted { color: var(--on-shop-muted); }

.product-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.product-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.p-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--shop-surface);
  border: 1px solid var(--shop-line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s;
}
.p-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(20, 16, 30, .16); border-color: rgba(217, 154, 15, .34); }

.p-media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: var(--shop-surface-2); }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.16,1,.3,1); }
.p-card:hover .p-media img { transform: scale(1.06); }

.p-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; z-index: 2; }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: 7px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  background: var(--on-shop); color: #fff;
}
.tag-new   { background: var(--accent); color: #04211F; }
.tag-sale  { background: var(--danger); color: #fff; }
.tag-custom{ background: var(--brand); color: var(--brand-on); }
.tag-out   { background: #6B6280; color: #fff; }

.p-fav {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: #4A4360;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
  transition: transform .2s, color .2s;
}
.p-fav:hover { transform: scale(1.1); }
.p-fav.on { color: var(--danger); }
.p-fav svg { width: 17px; height: 17px; }

.p-body { display: flex; flex-direction: column; flex: 1; padding: 12px 13px 14px; }
.p-origin { font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--brand-text); }
.p-name { margin-top: 5px; font-family: var(--font-display); font-size: 15.5px; font-weight: 700; line-height: 1.24; color: var(--on-shop); }
.p-meta { margin-top: 4px; font-size: 12px; color: var(--on-shop-dim); }
.p-price-row { display: flex; align-items: baseline; gap: 7px; margin-top: auto; padding-top: 11px; }
.p-price { font-size: 18px; font-weight: 800; color: var(--on-shop); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.p-compare { font-size: 13px; font-weight: 500; color: var(--on-shop-dim); text-decoration: line-through; }
.p-off { font-size: 11.5px; font-weight: 800; color: var(--danger); }

.p-add {
  margin-top: 11px; width: 100%; min-height: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--on-shop); color: var(--brand);
  border-radius: 999px;
  font-size: 13.5px; font-weight: 700;
  transition: background-color .2s, transform .18s;
}
.p-add:hover { background: #000; }
.p-add:active { transform: scale(.97); }
.p-add svg { width: 16px; height: 16px; }
.p-add.is-out { background: var(--shop-surface-2); color: var(--on-shop-dim); pointer-events: none; }

/* ---------- 11. CHIPS / FILTROS ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 9px 15px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  transition: all .2s; white-space: nowrap;
}
.chip:hover { border-color: var(--brand-line); color: var(--text); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-on); font-weight: 750; }

/* ---------- 12. HERO ---------- */
.hero { position: relative; padding-block: clamp(34px, 6vw, 62px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(620px 340px at 84% -12%, var(--brand-soft), transparent 66%),
    radial-gradient(500px 320px at 4% 8%, var(--accent-soft), transparent 64%);
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(32px, 8.4vw, 64px); font-weight: 900; letter-spacing: -.035em; line-height: 1.03; }
.hero h1 em { font-style: normal; color: var(--brand-text); }
.hero-sub { margin-top: 14px; max-width: 46ch; color: var(--text-muted); font-size: clamp(15.5px, 2.6vw, 18px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-1);
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
}
.pill b { color: var(--text); font-weight: 700; }

/* ---------- 13. SECCIONES DE CATEGORÍA ---------- */
.cat-card {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 132px; padding: 14px;
  border-radius: 16px; border: 1px solid var(--border);
  background: linear-gradient(150deg, var(--bg-3), var(--bg-2));
  overflow: hidden;
  transition: transform .28s cubic-bezier(.16,1,.3,1), border-color .28s;
}
.cat-card:hover { transform: translateY(-3px); border-color: var(--brand-line); }
.cat-card .ico { position: absolute; top: 12px; right: 13px; font-size: 22px; opacity: .5; }
.cat-card .nm { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.cat-card .ct { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---------- 14. DETALLE DE PRODUCTO ---------- */
.gallery { position: relative; border-radius: 20px; overflow: hidden; background: var(--shop-surface-2); }
.gallery-main { aspect-ratio: 1 / 1; width: 100%; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs button { flex: 0 0 62px; height: 62px; border-radius: 11px; overflow: hidden; border: 2px solid transparent; }
.gallery-thumbs button.on { border-color: var(--brand); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.buy-panel { position: sticky; bottom: 0; }
.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-now { font-family: var(--font-display); font-size: clamp(28px, 6vw, 36px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.price-was { font-size: 17px; color: var(--text-dim); text-decoration: line-through; }
.price-off { font-size: 13px; font-weight: 800; color: var(--danger-text); background: var(--danger-soft); padding: 3px 9px; border-radius: 7px; }

.spec-list { display: grid; gap: 0; }
.spec-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.spec-row:last-child { border-bottom: 0; }
.spec-row dt { color: var(--text-dim); }
.spec-row dd { font-weight: 600; text-align: right; }

.qty {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden;
}
.qty button { width: 44px; height: 46px; display: grid; place-items: center; font-size: 19px; font-weight: 600; color: var(--text-muted); transition: background-color .18s, color .18s; }
.qty button:hover { background: var(--bg-3); color: var(--text); }
.qty input {
  width: 48px; height: 46px; text-align: center; border: 0; background: transparent;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Barra de compra fija en móvil */
.sticky-buy {
  position: fixed; left: 0; right: 0; bottom: 72px; z-index: 55;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  transform: translateY(130%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
}
.sticky-buy.show { transform: none; }
.sticky-buy .sb-price { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sticky-buy .sb-name { font-size: 11.5px; color: var(--text-dim); max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 15. FORMULARIOS ---------- */
.field { display: block; }
.field + .field { margin-top: 15px; }
.label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 650; color: var(--text-muted); }
.input, .select, .textarea {
  width: 100%; min-height: 48px;
  padding: 12px 15px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  font-size: 16px;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.textarea { min-height: 104px; resize: vertical; line-height: 1.55; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--bg-1); }
.input.is-error, .select.is-error { border-color: var(--danger); }
.hint { margin-top: 6px; font-size: 12.5px; color: var(--text-dim); }
.error-text { margin-top: 6px; font-size: 12.5px; color: var(--danger-text); font-weight: 600; }

.field-row { display: grid; gap: 15px; }
@media (min-width: 620px) { .field-row.two { grid-template-columns: 1fr 1fr; } }

.checkline { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 14.5px; color: var(--text-muted); }
.checkline input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }

/* ---------- 16. MÉTODOS DE PAGO ---------- */
.pay-methods { display: grid; gap: 11px; }
.pay-option {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 15px; border-radius: 15px;
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.pay-option:hover { border-color: var(--border-strong); }
.pay-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 6px 20px rgba(255, 201, 60, .13); }
.pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.pay-option.is-disabled { opacity: .48; pointer-events: none; }
.pay-mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 15px; font-weight: 800; flex: 0 0 auto; }
.mk-tilopay { background: linear-gradient(140deg, #00C2A8, #00796B); color: #fff; }
.mk-yappy   { background: #F7C600; color: #1A1A1A; }
.mk-paypal  { background: #003087; color: #fff; }
.mk-cod     { background: var(--brand-soft); color: var(--brand-text); border: 1px solid var(--brand-line); }
.pay-name { font-size: 15px; font-weight: 650; }
.pay-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.pay-radio { margin-left: auto; width: 21px; height: 21px; border-radius: 50%; border: 2px solid var(--border-strong); flex: 0 0 auto; position: relative; transition: border-color .2s; }
.pay-option:has(input:checked) .pay-radio { border-color: var(--brand); }
.pay-option:has(input:checked) .pay-radio::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--brand); }

/* ---------- 17. PASOS DE CHECKOUT ---------- */
.steps { display: flex; align-items: center; gap: 6px; margin-bottom: 26px; }
.step { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.step-dot { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: var(--bg-3); color: var(--text-dim); flex: 0 0 auto; }
.step.on .step-dot { background: var(--brand); color: var(--brand-on); }
.step.done .step-dot { background: var(--ok); color: #fff; }
.step-label { font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.on .step-label { color: var(--text); }
.step-bar { flex: 1; height: 2px; background: var(--border); border-radius: 2px; min-width: 8px; }
.step-bar.done { background: var(--ok); }

/* ---------- 18. RESUMEN / TOTALES ---------- */
.summary { background: var(--bg-2); border: 1px solid var(--border); border-radius: 17px; padding: 18px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--text-muted); }
.sum-row + .sum-row { margin-top: 9px; }
.sum-row.total { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 18px; font-weight: 800; color: var(--text); }
.sum-row.total .amt { color: var(--brand-text); font-variant-numeric: tabular-nums; }

/* ---------- 19. LISTA DE CARRITO ---------- */
.cart-line { display: grid; grid-template-columns: 74px 1fr auto; gap: 13px; align-items: start; padding: 15px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 74px; height: 74px; border-radius: 13px; object-fit: cover; background: var(--bg-3); }
.cart-line .nm { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.cart-line .pr { font-size: 15px; font-weight: 800; color: var(--brand-text); margin-top: 5px; font-variant-numeric: tabular-nums; }
.cart-line .note { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; }
.cart-line .rm { font-size: 12.5px; color: var(--text-dim); text-decoration: underline; margin-top: 8px; }
.cart-line .rm:hover { color: var(--danger-text); }

/* ---------- 20. ALERTAS / TOAST ---------- */
.alerts { position: fixed; top: 74px; left: 50%; transform: translateX(-50%); z-index: 90; width: calc(100% - 32px); max-width: 430px; display: grid; gap: 8px; }
.alert {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 14.5px; font-weight: 550;
  animation: alertIn .34s cubic-bezier(.16,1,.3,1);
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.alert-success { border-color: rgba(47,191,113,.42); background: var(--ok-soft); }
.alert-error   { border-color: rgba(214,48,79,.42);  background: var(--danger-soft); }
.alert-info    { border-color: var(--brand-line);    background: var(--brand-soft); }
.alert .x { margin-left: auto; opacity: .6; }
.alert .x:hover { opacity: 1; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 22px);
  z-index: 95; padding: 13px 20px; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 650;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .3s cubic-bezier(.16,1,.3,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 21. ESTADOS VACÍOS ---------- */
.empty { text-align: center; padding: 54px 20px; }
.empty .em-ico { font-size: 44px; opacity: .3; margin-bottom: 14px; }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--text-muted); font-size: 14.5px; max-width: 34ch; margin: 0 auto 20px; }

/* ---------- 22. FOOTER ---------- */
.site-footer { margin-top: 40px; padding: 44px 0 30px; background: var(--bg-1); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 26px; }
.footer-brand .logo { font-size: 25px; }
.footer-brand p { margin-top: 10px; font-size: 14px; color: var(--text-muted); max-width: 34ch; }
.footer-col h4 { font-family: var(--font-body); font-size: 12px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.footer-col a { display: block; padding: 5px 0; font-size: 14.5px; color: var(--text-muted); }
.footer-col a:hover { color: var(--brand-text); }
.footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 13px; color: var(--text-dim); }

@media (min-width: 760px) {
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
}

/* ---------- 23. UTILIDADES RESPONSIVE ---------- */
.only-mobile { display: block; }
.only-desktop { display: none; }

@media (min-width: 900px) {
  .wrap, .wrap-narrow { padding-inline: 28px; }
  .main-nav { display: flex; }
  .bottom-nav { display: none; }
  body { padding-bottom: 0; }
  .product-grid { gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .only-mobile { display: none; }
  .only-desktop { display: block; }
  .header-inner { height: 72px; }
  .sticky-buy { display: none; }
}

@media (min-width: 1200px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 24. ANIMACIONES DE ENTRADA ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s cubic-bezier(.16,1,.3,1), transform .55s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }

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

/* ---------- 25. SKELETON ---------- */
.skeleton { background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; border-radius: 12px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 26. VARIANTES / PERSONALIZACIÓN ---------- */
.opt-group { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 9px 15px; border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  transition: all .2s;
}
.opt:hover { border-color: var(--border-strong); color: var(--text); }
.opt.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-text); font-weight: 750; }

/* ==================================================================
   27. MODO APP — experiencia móvil
   La tienda en el teléfono se comporta como una aplicación:
   cabecera limpia, buscador a pantalla completa, carruseles que se
   deslizan con el dedo, barra inferior con indicador y aviso de
   instalación. En escritorio todo esto se desactiva.
   ================================================================== */

/* La pastilla de búsqueda y el buscador de escritorio se intercambian */
.search-pill { display: none; }
.search-cancel { display: none; }

@media (max-width: 899px) {

  /* ---------- Base táctil ---------- */
  html, body { overscroll-behavior-y: none; }
  body {
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeSpeed;
  }
  button, a, .p-card, .cat-card, .chip, .order-actions .act {
    -webkit-touch-callout: none;
    touch-action: manipulation;
  }
  /* Sin estados hover en pantalla táctil */
  .p-card:hover { transform: none; box-shadow: none; }
  .p-card:hover .p-media img { transform: none; }
  .cat-card:hover { transform: none; }
  .p-card:active { transform: scale(.985); }
  .cat-card:active { transform: scale(.975); }
  .p-add:active, .btn:active { transform: scale(.96); }

  /* ---------- Cabecera compacta ---------- */
  .header-inner { height: 58px; gap: 10px; }
  .logo { font-size: 19px; }
  .logo small { display: none; }

  .search-pill {
    display: flex; align-items: center; gap: 9px;
    flex: 1 1 auto; min-width: 0;
    height: 40px; padding: 0 14px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 14.5px; font-weight: 500;
  }
  .search-pill svg { width: 17px; height: 17px; flex: 0 0 auto; }
  .search-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-pill:active { background: var(--bg-2); }

  .search-trigger-desktop { display: none; }
  .hide-mobile { display: none !important; }
  .header-actions { gap: 2px; }
  .theme-toggle { width: 56px; height: 32px; }
  .theme-toggle .knob { width: 24px; height: 24px; }
  :root[data-theme="light"] .theme-toggle .knob { transform: translateX(24px); }

  /* ---------- Buscador a pantalla completa ---------- */
  .search-panel {
    position: fixed; inset: 0; z-index: 100;
    height: 100dvh; max-height: none;
    background: var(--bg);
    border-top: 0;
    display: flex; flex-direction: column;
    transform: translateY(14px);
    opacity: 0; pointer-events: none;
    transition: transform .28s cubic-bezier(.16,1,.3,1), opacity .2s ease;
    overscroll-behavior: contain;
  }
  .search-panel.open {
    transform: none; opacity: 1; pointer-events: auto; max-height: none;
  }
  .search-panel-inner {
    padding-top: max(14px, env(safe-area-inset-top));
    display: flex; flex-direction: column;
    min-height: 0; flex: 1;
  }
  .search-input { height: 46px; font-size: 16px; }
  .search-clear { display: none; }   /* en móvil se usa "Cancelar" */
  .search-results {
    flex: 1; max-height: none; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 14px;
  }
  .search-cancel {
    display: inline-flex; align-items: center; justify-content: center;
    height: 46px; padding: 0 6px 0 12px;
    font-size: 14.5px; font-weight: 650; color: var(--brand-text);
  }
  body.search-open { overflow: hidden; }

  /* ---------- Barra inferior con indicador ---------- */
  .bottom-nav a { padding-top: 12px; }
  .bottom-nav a::before {
    content: "";
    position: absolute; top: 0; left: 50%;
    width: 0; height: 3px;
    border-radius: 0 0 5px 5px;
    background: var(--brand);
    transform: translateX(-50%);
    transition: width .26s cubic-bezier(.34,1.56,.64,1);
  }
  .bottom-nav a.active::before { width: 26px; }
  .bottom-nav a:active { transform: scale(.9); }
  .bottom-nav a { transition: transform .16s, color .16s; }

  /* ---------- Carruseles deslizables ---------- */
  .hscroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 64%);
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .hscroll::-webkit-scrollbar { display: none; }
  .hscroll > * { scroll-snap-align: start; }
  .hscroll.sm { grid-auto-columns: minmax(0, 43%); }

  /* Dentro de la vitrina clara, el carrusel sangra hasta los bordes */
  .shop-surface .hscroll {
    margin-inline: calc(-1 * clamp(16px, 3vw, 28px));
    padding-inline: clamp(16px, 3vw, 28px);
  }

  /* ---------- Detalles de app ---------- */
  .hero { padding-block: 26px 34px; }
  .hero h1 { font-size: clamp(30px, 9vw, 42px); }
  .hero-sub { font-size: 15.5px; }
  .hero-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 18px; }
  .hero-actions .btn { width: 100%; }
  .hero-pills { margin-top: 16px; gap: 7px; }
  .pill { padding: 7px 11px; font-size: 12px; }

  .section { padding-block: 34px 0; }
  .t-h1 { font-size: clamp(26px, 7vw, 34px); }
  .t-h2 { font-size: clamp(22px, 6vw, 28px); }

  /* Cabeceras de sección con enlace a la derecha, como en las apps */
  .row-between > .btn-ghost { font-size: 13px; padding: 6px 10px; }

  /* Tarjetas de categoría en fila horizontal */
  .grid-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .cat-card { min-height: 112px; }

  /* Ficha de producto: foco en la acción */
  .price-now { font-size: clamp(30px, 9vw, 38px); }
  .spec-row { padding: 11px 0; }

  /* Checkout y carrito más cómodos con el pulgar */
  .cart-line { grid-template-columns: 64px 1fr; gap: 12px; }
  .cart-line img { width: 64px; height: 64px; }
  .cart-line > div:last-child { grid-column: 2; text-align: left; font-size: 15px; }

  .summary { padding: 16px; }
  .pay-option { padding: 14px; gap: 12px; }
  .pay-mark { width: 40px; height: 40px; }
}

/* En escritorio los carruseles vuelven a ser grillas normales */
@media (min-width: 900px) {
  .hscroll {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    overflow: visible;
    scroll-snap-type: none;
  }
  .hscroll.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hscroll.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------- Transición de entrada de página (sensación de app) ---------- */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.page-enter { animation: pageIn .26s cubic-bezier(.16,1,.3,1) both; }

/* ---------- Espacio para la barra inferior en el teléfono ----------
   Reserva la altura de la barra (más el área segura del iPhone) para
   que ningún contenido quede tapado al final de la página. */
@media (max-width: 899px) {
  .site-footer { padding-bottom: calc(30px + 8px); }
  .wrap, .wrap-narrow { scroll-padding-bottom: 84px; }
}
