﻿/* --- Base / tokens --- */
:root {
  --brand: #ff6b35;
  --brand-700: #e65f2f;
  --accent: #00a884;
  /* Action buttons color (pedido: rojito) */
  --action: #EC3035;
  --action-700: #c6282d;
  --bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --surface: #f7f7f8;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 10px 20px rgba(0,0,0,.06);
  /* Mobile tweaks */
  --header-h-mobile: 64px;
  --bottom-bar-h: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Noto Sans, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* --- Header --- */
.topbar {
  background: var(--surface);
  color: var(--muted);
  font-size: .9rem;
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
}
.topbar .container { padding: .4rem 0; overflow: hidden; }
.marquee { position: relative; overflow: hidden; }
.marquee-track { display: inline-flex; gap: 2rem; align-items: center; white-space: nowrap; animation: marquee 22s linear infinite; will-change: transform; }
.marquee-track:hover { animation-play-state: paused; }
.marquee .item { flex: 0 0 auto; color: var(--muted); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

header.site-header { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--border); backdrop-filter: saturate(140%) blur(6px); }
.nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  min-height: 72px;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .2px; }
.brand .logo {
  width: 160px; height: 110px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); background: transparent;
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand span { font-size: 1.15rem; }

nav.primary { display: flex; gap: .6rem; align-items: center; justify-content: center; }
nav.primary a { padding: .6rem .8rem; border-radius: 10px; color: #374151; font-weight: 700; transition: color 150ms ease; }
nav.primary a:hover { background: var(--surface); color: #dc332a; }

.actions { display: flex; gap: .6rem; align-items: center; justify-content: flex-end; flex-wrap: nowrap; }
.search {
  position: relative; flex: 1 1 280px; max-width: 440px; min-width: 0;
}
.search input 
{
  width: 100%;
  padding: .7rem .9rem .7rem 2.3rem;
  border: 1px solid var(--border); 
  border-radius: 12px; 
  background: #fff; 
  outline: none;
}
.search svg { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #9ca3af; }
.icon-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.icon-btn:hover { background: var(--surface); }
/* Search ubicada en el header (sustituye al menú en móm?vil) */
.header-search { display: none; }

/* User auth prompt */
.user-auth { display: grid; gap: .2rem; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-left: 1rem; text-align: right; flex-shrink: 0; }
.user-auth .welcome { font-size: .95rem; color: #374151; white-space: nowrap; }
.user-auth .welcome strong { font-weight: 800; }
.user-auth .links { font-size: .9rem; text-align: center; }
.user-auth .links a { color: var(--brand); font-weight: 600; }
.user-auth .links a:hover { color: var(--brand-700); text-decoration: underline; }
.user-auth .sep { color: #9ca3af; margin: 0 .25rem; }

/* Mobile nav */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  /* Fijo en móm?viles + safe area notch */
  header.site-header {
    position: fixed; top: 0; left: 0; right: 0; width: 100%;
    padding-top: env(safe-area-inset-top);
    -webkit-backdrop-filter: saturate(140%) blur(6px);
    backdrop-filter: saturate(140%) blur(6px);
  }
  body { padding-top: calc(var(--header-h-mobile) + env(safe-area-inset-top)); }

  /* Fallback solo para iOS 11–12 (legacy) */
  @supports (padding-top: constant(safe-area-inset-top)) {
    header.site-header { padding-top: constant(safe-area-inset-top); }
    body { padding-top: calc(var(--header-h-mobile) + constant(safe-area-inset-top)); }
  }

  .nav { grid-template-columns: auto auto 1fr; gap: .75rem; padding: .7rem 0; }
  /* Menú móm?vil: se despliega debajo del header fijo */
  nav.primary { position: absolute; top: 100%; left: 0; right: 0; background: rgba(255,255,255,.98); border-bottom: 1px solid var(--border); padding: .6rem .8rem; display: none; box-shadow: 0 10px 25px rgba(0,0,0,.08); z-index: 120; }
  nav.primary.open { display: flex; flex-wrap: wrap; gap: .4rem; position: fixed; top: calc(var(--header-h-mobile) + env(safe-area-inset-top)); left: 0; right: 0; z-index: 200; }
  .search { grid-column: 1 / -1; order: 4; }
  .menu-toggle { display: inline-flex; }
  /* Simplificar barra superior en móm?vil para evitar solapado */
  .topbar { display: none; }
  /* Mantener altura de header consistente en móm?vil */
  .site-header .nav { min-height: var(--header-h-mobile); }
  /* Evitar que elementos secundarios estiren el header en móm?vil */
  .user-auth { display: none; }
}


/* === Product Cards: enforce exact desktop look, 2-cols on phone === */
/* Grid on phone: 2 columns */
@media (max-width: 700px) {
  #productos .products { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Reducir elementos en header en pantallas muy pequeñas para mayor claridad */
@media (max-width: 680px) { .user-auth { display: none; } }
@media (max-width: 520px) { .search { display: none; } }

/* --- Hero --- */
.hero { padding: 2rem 0; }
.hero .container { height: auto; width: 100%; max-width: 1200px; }
.hero .carousel { height: auto; width: 100%; }
.hero .carousel-main { position: relative; width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow); }
.hero .wrap { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; align-items: center; position: relative; z-index: 1; }
.hero-inline-logo { display: none !important; }
.hero-inline-logo img { width: 160px; max-width: 80vw; height: auto; object-fit: contain; display: block; margin: 0 auto; border-radius: 16px; box-shadow: var(--shadow); }
.hero .wrap > div:first-child { text-align: center; }
.hero h1 { font-size: clamp(1.6rem, 3vw + 1rem, 3rem); line-height: 1.1; margin: 0 0 .6rem; }
.hero p { color: var(--muted); margin: 0 0 1rem; }
.cta { display: block; margin: 0 auto; text-align: center; background: var(--action); color: #fff; border: none; border-radius: 12px; padding: .8rem 1rem; box-shadow: var(--shadow); cursor: pointer; }
.cta:hover { background: var(--action-700); }
.badge { display: inline-block; font-size: .85rem; padding: .25rem .55rem; border-radius: 999px; background: #fff0ea; color: var(--brand-700); border: 1px solid #ffd4c3; margin-bottom: .6rem; }
.hero-card { border: 1px solid var(--border); border-radius: 16px; background: #fff; padding: 1rem; box-shadow: var(--shadow); }
.hero-card .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.hero-card .tile { border: 1px solid var(--border); border-radius: 12px; padding: .8rem; display: grid; place-items: center; background: var(--surface); font-weight: 600; color: #374151; }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .hero-inline-logo { display: flex !important; justify-content: center; margin: 0 auto .8rem; } }

/* --- Products --- */
.section { padding: 1.6rem 0 2.2rem; }
.section h2 { margin: 0 0 1rem; font-size: 1.4rem; }
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 1100px) { .products { grid-template-columns: repeat(3, 1fr);} }
@media (max-width: 760px) { .products { grid-template-columns: repeat(2, 1fr);} }
/* Mantener 2 columnas también en móm?viles pequeños */
/* En móm?viles pequeños, 2 columnas también */
@media (max-width: 460px) { 
  .products { grid-template-columns: repeat(2, 1fr);}}

/* Base card */
.card { border: 1px solid var(--border); border-radius: 16px; background: #fff; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 6px 18px rgba(0,0,0,.06); transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }
.card .media { background: #fff6f2; display: flex; justify-content: center; align-items: center; height: 250px; overflow: hidden; padding: 10px 0; border-bottom: 1px solid #f3f3f3; }
.card .media img { max-height: 100%; max-width: 100%; object-fit: contain; display: block; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.card .body { text-align: center; padding: 1rem; }
.card .title { margin: 0 0 .4rem; font-size: 1rem; font-weight: 600; color: #1f2937; }
.card .price { color: var(--brand-700); font-weight: 700; font-size: 1.1rem; }
/* Actions apiladas como el diseño (Ver más arriba, Agregar abajo) */
.card .actions { display:flex; flex-direction:column; gap:.6rem; align-items:stretch; justify-content:stretch; padding:0 1rem 1rem; }
.card .actions .more, .card .actions .add { margin: 0; width: 100%; }
.card .add {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; background: var(--action); color: #fff; border: none; padding: .7rem .9rem; border-radius: 10px; cursor: pointer; font-weight: 600; transition: background .2s ease;
}
.card .add:hover { background: var(--action-700); }



/* --- Newsletter --- */
.newsletter { border: 1px dashed var(--border); border-radius: 16px; padding: 1rem; background: #fff; display: grid; gap: .7rem; }
.newsletter h3, .newsletter p { text-align: center; }
/* En móm?vil reducir aún más el título */
@media (max-width: 900px) { .newsletter h3 { font-size: .9rem; line-height: 1.15; } }
.newsletter form { display: flex; gap: .6rem; flex-wrap: wrap; }
.newsletter input { padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--border); }
.newsletter button { background: var(--action); color: #fff; border: none; border-radius: 10px; padding: .7rem 1rem; }
.newsletter button:hover { background: var(--action-700); }

/* Botón Ver más (secundario, arriba del comprar) */
.card .more {
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--action);
  border: 1px solid var(--action);
  padding: .6rem .9rem; margin: .8rem .8rem 0 .8rem; border-radius: 10px; cursor: pointer;
}
.card .more:hover { background: #fff5f5; }

/* --- Footer --- */
footer { border-top: 1px solid var(--border); background: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 1rem; padding: 1.6rem 0; position: relative; }
.footer-grid h4 { margin: 0 0 .6rem; }
.footer-grid a { color: #374151; }
/* Footer brand: centrar logo y hacerlo grande */
footer .brand { justify-content: center; align-items: center; text-align: center; gap: .6rem; flex-direction: column; margin-inline: auto; }
footer .brand .logo { width: 300px; height: 300px; border-radius: 24px; box-shadow: var(--shadow); }
footer .brand span { display: none; }
/* En escritorio, mostrar el logo arriba de todas las secciones */
@media (min-width: 901px) {
  .footer-grid { padding-top: 320px; }
  .footer-grid > div:first-child .brand { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); }
}
@media (max-width: 520px) { footer .brand .logo { width: 300px; height: 300px; } }
.subfooter { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding: .8rem 0; text-align: center; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.map { display: flex; justify-content: center; }
.footer-grid .map { display: none !important; }
.footer-map { padding: .4rem 0 .8rem; }
.map-embed { width: min(100%, 720px); height: auto; aspect-ratio: 16/9; min-height: 200px; border: 0; border-radius: 12px; box-shadow: var(--shadow); display: block; margin-inline: auto; background: #f5f5f5; }
@media (max-width: 520px) { .map-embed { min-height: 160px; } }

/* --- Responsive refinements appended --- */
/* Mejor tipografía de títulos en todas las pantallas */
.section h2 { font-size: clamp(1.2rem, 0.6rem + 1.8vw, 1.6rem); }

/* Grid de tiles del hero más flexible */
@media (max-width: 700px) { .hero-card .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 380px) { .hero-card .grid { grid-template-columns: 1fr; } }

/* Newsletter apilada en pantallas chicas */
@media (max-width: 520px) { .newsletter form { flex-direction: column; } .newsletter button { width: 100%; } }
/* Newsletter en escritorio: campo más compacto y botón debajo */
@media (min-width: 901px) {
  /* Similar a la barra de búsqueda: más ancho, no tan alto */
  .newsletter form { flex-direction: column; align-items: stretch; gap: .5rem; max-width: 560px; margin-inline: auto; }
  .newsletter input { padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--border); }
  .newsletter button { width: 100%; }
}

/* Ajustes móm?viles globales adicionales */
@media (max-width: 900px) {
  /* Enlaces del menú en dos columnas para mejor toque */
  nav.primary.open a { flex: 1 1 48%; text-align: center; }
  /* Offset de anclas bajo header fijo (safe-area iOS) */
  .hero, .section { scroll-margin-top: calc(var(--header-h-mobile) + env(safe-area-inset-top) + 8px); }
  .hero, .section { scroll-margin-top: calc(var(--header-h-mobile) + constant(safe-area-inset-top) + 8px); }
}
/* Overrides móm?viles: mostrar login y mover botón menú a la derecha */
@media (max-width: 900px) {
  .user-auth { display: grid !important; }
  .user-auth .welcome { font-size: .9rem; }
  .user-auth .links { font-size: .85rem; }
  .nav { grid-template-columns: auto 1fr auto; }
  .menu-toggle { grid-column: 3; justify-self: end; }
  .actions { grid-column: 2; justify-content: flex-end; }
}
/* Ocultar barra rápida por defecto (solo móm?vil la muestra) */
.mobile-quickbar { display: none; }
.mobile-authbar { display: none; }

/* Mobile compact header + quickbar */
@media (max-width: 900px) {
  /* En header solo marca + búsqueda */
  .menu-toggle { display: none !important; }
  .actions .icon-btn { display: none !important; }
  .user-auth { display: none !important; }
  .nav { grid-template-columns: auto 1fr; grid-template-areas: 'brand search'; align-items: center; column-gap: .75rem; padding-bottom: .25rem; }
  header.site-header .brand { grid-area: brand; }
  /* Ocultar la búsqueda de acciones en móm?vil; usar la del header */
  .actions .search { display: none !important; }
  /* Mostrar búsqueda en el header, alineada al logo */
  .header-search { display: block !important; grid-area: search !important; grid-column: auto !important; order: 1 !important; align-self: center; width: 100%; }
  .header-search input { height: 36px; padding: 0 .9rem 0 2.3rem; }
  /* Ocultar texto de marca en móm?vil */
  header.site-header .brand span { display: none; }
  /* Quickbar fija abajo (tipo ML) */
  .mobile-quickbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .mobile-quickbar .container { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .4rem 0 .6rem; min-height: var(--bottom-bar-h); align-items: center; }
  .quick-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .8rem; border: 1px solid var(--border); background: #fff; border-radius: 12px; }
  .quick-btn svg { width: 22px; height: 22px; }
  /* Evitar que tape contenido/footer */
  body { padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(var(--bottom-bar-h) + constant(safe-area-inset-bottom)); }
  /* Barra de login/registro bajo el header */
  .mobile-authbar { display: block; border-bottom: 1px solid var(--border); background: #fff; }
  /* Subir un poco la barra de acceso y reducir su padding superior */
  .mobile-authbar .container { display: flex; justify-content: center; gap: .25rem; padding: .2rem 0 .45rem; }
  .mobile-authbar a { color: var(--brand); font-weight: 600; }
  .mobile-authbar .sep { color: #9ca3af; margin: 0 .35rem; }
  .mobile-auth-user { display: flex; flex-direction: column; align-items: center; gap: .25rem; width: 100%; text-align: center; }
  .mobile-auth-user .mob-name { font-weight: 600; color: #111827; }
  .mobile-auth-user button { align-self: center; }
}

/* Iconos para quickbar en móm?vil (fallback) */
@media (max-width: 900px) {
  #menuToggleMobile::before { content: '?'; font-size: 20px; line-height: 1; margin-right: .35rem; }
  .mobile-quickbar a.quick-btn[href="carrito.html"] { font-size: 0; }
  .mobile-quickbar a.quick-btn[href="carrito.html"]::before { content: '??'; font-size: 20px; line-height: 1; margin-right: .35rem; }
  .mobile-quickbar a.quick-btn[href="carrito.html"] span { font-size: 14px; }
}
/* --- Overrides para restaurar header y nueva tabbar --- */
@media (max-width: 900px) {
  .mobile-quickbar { display: none !important; }
  /* Topbar arriba del header en móm?viles */
  .topbar { display: block !important; position: fixed; top: 0; left: 0; right: 0; z-index: 70; padding-top: env(safe-area-inset-top); }
  /* Header fijo en móm?viles para que siempre sea visible debajo de topbar */
  header.site-header { position: fixed; top: 0; left: 0; right: 0; width: 100%; }
  .menu-toggle { display: none !important; }
  /* Dejar espacio al contenido bajo el header fijo: se ajusta por JS */
  body { padding-top: 0; }
}

.mobile-tabbar { display: none; }
@media (max-width: 900px) {
  .mobile-tabbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); transition: transform .2s ease; }
  .mobile-tabbar .container { display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: .2rem 0 .35rem; min-height: var(--bottom-bar-h); }
  .tab-item { display: grid; justify-items: center; gap: .15rem; color: #374151; font-size: .78rem; }
  .mobile-tabbar button.tab-item { background: none; border: 0; padding: 0; }
  .tab-item .icon { width: 22px; height: 22px; }
  .tab-item.center { align-self: start; }
  .tab-item.center .icon-wrap { width: 56px; height: 56px; background: #fff; border: 2px solid var(--border); border-radius: 999px; display: grid; place-items: center; margin-top: -28px; box-shadow: 0 6px 18px rgba(0,0,0,.12); position: relative; }
  .tab-item.center .cart-badge { position: absolute !important; top: -8px !important; right: -8px !important; transform: none !important; z-index: 5; }
  .tab-item.center .cart-badge .badge-count { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
  .tab-item.active, .tab-item:hover { color: var(--brand-700); }
  .mobile-tabbar.push-down { transform: translateY(100%); }
  body { padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(var(--bottom-bar-h) + constant(safe-area-inset-bottom)); }
}

/* Drawer lateral móm?vil */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; visibility: hidden; transition: opacity .2s ease; z-index: 490; }
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.mobile-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(86%, 340px); background: #fff; border-left: 1px solid var(--border); transform: translateX(100%); transition: transform .25s ease; z-index: 500; display: flex; flex-direction: column; }
.mobile-drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--border); }
.drawer-close { border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: .35rem .6rem; cursor: pointer; }
.drawer-close:hover { background: var(--surface); }
.drawer-nav { display: flex; flex-direction: column; gap: .2rem; padding: .8rem; align-items: center; align-content: center; text-align: center; flex: 1; }
.drawer-nav a { padding: .65rem .6rem; border-radius: 10px; color: #374151; width: 100%; max-width: 260px; }
.drawer-nav a:hover { background: var(--surface); }
.drawer-nav hr { border: 0; border-top: 1px solid var(--border); margin: .6rem 0; }
.drawer-auth { padding: .85rem 1rem; border-bottom: 1px solid var(--border); display: grid; gap: .35rem; justify-items: center; text-align: center; }
.drawer-auth .auth-title { font-weight: 700; color: #111827; }
.drawer-auth .auth-links { display: inline-flex; align-items: center; gap: .3rem; flex-wrap: wrap; justify-content: center; }
.drawer-auth .auth-links a { color: var(--brand); font-weight: 700; }
.drawer-auth .auth-links .sep { color: #9ca3af; margin: 0 .25rem; }
.drawer-auth .auth-user { display: grid; gap: .35rem; }
.drawer-auth .auth-user .name { font-weight: 700; color: #111827; }
.drawer-auth .auth-user .meta { color: #6b7280; font-size: .9rem; }
.drawer-auth .auth-action { color: var(--brand); font-weight: 700; width: fit-content; }
body.no-scroll { overflow: hidden; }
@media (max-width: 900px) { .mobile-authbar { display: none !important; } }
@media (max-width: 900px) { .hero-card .grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  /* En móm?vil: achicar el 'label' del formulario (campo y botón) */
  .newsletter form { gap: .45rem; }
  /* Evitar que el input crezca por flex en columna */
  .newsletter input { padding: .7rem .9rem; border-radius: 12px; border: 1px solid var(--border); }
  .newsletter button { padding: .5rem .75rem; height: 36px; min-height: 36px; flex: 0 0 auto; }
}
/* Hero Carousel Styles */
.hero-carousel .carousel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}
.hero-carousel .carousel-main {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  width: 100%;
  height: auto;
}
.hero-carousel .carousel-main img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 2s ease;
}
.hero-carousel .carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: background 0.2s ease;
}
.hero-carousel .carousel-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}
.hero-carousel .carousel-prev {
  left: 10px;
}
.hero-carousel .carousel-next {
  right: 10px;
}
.hero-carousel .carousel-thumbnails {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 0.5rem;
}
.hero-carousel .carousel-thumbnails img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.hero-carousel .carousel-thumbnails img.active {
  border-color: var(--brand);
}
.hero-carousel .carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.hero-carousel .carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: background 0.2s ease;
}
.hero-carousel .carousel-dots .dot.active {
  background: var(--brand);
}

/* Desktop Carousel */
@media (min-width: 901px) {
  .hero-carousel .carousel-thumbnails img {
    width: 80px;
    height: 80px;
  }
}

/* Mobile Carousel */
@media (max-width: 900px) {
  .hero-carousel .carousel-thumbnails img {
    width: 50px;
    height: 50px;
  }
}

/* Hero móm?vil: centrar título y CTA (legacy, if any) */
@media (max-width: 900px) {
  .hero .wrap > div:first-child { text-align: center; }
  .hero .wrap > div:first-child .cta { margin-inline: auto; }
}
/* Evitar que la barra inferior tape el copyright del footer */
/* Incluye el levantamiento de 28px del icono central */
@media (max-width: 900px) {
  .subfooter { padding-bottom: calc(.8rem + var(--bottom-bar-h) + 28px + env(safe-area-inset-bottom)); }
  .subfooter { padding-bottom: calc(.8rem + var(--bottom-bar-h) + 28px + constant(safe-area-inset-bottom)); }
}
/* Footer móm?vil: secciones centradas y apiladas */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr !important; }
  .footer-grid > div { text-align: center; }
  /* Si existe una authbar duplicada fuera del header, ocultarla */
  body > .mobile-authbar { display: none !important; }
}
@media (max-width: 900px) { header.site-header .brand span:not(.logo) { display: none !important; } }




/* En escritorio: tarjetas de ancho fijo (como en la demo). Con 1 producto, queda del tamaño correcto y alineado a la izquierda */
@media (min-width: 761px) {
  #productos .products { justify-content: start; }
}


/* Forzar tamaño y alineación de cards en productos */
#productos .products { justify-items: start !important; }
.home-product-card { width: 100% !important; max-width: 280px !important; }

/* ======= OVERRIDE FINAL PARA TARJETAS (NO TOCAR EL RESTO) ======= */
#productos .products {
  justify-items: center !important;
}
.home-product-card {
  width: 100% !important;
  max-width: 280px !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  background: #fff !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.06) !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
}
.home-product-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.08) !important;
}
.home-product-card .media {
  background: #ffffff !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  height: 260px !important;
  overflow: hidden !important;
  padding: 10px 0 !important;
  border-bottom: 1px solid #f3f3f3 !important;
  box-sizing: border-box !important;
  aspect-ratio: auto !important;
}
.home-product-card .media img {
  max-height: 100% !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  display: block !important;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)) !important;
}
.home-product-card .body {
  text-align: center !important;
  padding: 1rem !important;
  display: flex !important;
  flex-direction: column !important;
  
}
.home-product-card .title {
  margin: 0 0 .4rem !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  color: #1f2937 !important;
}
.home-product-card .price {
  color: var(--brand-700) !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
}
.home-product-card .actions {
  display:flex !important;
  flex-direction:column !important;
  gap:.6rem !important;
  align-items:stretch !important;
  justify-content:stretch !important;
  padding:0 1rem 1rem !important;
  margin-top: auto !important;
}
.home-product-card .actions .more {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  background:#fff !important;
  color: var(--action) !important;
  border:1px solid var(--action) !important;
  border-radius:10px !important;
  padding:.6rem .9rem !important;
  font-weight: 600 !important;
  transition: background .2s ease !important;
  text-decoration: none !important;
  margin:0 !important;
}
.home-product-card .actions .more:hover { background:#fff5f5 !important; }
.home-product-card .actions .add {
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: .5rem !important;
  background: var(--action) !important;
  color:#fff !important;
  border: none !important;
  border-radius:10px !important;
  padding:.7rem .9rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: background .2s ease !important;
  margin:0 !important;
}
.home-product-card .actions .add:hover { background: var(--action-700) !important; }
@media (max-width: 520px) {
  .home-product-card { max-width: 100% !important; }
  .home-product-card .media { height: 220px !important; }
}
@media (max-width: 700px) {
  #productos .products { grid-template-columns: repeat(2, 1fr) !important; }
}
/* ======= FIN OVERRIDE FINAL ======= */


/* ======= UNIFICAR ESTILO DE CARDS DE OFERTAS ======= */
#ofertas .offers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  justify-items: center;
}
#ofertas .offers .card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
  max-width: 300px;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
#ofertas .offers .card .media {
  background: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 250px;
  overflow: hidden;
  border-bottom: 1px solid #f2f2f2;
  padding: 10px 0;
  box-sizing: border-box;
}
#ofertas .offers .card .media img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.12));
}
#ofertas .offers .card .body {
  text-align: center;
  padding: 1rem;
}
#ofertas .offers .card .price {
  color: var(--brand-700);
  font-weight: 700;
}
#ofertas .offers .card .actions {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: stretch;
  justify-content: stretch;
  padding: 0 1rem 1rem;
}
#ofertas .offers .card .actions .more {
  background: #fff;
  color: var(--action);
  border: 1px solid var(--action);
  border-radius: 10px;
  padding: .6rem .9rem;
  margin: 0;
}
#ofertas .offers .card .actions .more:hover { background: #fff5f5; }
#ofertas .offers .card .actions .add {
  background: var(--action);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .65rem .9rem;
  margin: 0;
}
#ofertas .offers .card .actions .add:hover { background: var(--action-700); }

@media (max-width: 700px) {
  #ofertas .offers { grid-template-columns: repeat(2, 1fr); }
}
/* ======= FIN DE UNIFICACIÓN ======= */

/* Hide '|' separator when admin link is hidden */
.user-auth .links a[style*='display:none'] + .sep { display:none; }

.order-status-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.order-status-step {
  text-align: center;
  min-width: 90px;
  color: #9ca3af;
  font-weight: 500;
}
.order-status-badge {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid #d1d5db;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  background: #fff;
  margin-bottom: .25rem;
}
.order-status-label {
  font-size: .8rem;
  display: block;
}
.order-status-step.is-active {
  color: #166534;
}
.order-status-step.is-active .order-status-badge {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}
.order-status-step.is-completed {
  color: #166534;
}
.order-status-step.is-completed .order-status-badge {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
.order-status-divider {
  flex: 0 0 36px;
  height: 2px;
  background: #d1d5db;
  border-radius: 999px;
}

@media (max-width: 800px) {
  .order-status-track {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  .order-status-step {
    min-width: 64px;
    font-size: .72rem;
  }
  .order-status-badge {
    width: 24px;
    height: 24px;
    font-size: .72rem;
    margin-bottom: .15rem;
  }
  .order-status-label {
    font-size: .7rem;
    white-space: normal;
    line-height: 1.1;
    word-break: break-word;
  }
.order-status-divider {
  flex: 0 0 14px;
}
}

/* Autocomplete */
.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px 0;
  z-index: 50;
  display: none;
}

.autocomplete-list.is-open {
  display: block;
}

.autocomplete-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.4;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
  background: #f3f4f6;
}

.autocomplete-item.muted {
  color: #6b7280;
  cursor: default;
}

/* Evita que las sugerencias tapen los botones en el modal de dirección (carrito) */
#addressModal .autocomplete-wrap {
  margin-bottom: 0.5rem;
}
#addressModal .autocomplete-list {
  position: static;
  display: none;
  max-height: 180px;
}
#addressModal .autocomplete-list.is-open {
  display: block;
}

.address-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.75rem;
  background: #f9fafb;
}

.address-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.address-section-title {
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.address-section-sub {
  color: #6b7280;
  font-size: 0.9rem;
}

.address-ghost {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}
.address-ghost:hover {
  background: #f3f4f6;
}

.address-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.address-tab {
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
  font-weight: 600;
}

.address-tab.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* Shipping options alignment */
.shipping-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shipping-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
}

.shipping-option input[type="radio"] {
  margin-top: 0.25rem;
}

.shipping-option-main {
  font-weight: 700;
  color: #111827;
}

.shipping-option-note {
  font-size: 0.9rem;
  color: #6b7280;
}
