/* =========================================================
   social-shop · estilos
   Estética iOS / Apple: glassmorphism, spring, bottom sheets.
   Mobile-first; en desktop la app se centra como un "device".
   ========================================================= */

:root {
  /* Modo claro (por defecto) */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f7;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --line: rgba(0, 0, 0, 0.10);
  --surface-glass: rgba(255,255,255,0.88);
  --sel-bg: #1d1d1f;
  --sel-text: #ffffff;
  --brand: #ff2e74;
  --brand-2: #ff7a3d;
  --accent: #0a84ff;
  --ok: #30d158;
  --radius: 22px;
  --radius-sm: 14px;
  --blur: saturate(180%) blur(20px);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Modo oscuro automático si el sistema lo tiene activado */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0d0d0f;
    --surface-2: #17171b;
    --text: #f5f5f7;
    --text-dim: #9a9aa2;
    --line: rgba(255, 255, 255, 0.10);
    --surface-glass: rgba(10,10,12,0.88);
    --sel-bg: #ffffff;
    --sel-text: #000000;
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

/* ===== Marco app ===== */
.app {
  position: relative;
  width: 100%;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== Barra superior ===== */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
  pointer-events: none;
}
.topbar.is-solid {
  background: var(--surface-glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.topbar > .icon-btn { pointer-events: auto; }
.logo-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--brand), var(--brand-2), var(--accent), var(--brand));
  box-shadow: 0 0 16px rgba(255,46,116,.7);
}
.logo-text { font-weight: 800; letter-spacing: -.02em; font-size: 19px; }
.topbar__actions { display: flex; gap: 6px; pointer-events: auto; }

/* ===== Botón icono ===== */
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: none; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: transform .25s var(--spring), background .2s;
}
.icon-btn:active { transform: scale(.86); }
.icon-btn .i { width: 22px; height: 22px; }

.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}

/* ===== Vista ===== */
.view { flex: 1; overflow: hidden; position: relative; }

/* =========================================================
   REELS (feed vertical full-screen, scroll-snap)
   ========================================================= */
.reels {
  height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory;
  scrollbar-width: none;
}
.reels::-webkit-scrollbar { display: none; }

.reel {
  position: relative; height: 100%; width: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.reel__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reel__media img { width: 100%; height: 100%; object-fit: cover; }

/* Carrusel horizontal de medios (variantes foto/video) dentro de cada reel */
.reel__track {
  position: absolute; inset: 0; z-index: 1;
  display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.reel__track::-webkit-scrollbar { display: none; }
.reel__slide { position: relative; flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; background: #000; }
.reel__slide > video, .reel__slide > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reel::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, transparent 22%, transparent 55%, rgba(0,0,0,.8) 100%);
}

/* Info producto (abajo izquierda) */
.reel__info {
  position: absolute; left: 16px; right: 84px; bottom: calc(var(--safe-bottom) + 90px);
  z-index: 5;
}
.reel__brand { display:flex; align-items:center; gap:8px; font-weight:600; font-size:14px; margin-bottom:8px; }
.reel__brand .av { width:30px; height:30px; border-radius:50%; background:conic-gradient(from 0deg,var(--brand),var(--brand-2)); border:2px solid #fff; }
.reel__name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.reel__desc { font-size: 14px; color: rgba(255,255,255,.85); line-height: 1.35; margin-bottom: 12px; max-width: 90%; }
.reel__tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.tag { font-size:12px; color:#fff; opacity:.85; }

.reel__buy {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: #000; border: none; cursor: pointer;
  padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: transform .25s var(--spring);
}
.reel__buy:active { transform: scale(.94); }
.reel__buy .price { font-weight: 800; }
.reel__buy .old { color:#888; text-decoration: line-through; font-weight:600; font-size:13px; }
.reel__buy.is-soldout { background: rgba(255,255,255,.16); color:#fff; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }

/* Riel de acciones (derecha) */
.reel__rail {
  position: absolute; right: 12px; bottom: calc(var(--safe-bottom) + 96px); z-index: 5;
  display: flex; flex-direction: column; gap: 20px; align-items: center;
}
.rail-btn { display:flex; flex-direction:column; align-items:center; gap:5px; background:none; border:none; color:#fff; cursor:pointer; }
.rail-btn .circ {
  width: 48px; height: 48px; border-radius: 50%; display:grid; place-items:center;
  background: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .3s var(--spring), background .2s;
}
.rail-btn:active .circ { transform: scale(.82); }
.rail-btn .i { width: 25px; height: 25px; }
.rail-btn small { font-size: 11px; font-weight: 600; opacity: .9; }
.rail-btn.is-on .circ { background: var(--brand); }
.rail-btn.is-on .i { fill: #fff; stroke: #fff; }
.rail-btn.cart .circ { background:#fff; } .rail-btn.cart .i { stroke:#000; }

/* indicador "mute" + barras de progreso de medios */
.reel__mute { position:absolute; top:calc(var(--safe-top) + 60px); right:16px; z-index:6; }
.reel__dots { position:absolute; top:calc(var(--safe-top) + 56px); left:16px; right:56px; z-index:6; display:flex; gap:4px; }
.reel__dots span { flex:1; height:3px; border-radius:3px; background:rgba(255,255,255,.3); overflow:hidden; }
.reel__dots span.on { background:#fff; }

/* Estallido de corazón (doble tap) */
.heart-pop {
  position:absolute; z-index:8; width:90px; height:90px; pointer-events:none;
  transform: translate(-50%,-50%) scale(0); opacity:0;
  fill: var(--brand); stroke: none;
}
.heart-pop.go { animation: heartPop .9s var(--spring) forwards; }
@keyframes heartPop {
  0% { transform: translate(-50%,-50%) scale(0) rotate(-15deg); opacity:0; }
  35% { transform: translate(-50%,-50%) scale(1.15) rotate(8deg); opacity:1; }
  70% { transform: translate(-50%,-50%) scale(1) rotate(0); opacity:1; }
  100% { transform: translate(-50%,-55%) scale(.9); opacity:0; }
}

/* =========================================================
   EXPLORAR (grid tipo IG) + FEED tarjetas
   ========================================================= */
.scroll { height:100%; overflow-y:auto; -webkit-overflow-scrolling:touch; padding-top: calc(var(--safe-top) + 64px); padding-bottom: calc(var(--safe-bottom) + 86px); }
.scroll::-webkit-scrollbar { display:none; }

.chips { display:flex; gap:8px; overflow-x:auto; padding: 4px 16px 14px; scrollbar-width:none; }
.chips::-webkit-scrollbar { display:none; }
.chip {
  flex:0 0 auto; padding:9px 16px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface-2); color:var(--text-dim); font-size:14px; font-weight:600; cursor:pointer;
  transition: transform .2s var(--spring);
}
.chip:active { transform:scale(.93); }
.chip.is-active { background:var(--sel-bg); color:var(--sel-text); border-color:var(--sel-bg); }

/* Grid 3:4 — ratio oficial Instagram desde enero 2025 */
.grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:0; padding:0; }
.cell { position:relative; aspect-ratio:3/4; overflow:hidden; background:var(--surface-2); cursor:pointer; border-radius:0; }
.cell img, .cell video { width:100%; height:100%; object-fit:cover; display:block; }
.cell:active { filter:brightness(.82); }
.cell__badge { position:absolute; top:7px; right:7px; width:24px; height:24px; border-radius:50%; background:rgba(0,0,0,.5); display:grid; place-items:center; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.cell__badge .i { width:14px; height:14px; }
.cell__price { position:absolute; left:6px; bottom:6px; font-size:11px; font-weight:800; color:#fff; padding:3px 7px; border-radius:7px; background:rgba(0,0,0,.55); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }
.cell__soldout { position:absolute; inset:0; display:grid; place-items:center; background:rgba(0,0,0,.45); color:#fff; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; }

.section-title { font-size:22px; font-weight:800; letter-spacing:-.02em; padding: 4px 16px 14px; }

/* =========================================================
   Detalle de producto (dentro del sheet)
   ========================================================= */
.pd__media { display:flex; gap:8px; overflow-x:auto; scroll-snap-type:x mandatory; border-radius:18px; scrollbar-width:none; }
.pd__media::-webkit-scrollbar { display:none; }
.pd__media > * { flex:0 0 72%; scroll-snap-align:center; aspect-ratio:9/16; border-radius:18px; overflow:hidden; background:var(--surface-2); }
.pd__media img, .pd__media video { width:100%; height:100%; object-fit:cover; }
.pd__head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin:16px 0 6px; }
.pd__name { font-size:22px; font-weight:800; letter-spacing:-.02em; }
.pd__brand { color:var(--text-dim); font-size:14px; font-weight:600; }
.pd__price { font-size:22px; font-weight:800; white-space:nowrap; }
.pd__price .old { display:block; text-align:right; font-size:13px; color:var(--text-dim); text-decoration:line-through; font-weight:600; }
.pd__rating { display:flex; align-items:center; gap:6px; color:var(--text-dim); font-size:13px; font-weight:600; margin-bottom:12px; }
.pd__rating .star { color:#ffd60a; }
.pd__desc { color:var(--text-dim); line-height:1.5; font-size:15px; margin-bottom:16px; }
.pd__variants { margin-bottom:16px; }
.pd__variants h4 { font-size:13px; color:var(--text-dim); margin-bottom:8px; font-weight:600; }
.var-row { display:flex; flex-wrap:wrap; gap:8px; }
.var {
  padding:9px 14px; border-radius:12px; border:1px solid var(--line); background:var(--surface-2);
  font-size:14px; font-weight:600; cursor:pointer; transition:transform .2s var(--spring);
}
.var:active { transform:scale(.93); }
.var.is-sel { background:var(--sel-bg); color:var(--sel-text); border-color:var(--sel-bg); }

.pd__actions { display:flex; gap:10px; }
.btn {
  flex:1; padding:15px; border-radius:16px; border:none; cursor:pointer; font-weight:700; font-size:16px;
  display:flex; align-items:center; justify-content:center; gap:8px; transition:transform .25s var(--spring);
}
.btn:active { transform:scale(.95); }
.btn--primary { background:linear-gradient(120deg, var(--brand), var(--brand-2)); color:#fff; box-shadow:0 10px 30px rgba(255,46,116,.35); }
.btn--soft { flex:0 0 56px; background:var(--surface-2); color:var(--text); }
.btn--soft.is-on { background:var(--brand); }
.btn--soft.is-on .i { fill:#fff; }
.btn--notify { background:rgba(10,132,255,.16); color:var(--accent); }

/* =========================================================
   Carrito / Lista de deseos (listas)
   ========================================================= */
.line { display:flex; gap:12px; padding:12px 16px; align-items:center; border-bottom:1px solid var(--line); }
.line__img { width:58px; aspect-ratio:9/16; border-radius:12px; overflow:hidden; background:var(--surface-2); flex:0 0 auto; }
.line__img img, .line__img video { width:100%; height:100%; object-fit:cover; }
.line__body { flex:1; min-width:0; }
.line__name { font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.line__meta { color:var(--text-dim); font-size:13px; }
.line__price { font-weight:800; }
.stepper { display:flex; align-items:center; gap:10px; margin-top:6px; }
.stepper button { width:28px; height:28px; border-radius:8px; border:1px solid var(--line); background:var(--surface-2); color:var(--text); font-size:16px; cursor:pointer; }
.stepper button:active { transform:scale(.9); }
.line__rm { background:none; border:none; color:var(--text-dim); cursor:pointer; padding:6px; }

.cart-foot { padding:16px; border-top:1px solid var(--line); }
.cart-total { display:flex; justify-content:space-between; font-size:18px; font-weight:800; margin-bottom:14px; }
.cart-total .muted { color:var(--text-dim); font-weight:600; font-size:14px; }

.empty { text-align:center; color:var(--text-dim); padding:60px 30px; }
.empty .big { font-size:46px; margin-bottom:10px; }
.empty h3 { color:var(--text); font-size:18px; margin-bottom:6px; }

/* =========================================================
   Tabbar
   ========================================================= */
.tabbar {
  position:absolute; left:0; right:0; bottom:0; z-index:30;
  display:flex; justify-content:space-around; align-items:center;
  padding: 10px 8px calc(var(--safe-bottom) + 10px);
  background: var(--surface-glass);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top:1px solid var(--line);
}
.tab { background:none; border:none; color:var(--text-dim); cursor:pointer; padding:6px 10px; transition:transform .25s var(--spring); }
.tab:active { transform:scale(.85); }
.tab.is-active { color:var(--text); }
.tab .i { width:26px; height:26px; }
.tab--reels.is-active .i { stroke:var(--brand); }

/* =========================================================
   Bottom sheet + backdrop
   ========================================================= */
.sheet-backdrop {
  position:absolute; inset:0; z-index:40; background:rgba(0,0,0,.5);
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  opacity:0; transition:opacity .35s var(--ease);
}
.sheet-backdrop.show { opacity:1; }

.sheet {
  position:absolute; left:0; right:0; bottom:0; z-index:41;
  max-height:90%; background:var(--surface);
  border-radius:28px 28px 0 0; border-top:1px solid var(--line);
  transform: translateY(102%); transition: transform .42s var(--spring);
  display:flex; flex-direction:column; overflow:hidden;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -20px 60px rgba(0,0,0,.6);
}
.sheet.show { transform: translateY(0); }
.sheet__grabber { width:40px; height:5px; border-radius:3px; background:rgba(128,128,128,.3); margin:10px auto 4px; flex:0 0 auto; }
.sheet__content { overflow-y:auto; padding:8px 16px 20px; -webkit-overflow-scrolling:touch; }
.sheet__content::-webkit-scrollbar { display:none; }

/* =========================================================
   Toasts
   ========================================================= */
.toast-wrap { position:absolute; left:0; right:0; bottom:calc(var(--safe-bottom) + 96px); z-index:50; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:none; }
.toast {
  background:rgba(28,28,32,.92); color:#fff; padding:12px 18px; border-radius:14px;
  font-size:14px; font-weight:600; display:flex; align-items:center; gap:9px;
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px); border:1px solid var(--line);
  box-shadow:0 12px 40px rgba(0,0,0,.5);
  transform: translateY(20px) scale(.9); opacity:0; transition:all .4s var(--spring);
}
.toast.show { transform: translateY(0) scale(1); opacity:1; }
.toast .dot { width:8px; height:8px; border-radius:50%; background:var(--ok); }
.toast.brand .dot { background:var(--brand); }

/* ===== Menú de categorías (hamburguesa) ===== */
.menu h3 { font-size:13px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.08em; margin:6px 4px 12px; }
.menu-cat {
  width:100%; display:flex; align-items:center; justify-content:space-between;
  padding:16px; margin-bottom:8px; border-radius:16px; border:1px solid var(--line);
  background:var(--surface-2); color:var(--text); font-size:17px; font-weight:700; cursor:pointer;
  transition:transform .2s var(--spring);
}
.menu-cat:active { transform:scale(.97); }
.menu-cat.is-active { background:var(--sel-bg); color:var(--sel-text); border-color:var(--sel-bg); }
.menu-cat .count { font-size:13px; font-weight:600; opacity:.6; }

/* filtros por # (tags) dentro de una categoría */
.tagbar { display:flex; gap:8px; overflow-x:auto; padding:2px 16px 14px; scrollbar-width:none; }
.tagbar::-webkit-scrollbar { display:none; }
.tagchip {
  flex:0 0 auto; padding:8px 14px; border-radius:999px; border:1px solid var(--line);
  background:var(--surface-2); color:var(--text-dim); font-size:13px; font-weight:600; cursor:pointer;
  transition:transform .2s var(--spring);
}
.tagchip:active { transform:scale(.92); }
.tagchip.is-active { background:var(--brand); color:#fff; border-color:var(--brand); }

/* ===== Tallas (chips) ===== */
.sizchip {
  padding:7px 11px; border-radius:10px; border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.12); color:#fff; font-size:13px; font-weight:700; cursor:pointer;
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); transition:transform .2s var(--spring);
}
.sizchip:active { transform:scale(.9); }
.sizchip.is-sel { background:#fff; color:#000; border-color:#fff; }

/* tallas junto al precio en el reel */
.reel__buyrow { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.reel__sizes { display:flex; gap:6px; flex-wrap:wrap; }
.reel__sku { opacity:.9; font-weight:600; }

/* tallas en el carrito */
.line__sizes { display:flex; gap:6px; margin:7px 0 2px; flex-wrap:wrap; }
.line__sizes .sizchip { background:var(--surface-2); border-color:var(--line); color:var(--text); padding:5px 9px; font-size:12px; }
.line__sizes .sizchip.is-sel { background:var(--sel-bg); color:var(--sel-text); border-color:var(--sel-bg); }
.line__img--sq { aspect-ratio:1/1 !important; width:64px; }

/* ===== Buscador ===== */
.search-box {
  display:flex; align-items:center; gap:8px; margin:0 16px 14px;
  padding:11px 14px; background:var(--surface-2); border:1px solid var(--line); border-radius:14px;
}
.search-box .i { width:20px; height:20px; color:var(--text-dim); flex:0 0 auto; }
.search-box input { flex:1; background:none; border:none; color:var(--text); font-size:15px; outline:none; }
.qclear { background:none; border:none; color:var(--text-dim); cursor:pointer; padding:2px; }
.qclear .i { width:18px; height:18px; }

.results { padding:0 8px; }
.result { display:flex; align-items:center; gap:12px; padding:10px 8px; border-bottom:1px solid var(--line); cursor:pointer; }
.result:active { background:var(--surface-2); }
.result__img { width:52px; height:52px; border-radius:12px; overflow:hidden; background:var(--surface-2); flex:0 0 auto; }
.result__img img, .result__img video { width:100%; height:100%; object-fit:cover; }
.result__body { flex:1; min-width:0; }
.result__name { font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.result__sku { color:var(--text-dim); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.result__price { font-weight:800; }

/* ===== Comentarios (estilo Instagram) ===== */
.comments__title { font-weight:800; font-size:18px; text-align:center; padding:2px 0 12px; border-bottom:1px solid var(--line); margin-bottom:12px; }
.comments__list { display:flex; flex-direction:column; gap:16px; max-height:48vh; overflow-y:auto; }
.cmt { display:flex; gap:10px; align-items:flex-start; }
.cmt__av { width:34px; height:34px; border-radius:50%; background:conic-gradient(from 0deg, var(--brand), var(--brand-2), var(--accent)); flex:0 0 auto; }
.cmt__body { flex:1; font-size:14px; line-height:1.4; }
.cmt__body b { font-weight:700; margin-right:4px; }
.cmt__t { color:var(--text-dim); font-size:12px; margin-top:4px; }
.cmt__like { background:none; border:none; color:var(--text-dim); cursor:pointer; }
.cmt__like .i { width:16px; height:16px; }
.cmt-input { display:flex; align-items:center; gap:10px; padding-top:12px; margin-top:10px; border-top:1px solid var(--line); }
.cmt-input input { flex:1; background:var(--surface-2); border:1px solid var(--line); border-radius:999px; padding:10px 14px; color:var(--text); outline:none; font-size:14px; }
.cmt-input button { background:none; border:none; color:var(--accent); font-weight:700; cursor:pointer; }

/* ===== Legibilidad sobre fondos claros (sombra texto + iconos) ===== */
.reel__info { text-shadow: 0 1px 10px rgba(0,0,0,.65), 0 0 2px rgba(0,0,0,.55); }
.reel__buy { text-shadow: none; }
.reel .i { filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.reel__dots span { box-shadow: 0 0 6px rgba(0,0,0,.5); }
.reel__soldtag { display:inline-block; font-size:16px; font-weight:800; color:#fff; }

.topbar__spacer { flex:1; pointer-events:none; }

/* ===== Iniciar sesión ===== */
.login { text-align:center; padding:10px 6px 6px; }
.login__avatar { width:72px; height:72px; border-radius:50%; margin:6px auto 14px; background:conic-gradient(from 0deg, var(--brand), var(--brand-2), var(--accent)); }
.login__title { font-size:22px; font-weight:800; margin-bottom:6px; }
.login__sub { color:var(--text-dim); font-size:14px; margin-bottom:18px; }
.login__input { width:100%; background:var(--surface-2); border:1px solid var(--line); border-radius:14px; padding:14px; color:var(--text); font-size:15px; outline:none; margin-bottom:10px; }
.login .btn { width:100%; margin-bottom:10px; }
.login__or { position:relative; text-align:center; color:var(--text-dim); margin:6px 0; font-size:13px; }
.login__or span { background:var(--surface); padding:0 10px; position:relative; z-index:1; }
.login__or::before { content:''; position:absolute; left:0; right:0; top:50%; height:1px; background:var(--line); }
.login__soc { background:var(--surface-2); color:var(--text); }

/* ===== Stories (círculos de estado) ===== */
.stories { display:flex; gap:14px; overflow-x:auto; padding:6px 16px 16px; scrollbar-width:none; }
.stories::-webkit-scrollbar { display:none; }
.story { background:none; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px; width:72px; flex:0 0 auto; }
.story__ring {
  width:66px; height:66px; border-radius:50%; padding:3px;
  display:grid; place-items:center; position:relative;
  background: var(--surface-2);
  transition: transform .2s var(--spring);
}
.story:active .story__ring { transform:scale(.92); }
.story__img { width:100%; height:100%; border-radius:50%; background-size:cover; background-position:center; border:2px solid var(--bg); }
.story__pin { position:absolute; bottom:-2px; right:-2px; font-size:11px; background:var(--bg); border-radius:50%; width:20px; height:20px; display:grid; place-items:center; }
.story__label { font-size:11px; color:var(--text-dim); max-width:70px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ===== Visor de stories ===== */
.story-viewer { position:absolute; inset:0; z-index:80; background:#000; opacity:0; transition:opacity .3s var(--ease); display:flex; flex-direction:column; border-radius:inherit; overflow:hidden; }
.story-viewer.show { opacity:1; }
.sv__bars { position:absolute; top:calc(var(--safe-top) + 8px); left:10px; right:10px; z-index:5; display:flex; gap:4px; }
.sv__bars span { flex:1; height:3px; border-radius:3px; background:rgba(255,255,255,.3); overflow:hidden; }
.sv__bars b { display:block; height:100%; width:0; background:#fff; border-radius:3px; }
.sv__bars b.done { width:100%; }
@keyframes storyfill { from { width:0; } to { width:100%; } }
.sv__head { position:absolute; top:calc(var(--safe-top) + 18px); left:14px; right:14px; z-index:6; display:flex; align-items:center; justify-content:space-between; color:#fff; }
.sv__who { display:flex; align-items:center; gap:8px; font-weight:700; font-size:14px; text-shadow:0 1px 6px rgba(0,0,0,.5); }
.sv__av { width:30px; height:30px; border-radius:50%; background-size:cover; background-position:center; border:2px solid #fff; }
.sv__actions { display:flex; align-items:center; gap:8px; }
.sv__btn { background:rgba(255,255,255,.16); border:none; color:#fff; border-radius:999px; padding:7px 12px; font-size:13px; font-weight:700; cursor:pointer; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); display:flex; align-items:center; gap:4px; }
.sv__pin { background:rgba(255,214,10,.22); color:#ffd60a; border-radius:999px; padding:6px 10px; font-size:12px; font-weight:700; -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
.sv__x { padding:7px; }
.sv__x .i { width:18px; height:18px; }
.sv__media { flex:1; display:flex; align-items:center; justify-content:center; background:#000; }
.sv__media img, .sv__media video { width:100%; height:100%; object-fit:cover; }
.sv__nav { position:absolute; top:0; bottom:0; width:35%; z-index:4; background:none; border:none; cursor:pointer; }
.sv__prev { left:0; } .sv__next { right:0; }

/* utilidades */
[hidden] { display:none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeIn .4s var(--ease); }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ===== Topbar brand (visible en vistas sólidas) ===== */
.topbar__brand {
  display: flex; align-items: center; gap: 8px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease);
}
.topbar.is-solid .topbar__brand { opacity: 1; pointer-events: auto; }

/* ===== Perfil de tienda (Home tab — estilo Instagram) ===== */
.store-profile { padding: 16px 16px 0; }

.store-profile__top {
  display: flex; align-items: center; gap: 24px; margin-bottom: 14px;
}

.store-avatar-ring {
  width: 86px; height: 86px; border-radius: 50%; flex: 0 0 86px;
  background: var(--surface-2);
  padding: 3px; display: grid; place-items: center;
  border: 2px solid var(--line);
}
.store-avatar-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--surface-2) url('assets/logo.png') center/cover no-repeat;
  border: 2px solid var(--bg);
}

.store-stats { display: flex; flex: 1; justify-content: space-around; }
.store-stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.store-stat strong { font-size: 17px; font-weight: 800; color: var(--text); }
.store-stat span { font-size: 12px; color: var(--text-dim); font-weight: 500; }

.store-bio { margin-bottom: 14px; }
.store-name { font-size: 15px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; }
.store-desc { font-size: 14px; line-height: 1.5; color: var(--text); margin-bottom: 10px; }

.store-meta {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px;
}
.store-meta span { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }

.store-wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 18px; border-radius: 14px;
  background: #25d366; color: #fff; font-weight: 700; font-size: 15px;
  text-decoration: none; border: none; cursor: pointer;
  transition: transform .25s var(--spring), opacity .2s;
  box-shadow: 0 6px 24px rgba(37,211,102,.35);
}
.store-wa-btn:active { transform: scale(.96); opacity: .9; }
.store-wa-btn .i { stroke: #fff; width: 20px; height: 20px; flex: 0 0 20px; }

/* Historias en el perfil */
.store-profile + .stories { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 4px; }

/* ===== Tarjetas de categoría (Facebook-stories style) ===== */
.cat-sections { padding-top: 8px; }

.cat-section { margin-bottom: 22px; }

.cat-section__hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px 10px;
}
.cat-section__title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.cat-section__more {
  background: none; border: none; color: var(--accent);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 0;
}

.cat-row {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 0 16px 8px; scrollbar-width: none;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.cat-row::-webkit-scrollbar { display: none; }

.cat-card {
  flex: 0 0 115px; height: 185px; border-radius: 18px; overflow: hidden;
  position: relative; cursor: pointer; background: var(--surface-2);
  scroll-snap-align: start;
  transition: transform .22s var(--spring);
  box-shadow: 0 4px 18px rgba(0,0,0,.12);
}
.cat-card:active { transform: scale(.94); }

.cat-card__media {
  width: 100%; height: 100%; object-fit: cover; display: block;
  position: absolute; inset: 0;
}

.cat-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.78) 100%);
  pointer-events: none;
}

.cat-card__overlay {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 22px 8px 10px;
}
.cat-card__name {
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cat-card__price { color: #fff; font-size: 13px; font-weight: 800; }

.cat-card__soldout {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: rgba(0,0,0,.45);
  color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
