/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Light mode */
  --bg:          #d4d4d4;
  --surface:     #ffffff;
  --surface2:    #f5f5f5;
  --border:      #e0e0e0;
  --text:        #1a1a1a;
  --text2:       #666666;
  --text3:       #999999;
  --primary:     #FFA000;
  --primary-dk:  #e08c00;
  --primary-lt:  #fff8e1;
  --green:       #22c55e;
  --red:         #ef4444;
  --qty-bg:      #e2e2e2;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --radius:      14px;
  --radius-sm:   8px;
  --nav-h:       60px;
  --header-h:    56px;
}

[data-theme="dark"] {
  --bg:          #23272c;
  --surface:     #3d4248;
  --surface2:    #484e55;
  --border:      #555b63;
  --text:        #f0f0f0;
  --text2:       #aaaaaa;
  --text3:       #666666;
  --primary:     #FFA000;
  --primary-dk:  #e08c00;
  --primary-lt:  #2a1f00;
  --qty-bg:      #5e6470;
  --shadow:      0 2px 12px rgba(0,0,0,.4);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.6);
}

html { height: 100%; background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  min-height: 100%;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 0;
}
body::before,
body::after {
  content: '';
  position: fixed;
  left: -25vw;
  right: -25vw;
  top: 116px;
  height: calc(100vh - 296px);
  z-index: -1;
  pointer-events: none;
  background-size: 300% 100%;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}
body::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 1080' preserveAspectRatio='none'><path d='M0,400 C60,320 180,480 240,400 C300,320 420,480 480,400 C540,320 660,480 720,400 C780,320 900,480 960,400 C1020,320 1140,480 1200,400 C1260,320 1380,480 1440,400 L1440,1000 C1380,920 1260,1070 1200,1000 C1140,920 1020,1070 960,1000 C900,920 780,1070 720,1000 C660,920 540,1070 480,1000 C420,920 300,1070 240,1000 C180,920 60,1070 0,1010 Z' fill='rgba(255,255,255,0.35)'/></svg>");
  animation: bg-wave-slow 14s ease-in-out infinite;
}
body::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 1080' preserveAspectRatio='none'><path d='M0,460 C60,390 180,530 240,460 C300,390 420,530 480,460 C540,390 660,530 720,460 C780,390 900,530 960,460 C1020,390 1140,530 1200,460 C1260,390 1380,530 1440,460 L1440,990 C1380,920 1260,1048 1200,990 C1140,920 1020,1048 960,990 C900,920 780,1048 720,990 C660,920 540,1048 480,990 C420,920 300,1048 240,990 C180,920 60,1048 0,1000 Z' fill='rgba(0,0,0,0.05)'/><path d='M0,830 C60,780 180,880 240,830 C300,780 420,880 480,830 C540,780 660,880 720,830 C780,780 900,880 960,830 C1020,780 1140,880 1200,830 C1260,780 1380,880 1440,830 L1440,1040 C1380,990 1260,1078 1200,1040 C1140,990 1020,1078 960,1040 C900,990 780,1078 720,1040 C660,990 540,1078 480,1040 C420,990 300,1078 240,1040 C180,990 60,1078 0,1050 Z' fill='rgba(255,255,255,0.18)'/></svg>");
  animation: bg-wave-medium 10s ease-in-out infinite;
}
[data-theme="dark"] body::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 1080' preserveAspectRatio='none'><path d='M0,400 C60,320 180,480 240,400 C300,320 420,480 480,400 C540,320 660,480 720,400 C780,320 900,480 960,400 C1020,320 1140,480 1200,400 C1260,320 1380,480 1440,400 L1440,1000 C1380,920 1260,1070 1200,1000 C1140,920 1020,1070 960,1000 C900,920 780,1070 720,1000 C660,920 540,1070 480,1000 C420,920 300,1070 240,1000 C180,920 60,1070 0,1010 Z' fill='rgba(255,255,255,0.04)'/></svg>");
}
[data-theme="dark"] body::after {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 1080' preserveAspectRatio='none'><path d='M0,460 C60,390 180,530 240,460 C300,390 420,530 480,460 C540,390 660,530 720,460 C780,390 900,530 960,460 C1020,390 1140,530 1200,460 C1260,390 1380,530 1440,460 L1440,990 C1380,920 1260,1048 1200,990 C1140,920 1020,1048 960,990 C900,920 780,1048 720,990 C660,920 540,1048 480,990 C420,920 300,1048 240,990 C180,920 60,1048 0,1000 Z' fill='rgba(0,0,0,0.35)'/><path d='M0,830 C60,780 180,880 240,830 C300,780 420,880 480,830 C540,780 660,880 720,830 C780,780 900,880 960,830 C1020,780 1140,880 1200,830 C1260,780 1380,880 1440,830 L1440,1040 C1380,990 1260,1078 1200,1040 C1140,990 1020,1078 960,1040 C900,990 780,1078 720,1040 C660,990 540,1078 480,1040 C420,990 300,1078 240,1040 C180,990 60,1078 0,1050 Z' fill='rgba(0,0,0,0.2)'/></svg>");
}
@keyframes bg-wave-slow {
  0%, 100% { transform: translate3d(-20vw, -20px, 0); }
  50%     { transform: translate3d(20vw, 20px, 0); }
}
@keyframes bg-wave-medium {
  0%, 100% { transform: translate3d(20vw, 20px, 0); }
  50%     { transform: translate3d(-20vw, -20px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
}

/* ===== Header ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  box-shadow: var(--shadow);
}
[data-theme="dark"] .header {
  border-bottom: none;
}
.header-logo {
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px; flex: 1;
}
.header-logo img { vertical-align: middle; }
.logo-dark  { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark  { display: inline; }
.btn-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface2); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background .15s, transform .1s;
  color: var(--text); position: relative;
}
.btn-icon:active { transform: scale(.95); }
#btnInstall i { animation: install-pulse 2s ease-in-out infinite; }
@keyframes install-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
.badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--primary); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--surface);
  display: none;
}
.badge.visible { display: flex; }

/* ===== Search bar ===== */
.sticky-bars {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 90;
  background: var(--bg);
  transition: transform .25s ease;
}
.sticky-bars.bars-hidden {
  transform: translateY(-100%);
}
.search-wrap {
  padding: 15px 15px 15px;
}
.search-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--primary); }
.search-box input {
  flex: 1; border: none; background: transparent;
  font-size: 15px; color: var(--text); outline: none;
}
.search-box input::placeholder { color: var(--text3); }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-icon { display: flex; align-items: center; flex-shrink: 0; }
.search-clear {
  display: flex; align-items: center; flex-shrink: 0;
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--text); opacity: 0.5; font-size: 16px;
}

/* ===== Categories ===== */
.cats-wrap {
  padding: 0 0 4px;
}
.cats {
  display: flex; gap: 8px;
  overflow-x: auto; padding: 2px 15px 8px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 50px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 13px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.cat-btn .cat-img { width: 20px; height: 20px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.cat-btn .cat-emoji { font-size: 16px; flex-shrink: 0; }
.cat-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.cat-btn:active { transform: scale(.94); }

/* ===== Subcategories ===== */
.subcats-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.subcats-wrap.open {
  max-height: 61px;
  padding-bottom: 5px;
}
.subcats {
  display: flex; gap: 6px;
  overflow-x: auto; padding: 0 15px 8px;
  scrollbar-width: none;
}
.subcats::-webkit-scrollbar { display: none; }
.subcat-btn {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 13px; border-radius: 50px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--text2);
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.subcat-btn .cat-emoji { font-size: 14px; flex-shrink: 0; }
.subcat-btn.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff;
}
.subcat-btn:active { transform: scale(.94); }

/* ===== Section title ===== */
.section-title {
  padding: 4px 16px 10px;
  font-size: 18px; font-weight: 700; color: var(--text);
}
.section-title small { font-size: 13px; font-weight: 400; color: var(--text3); margin-left: 6px; }

/* ===== Home view (nuevo) ===== */
#homeView {
  padding: 4px 0 calc(var(--nav-h) + 10px);
}

/* Banner bienvenida */
.home-banner {
  position: relative;
  margin: 6px 15px 18px;
  padding: 18px 18px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  color: #fff;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.home-banner-content { flex: 1; position: relative; z-index: 1; }
.home-banner-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  opacity: .9; text-transform: uppercase;
}
.home-banner-title {
  font-size: 20px; font-weight: 800; line-height: 1.15;
  margin: 4px 0 6px;
  letter-spacing: -.3px;
}
.home-banner-sub {
  font-size: 13px; font-weight: 500;
  opacity: .92;
}
.home-banner-art {
  width: 84px; height: 84px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  flex-shrink: 0;
}
.home-banner-art i {
  font-size: 38px; color: #fff;
}

/* Slot banner: banner promocional entre secciones del home (gestionable desde el admin).
   Replica la altura y tipografías del .home-banner de bienvenida (eyebrow + título + subtítulo). */
.slot-banner {
  position: relative;
  margin: 6px 15px 18px;
  padding: 18px 18px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg2);
  box-shadow: var(--shadow);
}
/* El primer banner del home (slot "categorias") no lleva separación superior. */
.slot-banner[data-slot="categorias"] {
  margin-top: 0;
}
.slot-banner.is-clickable { cursor: pointer; }
.slot-banner-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
}
.slot-banner-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}
.slot-banner-content { flex: 1; min-width: 0; }
.slot-banner-art {
  flex-shrink: 0;
  width: 78px; height: 78px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18);
}
.slot-banner-art i { font-size: 34px; color: #fff; }
/* Posición del texto: izq y der ubican el ícono al lado opuesto.
   Centro: oculta el ícono (lo decide el JS) y centra el texto. */
.slot-banner.pos-derecha   .slot-banner-overlay { flex-direction: row-reverse; }
.slot-banner.pos-izquierda .slot-banner-content { text-align: left; }
.slot-banner.pos-centro    .slot-banner-content { text-align: center; }
.slot-banner.pos-derecha   .slot-banner-content { text-align: right; }
/* Círculo del ícono ajustado al color del texto. */
.slot-banner.color-oscuro .slot-banner-art   { background: rgba(0,0,0,.12); }
.slot-banner.color-oscuro .slot-banner-art i { color: #111; }
.slot-banner-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  opacity: .9; text-transform: uppercase;
}
.slot-banner-titulo {
  font-size: 20px; font-weight: 800; line-height: 1.15;
  margin: 4px 0 6px; letter-spacing: -.3px;
}
.slot-banner-sub {
  font-size: 13px; font-weight: 500; opacity: .92;
}
.slot-banner-cta {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.slot-banner.color-claro .slot-banner-eyebrow,
.slot-banner.color-claro .slot-banner-titulo,
.slot-banner.color-claro .slot-banner-sub {
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.slot-banner.color-oscuro .slot-banner-eyebrow,
.slot-banner.color-oscuro .slot-banner-titulo,
.slot-banner.color-oscuro .slot-banner-sub {
  color: #111; text-shadow: 0 1px 2px rgba(255,255,255,.4);
}
.slot-banner.color-claro  .slot-banner-cta { background: #fff; color: #111; }
.slot-banner.color-oscuro .slot-banner-cta { background: #111; color: #fff; }

/* Sección genérica del home */
.home-section {
  margin: 0 0 22px;
}
.home-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 15px 10px;
}
.home-section-title {
  font-size: 17px; font-weight: 800; color: var(--text);
  letter-spacing: -.2px;
  display: flex; align-items: center; gap: 8px;
}
.home-section-icon {
  color: var(--primary); font-size: 16px; width: 18px; text-align: center;
}
.home-section-emoji {
  font-size: 18px; line-height: 1;
}
.home-section-link {
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--primary);
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px; border-radius: 6px;
}
.home-section-link:active { transform: scale(.96); }
.home-section-link i { font-size: 11px; }

/* Categorías populares (círculos) */
.home-cats-circles {
  display: flex; gap: 14px;
  overflow-x: auto;
  /* padding (no gap) en los costados: da los 15px estándar al inicio y al
     final sin que el `gap` de los items se sume al espacio del borde. */
  padding: 4px 15px 6px;
  scrollbar-width: none;
}
.home-cats-circles::-webkit-scrollbar { display: none; }
.home-cat-circle {
  flex-shrink: 0;
  width: 76px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  padding: 0;
}
.home-cat-circle:active { transform: scale(.95); }
.home-cat-circle-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.home-cat-circle:active .home-cat-circle-icon { border-color: var(--primary); }
.home-cat-circle-icon img {
  width: 40px; height: 40px;
  object-fit: contain;
}
.home-cat-circle-label {
  font-size: 12px; font-weight: 600; color: var(--text);
  text-align: center; line-height: 1.2;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Carruseles horizontales del home */
.home-carousel {
  display: flex; gap: 12px;
  overflow-x: auto;
  /* padding (no gap) en los costados: 15px estándar al inicio y al final, sin
     que el `gap` entre cards se sume al espacio del borde. scroll-padding-left
     desplaza el punto de snap para que cuando el usuario suelte la primera
     tarjeta no se pegue al borde sino que descanse alineada con el título. */
  margin: 0;
  padding: 4px 15px 12px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-left: 15px;
}
/* Centinela invisible al final del carrusel — dispara la próxima página
   cuando entra al viewport del carrusel (scroll infinito horizontal). */
.home-carousel-sentinel {
  flex: 0 0 1px;
  align-self: stretch;
}
.home-carousel::-webkit-scrollbar { display: none; }
.home-carousel .card {
  flex-shrink: 0;
  width: 150px;
  scroll-snap-align: start;
}
@media (min-width: 768px) {
  .home-carousel .card { width: 170px; }
}
.home-carousel-empty {
  padding: 20px 15px;
  font-size: 13px; color: var(--text3);
  text-align: center;
  width: 100%;
}
.home-carousel-skel {
  flex-shrink: 0;
  width: 150px;
  height: 240px;
  border-radius: var(--radius);
  background: var(--surface2);
  position: relative;
  overflow: hidden;
}
.home-carousel-skel::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  animation: home-skel-shimmer 1.2s ease-in-out infinite;
}
@keyframes home-skel-shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* ===== Products grid ===== */
.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px 15px;
  padding: 5px 15px 0;
  padding-bottom: calc(var(--nav-h) + 10px);
}
@media (min-width: 768px) {
  .products { grid-template-columns: repeat(4, 1fr); gap: 15px 15px; padding: 5px 15px 0; padding-bottom: calc(var(--nav-h) + 10px); }
}
@media (min-width: 1024px) {
  .products { grid-template-columns: repeat(5, 1fr); gap: 15px 15px; padding: 5px 15px 0; padding-bottom: calc(var(--nav-h) + 10px); }
}
@media (min-width: 1280px) {
  .products { grid-template-columns: repeat(6, 1fr); }
}

.card {
  background: var(--surface2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  border: 1.5px solid transparent;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:active { transform: scale(.97); }
.card.sin-stock { opacity: .55; pointer-events: none; }
.ribbon-oferta {
  position: absolute;
  top: 18px; left: -56px;
  width: 170px;
  background: #e53935;
  color: #fff;
  font-size: 16px; font-weight: 800;
  text-align: center;
  padding: 4px 0;
  letter-spacing: 1px;
  text-transform: uppercase;
  transform: rotate(-45deg);
  z-index: 3;
  pointer-events: none;
}
/* El badge vive dentro de .card-thumb (overflow:hidden) — queda recortado al área de imagen */
.badge-descuento {
  position: absolute;
  bottom: 7px; left: 7px;
  width: 40px; height: 40px;
  background: #3a3a3a;
  color: #fff;
  font-size: 10px; font-weight: 800;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  letter-spacing: -.3px;
  z-index: 2;
  pointer-events: none;
}
/* Latido en imágenes de productos en oferta.
   El delay de .65s deja que el fade-in termine antes de arrancar el loop. */
@keyframes oferta-intro {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-4deg); }
}
@keyframes oferta-wiggle {
  from { transform: rotate(-4deg); }
  to   { transform: rotate(4deg); }
}
.card-thumb.is-oferta.is-loaded.is-wiggle img {
  animation:
    oferta-intro .625s ease-in-out .65s forwards,
    oferta-wiggle .625s ease-in-out 1.275s infinite alternate;
  transform-origin: center center;
}
@media (prefers-reduced-motion: reduce) {
  .card-thumb.is-oferta.is-loaded.is-wiggle img { animation: none; transform-origin: unset; }
}
.card-fav-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; cursor: pointer; color: rgba(255,255,255,.5);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
  transition: color .15s, transform .15s;
}
.card-fav-btn:active { transform: scale(.95); }
.card-fav-btn.active { color: rgba(255,255,255,1); }

.card-thumb {
  background: #fff;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  user-select: none;
  border-radius: var(--radius);
  position: relative;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: scale(.65);
  transition: opacity .4s ease-out,
              transform .6s cubic-bezier(0.22, 1.35, 0.36, 1);
}
/* El fade-in sólo dispara cuando la card entró al viewport — así el efecto
   se ve siempre, aunque la imagen ya estuviera en caché y haya cargado antes. */
.card-thumb.is-loaded.is-viewport img { opacity: 1; transform: scale(1); }
/* Estado de error: el handler en JS reemplaza el <img> por <i class="fa-image">. */
.card-thumb.is-error {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb.is-error i {
  font-size: 32px;
  color: var(--text3);
  opacity: .55;
}
/* Flash de brillo al agregar/quitar del carrito */
.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  clip-path: inset(0 round 14px);
  background: linear-gradient(
    108deg,
    rgba(255,255,255,0) 33%,
    rgba(255,255,255,0.45) 44%,
    rgba(255,255,255,0.63) 50%,
    rgba(255,255,255,0.45) 56%,
    rgba(255,255,255,0) 67%
  );
  transform: translateX(-180%);
  opacity: 0;
}
@keyframes cart-add-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.08); }
  65%  { transform: scale(0.96); }
  100% { transform: scale(1); }
}
@keyframes cart-flash {
  0%   { transform: translateX(-180%); opacity: 1; }
  100% { transform: translateX(180%);  opacity: 1; }
}
@keyframes cart-remove-flash {
  0%   { transform: translateX(180%);  opacity: 1; }
  100% { transform: translateX(-180%); opacity: 1; }
}
.card-thumb.is-cart-pop > img {
  animation: cart-add-pop .38s cubic-bezier(0.22, 1.35, 0.36, 1);
}
.card-thumb.is-cart-pop::after {
  animation: cart-flash 0.9s ease-out forwards;
}
.card-thumb.is-cart-remove::after {
  animation: cart-remove-flash 0.9s ease-out forwards;
}
@media (prefers-reduced-motion: reduce) {
  .card-thumb img { transition: none; transform: none; }
  .card-thumb.is-cart-pop > img { animation: none; }
  .card-thumb.is-cart-pop::after { animation: none; }
  .card-thumb.is-cart-remove::after { animation: none; }
}
.card-body { padding: 5px; background: var(--surface2); flex: 1; display: flex; flex-direction: column; }
.card-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.35; letter-spacing: -.1px;
  margin: 2px 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
  /* reserva 2 líneas para que los precios queden alineados entre cards */
  min-height: calc(13px * 1.35 * 2);
}
.card-unit { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-price-wrap {
  display: flex; align-items: baseline; justify-content: flex-end;
  gap: 6px; flex-wrap: wrap;
  margin-top: auto; margin-bottom: 8px;
}
.card-price {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 19px; font-weight: 800; color: var(--primary);
  line-height: 1; letter-spacing: -.4px;
  margin-top: auto; margin-bottom: 8px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.card-price-wrap .card-price { margin: 0; }
.card-price-cur {
  font-size: .65em; font-weight: 700;
  opacity: .7;
  margin-right: 1px;
  vertical-align: top;
  position: relative; top: .2em;
}
.card-price-old {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px; font-weight: 600;
  color: var(--text2);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-add-btn {
  width: 100%; height: 40px; padding: 0 6px; box-sizing: border-box;
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  border: none; border-radius: 50px;
  font-size: 12px; font-weight: 700; color: #fff;
  cursor: pointer; transition: transform .1s;
  display: flex; align-items: center; justify-content: center;
}
.card-add-btn:active { transform: scale(.97); }

.card-qty-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 40px; padding: 4px; box-sizing: border-box;
  background: var(--qty-bg);
  border: 1px solid var(--border); border-radius: 50px;
}
.card-qty-btn {
  width: 36px; height: 30px; border-radius: 50px; border: none;
  background: var(--primary); color: #fff;
  font-size: 18px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, transform .1s;
}
.card-qty-btn:active { transform: scale(.95); background: var(--primary-dk); }
.card-qty-btn:disabled { opacity: .4; pointer-events: none; }
.card-qty-label {
  flex: 1; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--text2);
}

.btn-add {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); border: none;
  color: #fff; font-size: 20px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, transform .1s;
  box-shadow: 0 3px 8px rgba(255,160,0,.35);
}
.btn-add:active { transform: scale(.88); background: var(--primary-dk); }

.card-qty-wrap {
  display: flex; align-items: center; gap: 6px;
}
.qty-label {
  width: 24px; text-align: center;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.btn-minus {
  width: 28px; height: 28px; border-radius: 50%;
  background: #d0d0d0; border: none;
  color: #111; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.btn-minus:active { background: var(--border); }

.stock-tag {
  position: absolute; top: 8px; right: 8px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
}

/* ===== Empty state ===== */
.empty {
  grid-column: 1 / -1;
  text-align: center; padding: 60px 20px;
  color: var(--text3);
}
.empty-icon { margin-bottom: 16px; display: flex; justify-content: center; }
.empty p { font-size: 15px; }

.empty--search,
.empty--no-products { color: var(--text2); }
.empty--search .empty-icon,
.empty--no-products .empty-icon { margin-bottom: 28px; }
.empty--search .empty-icon i,
.empty--no-products .empty-icon i { font-size: 72px; }
.empty--search p,
.empty--no-products p { font-size: 17px; font-weight: 500; max-width: 320px; margin: 0 auto; line-height: 1.5; }

/* ===== Cart Drawer ===== */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  backdrop-filter: blur(2px);
}
.overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 201;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
}
.cart-drawer.open { transform: translateY(0); }

.drawer-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 12px auto 4px;
}
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-size: 18px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }
.drawer-header-actions {
  display: flex; align-items: center; gap: 8px;
}
.btn-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: none;
  font-size: 16px; cursor: pointer; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
}
.btn-clear-cart {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: none;
  font-size: 14px; cursor: pointer; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
}
.confirm-modal-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.confirm-modal-overlay.visible { opacity: 1; pointer-events: all; }
.confirm-modal {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 20px 20px;
  width: min(320px, calc(100vw - 40px));
  transform: scale(.92);
  transition: transform .2s cubic-bezier(0.22, 1.35, 0.36, 1);
}
.confirm-modal-overlay.visible .confirm-modal { transform: scale(1); }
.confirm-modal-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.confirm-modal-body {
  font-size: 14px; color: var(--text2);
  margin-bottom: 20px; line-height: 1.5;
}
.confirm-modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.confirm-btn {
  padding: 9px 20px; border-radius: 50px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.confirm-btn:active { transform: scale(.96); }
.confirm-btn-cancel { background: var(--surface2); color: var(--text2); }
.confirm-btn-danger { background: var(--primary); color: #fff; }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 16px; }
.cart-empty {
  text-align: center; padding: 40px; color: var(--text3);
}
.cart-empty .empty-icon { display: flex; justify-content: center; margin-bottom: 8px; }

/* ===== Notifications drawer ===== */
.btn-link-mini {
  background: transparent; border: none; color: var(--primary);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 8px;
}
.btn-link-mini:active { opacity: .6; }
.notif-row {
  display: flex; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .15s;
}
.notif-row:active { background: var(--surface2); }
.notif-dot {
  flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  background: transparent; margin-top: 6px;
}
.notif-row.notif-unread .notif-dot { background: var(--primary); }
.notif-row.notif-unread .notif-titulo { font-weight: 700; }
.notif-body { flex: 1; min-width: 0; }
.notif-titulo { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.notif-cuerpo { font-size: 13px; color: var(--text2); line-height: 1.4; margin-bottom: 6px; }
.notif-fecha  { font-size: 11px; color: var(--text3); }

.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  animation: slideIn .2s ease;
}
.cart-item:last-child { border-bottom: none; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.ci-img { width: 44px; height: 44px; object-fit: cover; flex-shrink: 0; border-radius: 8px; }
.ci-info { flex: 1; }
.ci-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ci-price { font-size: 12px; color: var(--text3); margin-top: 1px; }
.ci-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ci-qty {
  width: 28px; height: 28px; border-radius: 50%;
  background: #555; border: none;
  font-size: 13px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .ci-qty { background: #2a2e33; }
.ci-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); border: none;
  font-size: 16px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.ci-subtotal { font-size: 14px; font-weight: 700; color: var(--text); margin-top: 2px; }

.cart-footer { padding: 12px 16px 20px; border-top: 1px solid var(--border); }
.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.total-label { font-size: 15px; color: var(--text2); }
.total-amount { font-size: 24px; font-weight: 800; color: var(--text); }
.total-amount small { font-size: 13px; font-weight: 400; color: var(--text3); }

.btn-checkout {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  border: none; border-radius: 50px;
  font-size: 16px; font-weight: 700; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s;
}
.btn-checkout:active { transform: scale(.97); }
.btn-checkout:disabled { opacity: .5; pointer-events: none; }
.btn-ver-carrito { background: var(--qty-bg); color: var(--text2); box-shadow: none; }
.btn-ver-carrito:active { box-shadow: none; }

/* ===== Checkout Modal ===== */
.modal-wrap {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.modal-wrap.open { opacity: 1; pointer-events: all; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
}
.modal {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%; max-height: 95vh;
  overflow-y: auto; padding: 0 20px 30px;
  transform: translateY(40px);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
}
.modal-wrap.open .modal { transform: translateY(0); }

.modal-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 12px auto 16px; }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 20px; color: var(--text); }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 6px; }
.form-group input, .form-group textarea {
  width: 100%; padding: 13px 16px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: 15px; color: var(--text);
  outline: none; transition: border-color .2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: none; height: 80px; }

/* ===== Map modal ===== */
.map-modal-wrap {
  position: fixed; inset: 0; z-index: 350;
  display: none; flex-direction: column;
}
.map-modal-wrap.open { display: flex; }
.map-modal {
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
  background: var(--surface);
}
.map-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.map-modal-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.map-modal-body {
  flex: 1; position: relative; overflow: hidden;
  min-height: 0;
}
#mapContainer { width: 100%; height: 100%; }
.map-pin-center {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  pointer-events: none; z-index: 500;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
}
.map-modal-footer {
  padding: 12px 16px 16px;
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.map-gps-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px 16px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 50px;
  font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s;
}
.map-gps-btn:hover { background: var(--border); }
.map-gps-btn:active { transform: scale(.97); }
.map-gps-btn:disabled { opacity: .5; pointer-events: none; }
.map-footer-actions { display: flex; gap: 10px; }
.map-footer-actions .btn-checkout { flex: 1; margin: 0; }

/* ===== Geolocation prompt ===== */
.geo-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.55);
  display: none; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  padding: 20px;
}
.geo-overlay.show { display: flex; opacity: 1; pointer-events: all; }

.geo-card {
  background: var(--surface); border-radius: 20px;
  padding: 32px 24px 24px; text-align: center;
  max-width: 340px; width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  transform: scale(.95) translateY(20px);
  transition: transform .3s;
}
.geo-overlay.show .geo-card { transform: scale(1) translateY(0); }

.geo-icon { font-size: 3rem; margin-bottom: 12px; }
.geo-title { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.geo-desc { font-size: .82rem; color: var(--text2); line-height: 1.5; margin-bottom: 20px; }

.geo-buttons { display: flex; flex-direction: column; gap: 8px; }
.geo-btn {
  width: 100%; padding: 12px; border: none; border-radius: 12px;
  font-size: .92rem; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s;
}
.geo-btn:active { transform: scale(.97); }
.geo-btn-primary { background: var(--primary); color: #fff; }
.geo-btn-primary:hover { background: #e55a26; }
.geo-btn-secondary { background: var(--surface2); color: var(--text2); }
.geo-btn-secondary:hover { background: var(--border); }

.order-summary {
  background: var(--surface2); border-radius: var(--radius);
  padding: 14px; margin-bottom: 20px;
}
.order-summary h3 { font-size: 14px; color: var(--text2); margin-bottom: 10px; }
.summary-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.summary-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; color: var(--text); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ===== Confirmation screen ===== */
.confirm-screen {
  display: none; flex-direction: column; align-items: center;
  text-align: center; padding: 20px 0 10px;
}
.confirm-screen.show { display: flex; }
.confirm-icon { margin-bottom: 16px; animation: popIn .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.confirm-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.confirm-num { font-size: 28px; font-weight: 900; color: var(--primary); margin-bottom: 6px; letter-spacing: 1px; }
.confirm-sub { font-size: 14px; color: var(--text2); margin-bottom: 24px; }
.btn-nuevo {
  padding: 14px 32px; background: var(--primary);
  border: none; border-radius: 50px;
  font-size: 15px; font-weight: 700; color: #fff;
  cursor: pointer; box-shadow: 0 4px 16px rgba(255,160,0,.35);
}

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 8px;
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0; border: none; background: transparent;
  cursor: pointer; color: var(--text3);
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
  transition: color .15s;
  position: relative;
}
.nav-tab .nav-icon { display: flex; justify-content: center; }
.nav-tab .nav-icon i { font-size: 22px; }
.nav-tab.active { color: var(--primary); }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; z-index: 500;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--surface);
  padding: 12px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: all .25s;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Pedidos section ===== */
#pedidosSection {
  padding: calc(var(--header-h) + 10px) 10px calc(var(--nav-h) + 10px);
}
.pcard {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.pcard-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}
.pcard-num   { font-weight: 700; font-size: .95rem; }
.pcard-fecha { font-size: .78rem; color: var(--text2); margin-top: 2px; }
.pcard-estado {
  font-size: .7rem; font-weight: 700; padding: 4px 10px;
  border-radius: 50px; text-transform: uppercase; letter-spacing: .04em;
  white-space: nowrap;
}
.pcard-estado-pendiente  { background: #dbeafe; color: #1d4ed8; }
.pcard-estado-preparando { background: #fef3c7; color: #92400e; }
.pcard-estado-listo      { background: #d1fae5; color: #065f46; }
.pcard-estado-entregado  { background: #dcfce7; color: #15803d; }
.pcard-estado-cancelado  { background: #fee2e2; color: #991b1b; }
.pcard-items { border-top: 1px solid var(--border); padding-top: 10px; margin-bottom: 10px; }
.pcard-item  {
  display: flex; justify-content: space-between;
  font-size: .84rem; color: var(--text2); padding: 3px 0;
}
.pcard-item span { font-weight: 600; color: var(--text); }
.pcard-foot    { border-top: 1px solid var(--border); padding-top: 10px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.pcard-total   { font-weight: 700; font-size: 1rem; color: var(--primary); }
.pcard-pago    { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pcard-metodo  { font-size: .72rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.pcard-metodo-mp { background: #e8f4fd; color: #009ee3; }
.pcard-metodo-ef { background: #e8f8ed; color: #28a745; }
.pcard-pago-estado  { font-size: .72rem; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.pcard-pago-aprobado  { background: #d1fae5; color: #059669; }
.pcard-pago-pendiente { background: #fef3c7; color: #d97706; }

/* ===== Perfil section ===== */
#perfilSection {
  padding: 0 10px calc(var(--nav-h) + 10px);
}

.perfil-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.perfil-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 20px;
}

.perfil-info {
  width: 100%;
  display: flex; flex-direction: column; gap: 10px;
}

.perfil-nombre {
  font-size: 20px; font-weight: 800; color: var(--text);
  margin-bottom: 4px;
}

.perfil-fila {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px; color: var(--text2);
  text-align: left;
  min-width: 0;
}
.perfil-fila > span:last-child {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.perfil-icono { font-size: 16px; flex-shrink: 0; }

.perfil-btn-edit {
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-top: 4px; padding: 12px 18px;
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 50px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s;
  box-shadow: none;
  background-image: none;
}
.perfil-btn-logout {
  width: 100%; margin-top: -6px;
}

.perfil-section-title {
  width: 100%;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  color: var(--text2); letter-spacing: .04em;
  margin: 18px 0 2px; padding: 0 2px;
  text-align: left;
}
.perfil-section-title--row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.dir-add-btn {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); border-radius: 50px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; text-transform: none; letter-spacing: 0;
}
.dir-add-btn:active { background: var(--border); }

.dir-lista {
  width: 100%;
  display: flex; flex-direction: column; gap: 8px;
  margin-top: -6px; margin-bottom: 8px;
}
.dir-empty {
  font-size: 13px; color: var(--text2); text-align: center;
  padding: 14px; border: 1px dashed var(--border); border-radius: 12px;
}

.dir-card {
  width: 100%;
  background: var(--surface2); border: none;
  border-radius: 12px; padding: 12px 14px;
  text-align: left;
}
.dir-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.dir-card-icon { font-size: 18px; }
.dir-card-etiqueta {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.dir-principal-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  color: var(--primary); background: transparent;
  border: 1px solid var(--primary); border-radius: 50px;
  padding: 2px 8px;
}
.dir-card-dir   { font-size: 13px; color: var(--text); line-height: 1.4; }
.dir-card-lugar { font-size: 12px; color: var(--text2); margin-top: 2px; }
.dir-card-actions {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.dir-btn-text {
  background: none; border: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--primary);
  padding: 0;
}
.dir-btn-text:active { opacity: .7; }
.dir-btn-danger { color: #dc2626; }

.check-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.check-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--primary);
}

/* Selector de direcciones en checkout */
.co-dir-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; margin-bottom: 8px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer;
}
.co-dir-option input[type="radio"] {
  margin-top: 3px; accent-color: var(--primary);
}
.co-dir-option--active {
  border-color: var(--primary);
  background: rgba(255, 160, 0, 0.08);
}
.co-dir-icon { font-size: 20px; flex-shrink: 0; }
.co-dir-text {
  display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1;
}
.co-dir-etiqueta { font-size: 14px; font-weight: 700; color: var(--text); }
.co-dir-principal { font-size: 11px; color: var(--primary); font-weight: 600; }
.co-dir-dir   { font-size: 13px; color: var(--text); }
.co-dir-lugar { font-size: 12px; color: var(--text2); }
.co-dir-empty {
  font-size: 13px; color: var(--text2); text-align: center;
  padding: 10px; border: 1px dashed var(--border); border-radius: 10px;
}
.co-add-dir-btn {
  display: block; width: 100%; margin: 8px 0 16px;
  padding: 10px; background: transparent;
  border: 1.5px dashed var(--border); border-radius: 12px;
  font-size: 13px; font-weight: 600; color: var(--primary); cursor: pointer;
}
.co-add-dir-btn:active { background: var(--primary-lt); }

.perfil-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text3);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.perfil-empty-icon { margin-bottom: 4px; }
.perfil-empty p    { font-size: 15px; font-weight: 600; color: var(--text2); }
.perfil-empty small { font-size: 13px; }

.perfil-geo-link {
  color: var(--primary); font-weight: 600; font-size: 13px;
  text-decoration: none;
}
.perfil-geo-link:hover { text-decoration: underline; }

.perfil-btn-ubic {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 10px; padding: 8px 16px;
  border: none; border-radius: 50px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s;
}
.perfil-btn-ubic:active { transform: scale(.95); }
.perfil-btn-ubic--detectar {
  background: var(--primary); color: #fff;
}
.perfil-btn-ubic--detectar:hover { background: var(--primary-dk); }
.perfil-btn-ubic--quitar {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border);
}
.perfil-btn-ubic--quitar:hover { background: var(--surface3, var(--surface2)); }

.perfil-geo-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.perfil-geo-status {
  flex: 1; display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2);
}
.perfil-geo-btn {
  flex-shrink: 0; padding: 7px 16px;
  background: var(--primary); color: #fff;
  border: none; border-radius: 50px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s;
}
.perfil-geo-btn:active  { transform: scale(.95); }
.perfil-geo-btn:hover   { background: var(--primary-dk); }
.perfil-geo-btn:disabled { opacity: .5; pointer-events: none; }

/* ===== Loading spinner ===== */
.spinner {
  grid-column: 1 / -1;
  display: flex; justify-content: center; padding: 40px;
  color: var(--text3);
}
.spin {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Spinner de "cargando más" para el scroll infinito (más chico que el inicial). */
.spinner-load-more { padding: 20px; }
.spinner-load-more .spin { width: 24px; height: 24px; border-width: 2px; }

/* Centinela invisible al final del grid; ocupa toda la fila y dispara IntersectionObserver. */
.products-sentinel { grid-column: 1 / -1; height: 1px; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ===== Product Detail Modal ===== */
.product-modal { max-width: none; padding: 0 16px 24px; }
.product-modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--surface2); border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 16px; cursor: pointer;
  color: var(--text2); display: flex; align-items: center; justify-content: center;
}
.product-detail-img {
  margin: 4px 0 12px;
  background: #ffffff;
  border-radius: var(--radius);
  display: flex; justify-content: center; align-items: center;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.pd-fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), #ff9f1c);
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; cursor: pointer; color: rgba(255,255,255,.5);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: color .15s, transform .15s;
}
.pd-fav-btn:active { transform: scale(.95); }
.pd-fav-btn.active { color: rgba(255,255,255,1); }
.product-detail-img img {
  width: 100%; max-height: 200px; object-fit: contain;
}
.product-detail-body { padding: 0; }
.product-detail-name {
  font-size: 20px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.product-detail-unit {
  font-size: 14px; color: var(--text2); margin-bottom: 8px;
}
.product-detail-price {
  font-size: 22px; font-weight: 800; color: var(--primary);
  margin-bottom: 6px;
}
.product-detail-stock {
  font-size: 13px; margin-bottom: 16px;
}
.product-detail-stock.in-stock { color: var(--green); }
.product-detail-stock.out-stock { color: var(--red); }

.product-detail-actions {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 120px; justify-content: flex-end;
}
.pd-qty-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 7px 6px;
  background: var(--qty-bg);
  border: 1px solid var(--border); border-radius: 50px;
}
.pd-qty-btn {
  width: 80px; height: 36px; border-radius: 50px; border: none;
  background: var(--primary); color: #fff;
  font-size: 20px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, transform .1s;
}
.pd-qty-btn:active { transform: scale(.95); background: var(--primary-dk); }
.pd-qty-label {
  flex: 1; text-align: center;
  font-size: 18px; font-weight: 700; color: var(--text2);
}
.btn-share {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 18px;
  background: var(--qty-bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 50px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn-share:active { transform: scale(.97); }
.btn-share:hover { background: var(--border); }

/* ===== Modal detalle pedido ===== */
.ped-modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.5); align-items: flex-end; justify-content: center;
}
.ped-modal-backdrop.open { display: flex; }
.ped-modal {
  background: var(--surface); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 540px; max-height: 88vh;
  display: flex; flex-direction: column;
  animation: slideUp .25s ease;
}
.ped-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 12px; border-bottom: 1px solid var(--border);
}
.ped-modal-num  { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.ped-modal-fecha { font-size: .8rem; color: var(--text3); margin-top: 2px; }
.ped-modal-body { overflow-y: auto; padding: 16px 20px 32px; display: flex; flex-direction: column; gap: 16px; }
.pm-badge { display: inline-block; padding: 5px 14px; border-radius: 50px; font-weight: 700; font-size: .85rem; }
.pm-steps { display: flex; align-items: flex-start; gap: 0; }
.pm-step  { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.pm-step-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; z-index: 1; }
.pm-step-dot.done    { background: #22c55e; color: #fff; }
.pm-step-dot.active  { background: #f59e0b; color: #fff; box-shadow: 0 0 0 4px #fef3c7; }
.pm-step-dot.pending { background: var(--border); color: var(--text3); }
.pm-step-label { font-size: .6rem; color: var(--text3); margin-top: 5px; text-align: center; }
.pm-step-line { position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; z-index: 0; }
.pm-step-line.done    { background: #22c55e; }
.pm-step-line.pending { background: var(--border); }
.pm-section { display: flex; flex-direction: column; gap: 0; }
.pm-section-title { font-size: .72rem; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.pm-item-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pm-item-row:last-child { border-bottom: none; }
.pm-item-nombre { font-size: .9rem; color: var(--text); font-weight: 500; }
.pm-item-cant   { font-size: .78rem; color: var(--text3); }
.pm-item-precio { font-size: .9rem; font-weight: 600; color: var(--text); }
.pm-total-row { display: flex; justify-content: space-between; padding-top: 12px; font-weight: 800; font-size: 1.05rem; color: var(--text); }
.pm-pago-row  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== Checkout confirm step ===== */
.co-user-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px;
}
.co-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; flex-shrink: 0;
}
.co-user-info { display: flex; flex-direction: column; gap: 4px; }
.co-user-name { font-size: 15px; font-weight: 700; color: var(--text); }
.co-user-detail { font-size: 13px; color: var(--text2); display: flex; align-items: center; gap: 6px; }
.co-detail-icon { font-size: 11px; color: var(--text3); }
.co-section-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.co-address {
  font-size: 14px; color: var(--text); background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 11px 14px; margin-bottom: 18px;
}
.co-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.co-item { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.co-item-name { color: var(--text); }
.co-item-qty { color: var(--text3); font-size: 12px; }
.co-item-price { font-weight: 600; color: var(--text); }
.co-total-row {
  display: flex; justify-content: space-between;
  font-size: 16px; font-weight: 800; color: var(--text);
  border-top: 1.5px solid var(--border); padding-top: 10px; margin-bottom: 20px;
}

/* ===== Método de pago ===== */
.co-pago-options { display: flex; gap: 10px; margin-bottom: 16px; }
.co-pago-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 8px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.co-pago-opt i { font-size: 22px; }
.co-pago-opt.active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(255,160,0,.08);
}

/* ===== OTP Login ===== */
.otp-sub { font-size: 14px; color: var(--text2); margin-bottom: 20px; line-height: 1.5; }
.otp-sub strong { color: var(--text); }
.otp-actions { display: flex; gap: 10px; margin-top: 10px; }
.otp-actions .btn-checkout { flex: 1 1 0; padding: 14px 8px; font-size: 14px; }
.btn-checkout-secondary {
  background: var(--border);
  color: var(--text2);
  margin-top: 10px;
}
.otp-boxes {
  display: flex; justify-content: center; gap: 8px;
  margin: 8px 0 20px;
}
.otp-box {
  width: 44px; height: 54px;
  text-align: center;
  font-size: 22px; font-weight: 700;
  color: var(--text);
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  caret-color: var(--primary);
  transition: border-color .15s, transform .1s;
  -moz-appearance: textfield;
  appearance: textfield;
}
.otp-box::-webkit-outer-spin-button,
.otp-box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.otp-box:focus { border-color: var(--primary); transform: scale(1.05); }
.otp-box:not(:placeholder-shown) { border-color: var(--primary); }
@media (max-width: 360px) {
  .otp-boxes { gap: 6px; }
  .otp-box { width: 38px; height: 48px; font-size: 20px; }
}
.perfil-login-btn { margin-top: 20px; width: 100%; }

/* ===== Botón cancelar pedido (modal detalle) ===== */
.btn-continuar-pago {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; margin-bottom: 0; padding: 12px 18px;
  background: #009ee3; color: #fff;
  border: none; border-radius: 50px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-continuar-pago:active { background: #0082c0; }
.btn-continuar-pago:disabled { opacity: .6; cursor: default; }
.btn-cancelar-pedido {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 4px; padding: 12px 18px;
  background: transparent; color: var(--red);
  border: 1px solid var(--red); border-radius: 50px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.btn-cancelar-pedido:active { background: rgba(239,68,68,.08); }
.btn-cancelar-pedido:disabled { opacity: .6; cursor: default; }

/* ===== Toggle switch (Configuración) ===== */
.toggle-row {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  margin-bottom: 8px;
}
.toggle-label { font-size: .9rem; font-weight: 600; color: var(--text); }
.toggle-switch { display: flex; align-items: center; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
  width: 44px; height: 24px; border-radius: 12px;
  background: var(--border); position: relative; transition: background .2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--primary); }
.toggle-switch input:disabled + .toggle-track { opacity: .5; }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }

/* ===== Banner iOS: instalar PWA ===== */
/* ===== Checkout: paso resumen ===== */
.co-resumen {
  display: flex; flex-direction: column; gap: 0;
  border: 1.5px solid var(--border); border-radius: 14px;
  overflow: hidden; margin-bottom: 16px;
}
.co-resumen-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.co-resumen-row:last-child { border-bottom: none; }
.co-resumen-icon {
  font-size: 17px; color: var(--primary);
  flex-shrink: 0; width: 22px; text-align: center; padding-top: 1px;
}
.co-resumen-content {
  display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;
}
.co-resumen-label {
  font-size: 11px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: .04em;
}
.co-resumen-valor {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.co-resumen-detalles-btn {
  flex-shrink: 0; align-self: center;
  padding: 5px 12px; border-radius: 50px;
  border: 1.5px solid var(--primary); background: transparent;
  color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer;
  transition: background .15s, color .15s;
}
.co-resumen-detalles-btn:active { background: rgba(255,160,0,.12); }
.co-resumen-desglose {
  margin-bottom: 4px;
}
#envioInfoIcon {
  color: var(--primary); cursor: pointer;
  font-size: 13px; vertical-align: middle; margin-left: 5px;
}
.envio-desglos-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 14px; color: var(--text2);
}
.envio-desglos-row span:last-child { font-weight: 600; color: var(--text); }
.envio-desglos-row.total {
  border-bottom: none; padding-top: 12px; margin-top: 4px;
  font-size: 15px; font-weight: 700; color: var(--text);
}
.envio-desglos-row.total span:last-child { font-size: 18px; color: var(--primary); }
.co-resumen-desglose-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 4px;
  font-size: 13px; color: var(--text2);
  border-top: 1px solid var(--border);
}
.co-resumen-desglose-row:first-child { border-top: none; }
.co-resumen-desglose-row span:last-child { font-weight: 600; color: var(--text); }
.co-resumen-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; margin-bottom: 16px;
  font-size: 15px; font-weight: 700; color: var(--text);
  border-top: 1.5px solid var(--border);
}
.co-resumen-total span:last-child { font-size: 22px; color: var(--primary); }

/* ===== Checkout: paso horario de entrega ===== */
.co-horario-fechas {
  display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;
}
.co-horario-fecha-btn {
  flex: 1; padding: 10px 8px; border-radius: 50px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  min-width: 80px;
}
.co-horario-fecha-btn.active {
  border-color: var(--primary); color: var(--primary);
  background: rgba(255,160,0,.08);
}
.co-horario-franjas {
  display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px;
}
.co-horario-franja {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text2); font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, color .15s, background .15s;
  width: 100%;
}
.co-horario-franja.active {
  border-color: var(--primary); color: var(--text);
  background: rgba(255,160,0,.08);
}
.co-horario-franja-icon {
  font-size: 20px; color: var(--primary); flex-shrink: 0;
  width: 28px; text-align: center;
}
.co-horario-franja.active .co-horario-franja-icon { color: var(--primary); }
.co-horario-franja-texto { display: flex; flex-direction: column; gap: 2px; }
.co-horario-franja-titulo { font-weight: 700; font-size: 14px; color: var(--text); }
.co-horario-franja-sub { font-size: 12px; color: var(--text2); }

.pwa-installed-screen {
  display: none; position: fixed; inset: 0; z-index: 3000;
  background: var(--surface); color: var(--text);
  flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.pwa-installed-screen.open { display: flex; }
.pwa-installed-screen img { height: 60px; width: auto; margin-bottom: 28px; }
.pwa-installed-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 14px;
}
.pwa-installed-text {
  font-size: .95rem; color: var(--text2); line-height: 1.5;
  margin: 0 0 12px; max-width: 320px;
}
.pwa-installed-text b { color: var(--primary); }

.ios-install-backdrop {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,.55);
  align-items: center; justify-content: center;
  padding: 16px;
}
.ios-install-backdrop.open { display: flex; animation: fadeIn .2s ease-out; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.ios-install-card {
  position: relative;
  background: var(--surface); color: var(--text);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  max-width: 380px; width: 100%;
  box-shadow: var(--shadow-lg);
}
.ios-install-close {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: none; color: var(--text2);
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.ios-install-close:active { background: rgba(0,0,0,.06); }
.ios-install-icon {
  font-size: 34px; color: var(--primary);
  text-align: center; margin-bottom: 8px;
}
.ios-install-title {
  font-size: 1.05rem; font-weight: 700;
  text-align: center; margin-bottom: 8px;
}
.ios-install-text {
  font-size: .85rem; color: var(--text2);
  text-align: center; margin-bottom: 12px; line-height: 1.4;
}
.ios-install-steps {
  padding-left: 20px; font-size: .85rem; color: var(--text);
}
.ios-install-steps li { margin-bottom: 6px; }
.ios-install-steps b { color: var(--primary); }
