/* =====================================================================
   DESIGN TOKENS
   Paleta: verde-tinta profundo (marca) + verde WhatsApp (solo CTA de envío)
   + ámbar mercado (acentos/precio) sobre fondo cálido neutro.
   Tipografía: Plus Jakarta Sans (display) + Inter (texto) + JetBrains Mono (precios/códigos)
===================================================================== */
:root {
  --ink: #171B19;
  --ink-soft: #565F5A;
  --text: var(--ink);      /* color de texto del cuerpo: separado de --ink para que los temas oscuros puedan invertirlo sin afectar los fondos oscuros de chips/botones */
  --bg: #F6F7F2;
  --surface: #FFFFFF;
  --border: #E6E8E1;

  --brand: #0F7B6C;       /* verde-tinta: marca del SaaS / panel */
  --brand-dark: #0B5C51;
  --brand-soft: #E4F2EF;

  --whatsapp: #25D366;    /* reservado para el CTA de pedido */
  --whatsapp-dark: #1DA851;

  --amber: #E8A23D;       /* acentos: destacados, precios, badges */
  --amber-dark: #C7841F;
  --amber-soft: #FBE9D3;  /* fondo de insignias (siempre claro, para que el texto oscuro sea legible) */

  --danger: #D64545;
  --danger-soft: #FBE7E7;
  --danger-text: #B23434;         /* rojo más oscuro para texto (el tono --danger es demasiado claro para leerse bien) */
  --success-text: #1D7A46;        /* texto en verde ("Abierto ahora") */
  --warning-soft: #FCF3DD;
  --success-soft: #E2F5EA;
  --info-soft: #E6EEF7;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(23,27,25,.06);
  --shadow: 0 8px 24px rgba(23,27,25,.08);
  --shadow-lg: 0 20px 48px rgba(23,27,25,.14);

  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display-font {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

a { text-decoration: none; }

.text-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }

.btn-primary,
.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover, .btn-primary:focus,
.btn-brand:hover, .btn-brand:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.pagination .page-link {
  color: #10201b;
  border-color: var(--border);
}
.pagination .page-link:hover, .pagination .page-link:focus {
  color: #10201b;
  background: rgba(16, 32, 27, .08);
  border-color: #10201b;
  box-shadow: none;
}
.pagination .page-item.active .page-link {
  background: #10201b;
  border-color: #10201b;
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  color: var(--ink-soft);
}

.btn-whatsapp {
  background: var(--whatsapp);
  border-color: var(--whatsapp);
  color: #fff;
  font-weight: 600;
}
.btn-whatsapp:hover, .btn-whatsapp:focus {
  background: var(--whatsapp-dark);
  border-color: var(--whatsapp-dark);
  color: #fff;
}

.btn-outline-brand {
  border-color: var(--brand);
  color: var(--brand);
  background: transparent;
}
.btn-outline-brand:hover { background: var(--brand); color: #fff; }

.badge-amber { background: var(--amber-soft); color: #241800; }
.text-brand { color: var(--brand); }
.text-amber { color: var(--amber-dark); }
.bg-brand-soft { background: var(--brand-soft); }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* =====================================================================
   AUTENTICACIÓN (login / registro / recuperación)
===================================================================== */
.auth-shell {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(1200px 600px at 90% -10%, var(--brand-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #FCEFDA, transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-brand i { color: var(--whatsapp); font-size: 1.6rem; }
.auth-brand-title { display: block; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.auth-brand-sub { display: block; font-size: .85rem; color: var(--ink-soft); font-weight: 600; }
.auth-card .form-label { font-weight: 600; font-size: .88rem; }
.auth-card .form-control, .auth-card .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--border);
  padding: .65rem .85rem;
}
.auth-card .form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem var(--brand-soft); }
.auth-foot { text-align: center; font-size: .9rem; margin-top: 18px; color: var(--ink-soft); }

/* =====================================================================
   PANEL ADMINISTRATIVO (empresa + superadmin)
===================================================================== */
.panel-body { background: var(--bg); }
.panel-wrapper { display: flex; min-height: 100svh; }

.panel-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #10201B;
  color: #E9F3EF;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1040;
  transform: translateX(0);
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand i { font-size: 1.5rem; color: var(--whatsapp); }
.brand-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1rem; }
.brand-sub { display: block; font-size: .72rem; color: #9FC2B7; text-transform: uppercase; letter-spacing: .06em; }

.sidebar-nav { padding: 14px 12px; flex: 1; overflow-y: auto; }
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: #CFE3DC;
  font-size: .92rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.sidebar-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: var(--brand); color: #fff; }

.panel-main { flex: 1; margin-left: 250px; display: flex; flex-direction: column; min-width: 0; }
.panel-topbar {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 22px;
  position: sticky; top: 0; z-index: 1020;
}
.topbar-title { font-size: 1.05rem; font-weight: 700; margin: 0; flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-soft); border: 0; background: transparent; padding: 6px 8px; border-radius: var(--radius-sm); }
.topbar-user:hover, .topbar-user:focus { background: var(--brand-soft); color: var(--ink); }
.btn-toggle-sidebar { display: none; border: 0; background: transparent; font-size: 1.4rem; color: var(--ink); }
.panel-content { padding: 22px; flex: 1; }
.panel-overlay { display: none; }

@media (max-width: 991.98px) {
  .panel-sidebar { transform: translateX(-100%); }
  .panel-sidebar.open { transform: translateX(0); }
  .panel-main { margin-left: 0; }
  .btn-toggle-sidebar { display: block; }
  .panel-overlay.show {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.4); z-index: 1030;
  }
}

/* Tarjetas de estadísticas del dashboard */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}
.stat-icon {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-card > div:last-child { min-width: 0; }
.stat-value { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; line-height: 1.15; overflow-wrap: break-word; }
.stat-value.text-mono { font-size: 1.15rem; white-space: normal; }
.stat-label { font-size: .8rem; color: var(--ink-soft); }

@media (max-width: 575.98px) {
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value { font-size: 1.05rem; }
  .stat-value.text-mono { font-size: .92rem; white-space: normal; }
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-card .panel-card-header {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.panel-card .panel-card-body { padding: 18px; }
.metodo-entrega-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 576px) { .metodo-entrega-grid { grid-template-columns: 1fr 1fr; } }
.metodo-entrega-opcion {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; margin: 0;
  transition: border-color .15s ease;
}
.metodo-entrega-opcion:hover { border-color: var(--brand); }
.metodo-entrega-opcion > span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.metodo-entrega-opcion .form-check-input { width: 2.4em; height: 1.3em; flex-shrink: 0; cursor: pointer; }

.table-clean thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft); border-bottom-width: 1px; white-space: nowrap;
}
.table-clean td { vertical-align: middle; }

.badge-estado { border-radius: var(--radius-pill); padding: .35em .8em; font-weight: 600; font-size: .74rem; }
.badge-pendiente   { background: var(--warning-soft); color: #8A6408; }
.badge-confirmado  { background: var(--info-soft);    color: #2A5A8C; }
.badge-preparando  { background: #EFE6FB; color: #6A3FBF; }
.badge-enviado     { background: #E4EAFB; color: #3350C2; }
.badge-entregado   { background: var(--success-soft); color: #1D7A46; }
.badge-cancelado   { background: var(--danger-soft);  color: #B23434; }
.badge-activo      { background: var(--success-soft); color: #1D7A46; }
.badge-inactivo    { background: #EEEFEA; color: #6B7268; }

.thumb-sm { width: 46px; height: 46px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.logo-circle { width: 110px; height: 110px; border-radius: 50%; object-fit: cover; display: block; }

/* Selector de hasta 3 imágenes en el formulario de producto */
.image-slot {
  width: 84px; height: 84px; border-radius: var(--radius-sm);
  border: 2px dashed var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 1.4rem; cursor: pointer;
  position: relative; overflow: hidden; flex-shrink: 0;
}
.image-slot:hover { border-color: var(--brand); color: var(--brand); }
.image-slot.filled { border-style: solid; border-color: var(--border); cursor: default; }
.image-slot.filled img { width: 100%; height: 100%; object-fit: cover; }
.image-slot .slot-remove {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(23,27,25,.75); color: #fff; border: 0; display: flex; align-items: center; justify-content: center;
  font-size: .85rem; line-height: 1; cursor: pointer;
}
.image-slot .slot-cover-badge {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(23,27,25,.65); color: #fff;
  font-size: .62rem; text-align: center; padding: 1px 0; letter-spacing: .03em;
}

/* Precio de oferta */
.precio-tachado { text-decoration: line-through; color: var(--ink-soft); font-size: .82em; }
.precio-oferta-valor { color: var(--amber-dark); font-weight: 700; }
.badge-oferta {
  background: var(--amber); color: #241800; font-weight: 700; font-size: .68rem;
  padding: 2px 8px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 3px;
}
.badge-agotado {
  background: #EEEFEA; color: #6B7268; font-weight: 700; font-size: .68rem;
  padding: 2px 8px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 3px;
}
.thumb-placeholder {
  width: 46px; height: 46px; border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.thumb-placeholder.logo-circle { width: 110px; height: 110px; border-radius: 50%; }

/* =====================================================================
   CATÁLOGO PÚBLICO — diseño moderno, mobile-first
   (inspirado en referencia: header blanco, buscador y carrito integrados,
   línea de estado en texto plano, controles de orden/vista)
===================================================================== */
.catalogo-body {
  --bg: var(--fondo-color, #FFFFFF);
  background: var(--bg);
  --font-display: 'Nunito Sans', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
}

/* Header fijo: logo + nombre + carrito */
.catalogo-topbar {
  position: sticky; top: 0; z-index: 1040;
  background: var(--header-bg, var(--surface)); border-bottom: 1px solid var(--border);
  padding: 10px 14px; display: flex; align-items: center; gap: 10px;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.catalogo-logo {
  width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface);
}
.catalogo-logo-placeholder {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.catalogo-nombre {
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; margin: 0;
  line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--nombre-color, var(--text));
}
.catalogo-desc-inline {
  font-size: .92rem; color: var(--desc-color, var(--ink-soft)); margin: 2px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.topbar-cart-btn {
  position: relative; flex-shrink: 0; border: 1px solid var(--border); background: var(--surface);
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text); font-size: 1.15rem;
  transition: transform .15s ease;
}
.topbar-cart-btn:active { transform: scale(.9); }
.cart-fab-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--ink); color: #fff;
  min-width: 19px; height: 19px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: .64rem; font-weight: 800; padding: 0 4px;
  border: 2px solid var(--surface);
}
.cart-fab-badge.d-none { display: none; }
@keyframes cartFabBump { 0% { transform: scale(1); } 35% { transform: scale(1.22); } 100% { transform: scale(1); } }
.topbar-cart-btn.bump { animation: cartFabBump .32s ease; }

/* Línea de estado: abierto/cerrado + próxima apertura, dirección */
.catalogo-status-wrap { border-bottom: 1px solid var(--border); background: var(--info-bg, transparent); }
.catalogo-status-row {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  padding: 10px 14px; font-size: .96rem; color: var(--info-text, var(--ink-soft));
}
.catalogo-status-row .status-item { display: inline-flex; align-items: center; gap: 5px; }
.catalogo-status-row .status-item i { font-size: 1rem; }
.status-open { color: var(--success-text); font-weight: 600; }
.status-closed { color: var(--danger-text); font-weight: 600; }

.catalogo-search-wrap { padding: 12px 14px 0; }
.catalogo-search {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 6px 6px 6px 14px; display: flex; align-items: center; gap: 8px;
}
.catalogo-search input { border: 0; flex: 1; padding: 9px 0; background: transparent; font-size: 1rem; }
.catalogo-search input:focus { outline: none; }

.catalogo-welcome {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  text-align: center; font-size: .96rem; font-weight: 700; color: var(--brand-dark);
  background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius-sm);
  padding: 10px 16px; margin: 12px 14px 0;
}
.catalogo-welcome i { font-size: 1rem; flex-shrink: 0; }

/* Fila de categorías: horizontal deslizable, justo debajo del buscador */
.chip-scroller-row { padding: 12px 14px 4px; }
.chip-scroller {
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none;
}
.chip-scroller::-webkit-scrollbar { display: none; }
.chip-cat {
  flex-shrink: 0; padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--chip-border, var(--border));
  font-size: .9rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip-cat.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Fila de controles: ordenar + vista */
.catalogo-toolbar-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 6px 14px 4px; }
.sort-select {
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface);
  font-size: .84rem; font-weight: 600; color: var(--text); padding: 7px 10px; max-width: 140px;
}
.sort-select:focus { outline: none; border-color: var(--brand); }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; flex-shrink: 0; }
.view-toggle button {
  border: 0; background: var(--surface); color: var(--ink-soft);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: .95rem;
}
.view-toggle button.active { background: var(--ink); color: #fff; }

.product-grid { padding: 8px 10px 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 576px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }
@media (min-width: 992px) { .product-grid { grid-template-columns: repeat(7, 1fr); gap: 10px; } }

.product-card {
  background: var(--surface); border: 1px solid var(--card-border, #000); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.product-img-wrap {
  position: relative; aspect-ratio: 1 / 1; background: var(--brand-soft);
  margin: 8px 8px 0; border-radius: var(--radius-sm); overflow: hidden;
}
.product-img-wrap img { border-radius: inherit; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--brand); font-size: 1.6rem; }
.product-badge-destacado {
  position: absolute; top: 5px; left: 5px; background: var(--amber-soft); color: #241800;
  font-size: .58rem; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-pill);
}
.product-badge-oferta {
  position: absolute; top: 5px; right: 5px; background: var(--danger); color: #fff;
  font-size: .58rem; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-pill);
}
.product-img-dots {
  position: absolute; bottom: 4px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px;
}
.product-img-dots span { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.55); }
.product-img-dots span.active { background: #fff; }
.product-img-nav {
  position: absolute; top: 0; bottom: 0; width: 32%; background: transparent; border: 0; padding: 0;
}
.product-img-nav.prev { left: 0; }
.product-img-nav.next { right: 0; }
.product-body { padding: 6px 7px 8px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.product-name { font-weight: 700; font-size: .8rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-desc { font-size: .72rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; min-height: 1.1em; }
.product-price { font-family: var(--font-mono); font-weight: 700; color: var(--brand-dark); font-size: .88rem; }
.product-agotado-label { color: var(--danger-text); font-weight: 700; font-size: .76rem; margin-top: auto; }

.product-add-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.add-cart-wrap { position: relative; display: inline-flex; }
.btn-add-cart {
  border: 0; background: var(--ink); color: #fff; border-radius: var(--radius-pill);
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; font-size: .88rem; flex-shrink: 0;
}
.product-qty-badge {
  position: absolute; top: -8px; right: -8px; z-index: 1;
  border: 2px solid var(--surface); background: var(--danger); color: #fff;
  min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 800; line-height: 1;
}
.qty-stepper { display: flex; align-items: center; gap: 6px; background: var(--ink); border-radius: var(--radius-pill); padding: 2px 3px; }
.qty-stepper button { border: 0; background: transparent; color: #fff; width: 19px; height: 19px; font-size: .82rem; }
.qty-stepper span { min-width: 12px; text-align: center; font-weight: 700; font-size: .72rem; color: #fff; }

/* En móvil (2 columnas) las tarjetas son más anchas: se agranda un poco el contenido para aprovechar el espacio */
@media (max-width: 575.98px) {
  .product-body { padding: 9px 10px 10px; gap: 3px; }
  .product-name { font-size: .92rem; -webkit-line-clamp: 2; }
  .product-desc { font-size: .82rem; -webkit-line-clamp: 2; min-height: 2em; }
  .product-price { font-size: 1rem; }
  .product-agotado-label { font-size: .86rem; }
  .btn-add-cart { width: 28px; height: 28px; font-size: 1rem; }
  .product-qty-badge { min-width: 21px; height: 21px; font-size: .72rem; top: -8px; right: -9px; }
  .qty-stepper button { width: 23px; height: 23px; font-size: .95rem; }
  .qty-stepper span { font-size: .8rem; min-width: 14px; }
  .product-badge-destacado, .product-badge-oferta { font-size: .68rem; padding: 3px 8px; }
}

/* Vista de lista (alternativa a la grilla) */
.product-grid.list-view { grid-template-columns: 1fr; gap: 8px; }
.product-grid.list-view .product-card { flex-direction: row; }
.product-grid.list-view .product-img-wrap { width: 92px; flex-shrink: 0; aspect-ratio: 1/1; margin: 8px; }
.product-grid.list-view .product-img-dots,
.product-grid.list-view .product-img-nav { display: none; }
.product-grid.list-view .product-body { justify-content: center; }
.product-grid.list-view .product-desc { display: none; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state i { font-size: 2.4rem; color: var(--border); margin-bottom: 10px; display: block; }

/* Carrito: panel deslizante desde la derecha (dos pasos: carrito -> datos de contacto) */
.cart-offcanvas { width: 100vw !important; background: var(--surface); color: var(--text); }
@media (min-width: 576px) { .cart-offcanvas { width: 420px !important; } }
.cart-step { display: flex; flex-direction: column; height: 100%; }
.cart-step-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cart-step-header {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cart-step-header .btn-icon {
  border: 0; background: transparent; color: var(--text); font-size: 1.3rem;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cart-step-title { font-weight: 800; font-size: 1.05rem; margin: 0; flex: 1; }
.btn-vaciar-carrito { border: 0; background: none; color: var(--danger-text); font-size: .82rem; font-weight: 600; text-decoration: underline; white-space: nowrap; }
.cart-step-body { flex: 1; overflow-y: auto; padding: 14px 16px; }

.cart-bottom-bar {
  flex-shrink: 0; border: 0; width: 100%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  font-weight: 700; font-size: .95rem;
}
.cart-bottom-bar:disabled { opacity: .5; }
.cart-bottom-count {
  background: rgba(255,255,255,.18); width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 800; flex-shrink: 0;
}
.cart-bottom-bar .label { flex: 1; text-align: left; }
.cart-bottom-bar .total { font-family: var(--font-mono); }

.cart-item-row { display: flex; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.cart-item-row img, .cart-item-row .thumb-placeholder { width: 60px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; }
.cart-item-name { font-weight: 700; font-size: .9rem; }
.cart-item-price { font-family: var(--font-mono); font-size: .82rem; color: var(--ink-soft); margin-top: 2px; }

/* Selección de método de entrega */
.delivery-option {
  display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); margin-bottom: 10px; cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.delivery-option i.bi { font-size: 1.3rem; color: var(--ink-soft); }
.delivery-option-label { font-weight: 700; font-size: .92rem; }
.delivery-option-hint { font-size: .76rem; color: var(--danger-text); font-weight: 600; }
.delivery-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; }
.delivery-option.selected { border-color: #1D7A46; background: var(--success-soft); }
.delivery-option.selected i.bi, .delivery-option.selected .delivery-option-label { color: #1D7A46; }
.delivery-option.selected .delivery-radio { border-color: #1D7A46; background: #1D7A46; box-shadow: inset 0 0 0 3px #fff; }
.delivery-option.disabled { opacity: .55; cursor: not-allowed; background: var(--bg); }
.recoger-info { font-size: .82rem; color: var(--ink-soft); background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; margin: -4px 0 14px; }

/* Modal de detalle de producto: foto ampliada + galería + descripción */
#modalDetalleProducto .modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.detalle-close {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  background: #fff; border-radius: 50%; width: 26px; height: 26px;
  opacity: 1; padding: 0; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
  border: 0; color: #000; font-size: .8rem; line-height: 1;
}
.detalle-img-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; background: var(--brand-soft); }
.detalle-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detalle-img-wrap .product-img-placeholder { font-size: 3rem; }
.detalle-img-nav {
  position: absolute; top: 0; bottom: 0; width: 30%; background: transparent; border: 0; padding: 0; z-index: 2;
  display: flex; align-items: center;
}
.detalle-img-nav.prev { left: 0; justify-content: flex-start; }
.detalle-img-nav.next { right: 0; justify-content: flex-end; }
.detalle-img-nav i {
  width: 30px; height: 30px; margin: 0 8px; border-radius: 50%;
  background: rgba(0,0,0,.35); color: #fff; font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
}
.detalle-img-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.detalle-img-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.detalle-img-dots span.active { background: #fff; }
.detalle-body { padding: 16px; }
.detalle-nombre { font-size: 1.15rem; font-weight: 800; margin: 0 0 6px; }
.detalle-precio { font-family: var(--font-mono); font-weight: 700; color: var(--brand-dark); font-size: 1.15rem; margin-bottom: 10px; }
.detalle-desc { font-size: .92rem; color: var(--ink-soft); white-space: pre-line; margin-bottom: 14px; }
.detalle-variantes { margin-bottom: 14px; }
.detalle-variantes-lista { display: flex; flex-wrap: wrap; gap: 8px; }
.detalle-variante-opcion {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius-pill); background: var(--surface); cursor: pointer; font-size: .86rem; font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.detalle-variante-precio { font-family: var(--font-mono); font-weight: 700; font-size: .8rem; color: var(--ink-soft); }
.detalle-variante-opcion.selected { border-color: var(--brand); background: var(--brand-soft); }
.detalle-variante-opcion.selected .detalle-variante-precio { color: var(--brand-dark); }
.detalle-variante-opcion.disabled { opacity: .5; cursor: not-allowed; }

.cupon-wrap { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
#cuponMensaje:not(:empty) { margin-top: 4px; }
.cupon-resumen { margin-top: 10px; padding: 10px 12px; background: var(--bg); border-radius: var(--radius-sm); font-size: .86rem; }
.cupon-resumen > div { padding: 2px 0; }

/* Línea de tiempo de seguimiento de pedido */
.seguimiento-timeline { display: flex; align-items: flex-start; }
.seguimiento-paso { flex: 1; text-align: center; position: relative; }
.seguimiento-paso:not(:last-child)::after {
  content: ''; position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0;
}
.seguimiento-paso.completado:not(:last-child)::after { background: var(--brand); }
.seguimiento-punto {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border);
  color: transparent; margin: 0 auto; font-size: .8rem;
}
.seguimiento-paso.completado .seguimiento-punto { background: var(--brand); border-color: var(--brand); color: #fff; }
.seguimiento-paso.actual .seguimiento-punto { box-shadow: 0 0 0 4px var(--brand-soft); }
.seguimiento-etiqueta { display: block; font-size: .72rem; margin-top: 6px; color: var(--ink-soft); }
.seguimiento-paso.completado .seguimiento-etiqueta { color: var(--ink); font-weight: 600; }

.catalogo-rastreo-link {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: .8rem; color: var(--ink-soft); text-decoration: none; margin-top: 8px;
}
.catalogo-rastreo-link:hover { color: var(--brand-dark); }

/* Tarjetas de comparación de planes (Empresa → Mi Plan) */
.plan-card { position: relative; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; height: 100%; display: flex; flex-direction: column; }
.plan-card-actual { border-color: var(--brand); background: var(--brand-soft); }
.plan-card-badge {
  position: absolute; top: -10px; right: 14px; background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill);
}
.plan-card-precio { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 10px; }
.plan-card-lista { list-style: none; padding: 0; margin: 0 0 14px; flex: 1; }
.plan-card-lista li { font-size: .86rem; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }

/* Galería de plantillas de color (Empresa → Configuración → Apariencia) */
.plantilla-color-card {
  position: relative; border: 2px solid var(--border); border-radius: 12px; padding: 10px; cursor: pointer;
  transition: border-color .15s ease; height: 100%;
}
.plantilla-color-card:hover { border-color: var(--brand); }
.plantilla-color-card.seleccionada { border-color: var(--brand); }
.plantilla-color-check { position: absolute; top: 8px; right: 8px; color: var(--brand); font-size: 1.1rem; opacity: 0; transition: opacity .15s ease; }
.plantilla-color-card.seleccionada .plantilla-color-check { opacity: 1; }
.plantilla-color-preview { border: 1px solid; border-radius: 8px; overflow: hidden; }
.plantilla-color-header { display: flex; align-items: center; gap: 6px; padding: 8px; font-size: .74rem; }
.plantilla-color-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }
.plantilla-color-pill { font-size: .66rem; padding: 3px 8px; border-radius: 20px; display: inline-block; margin: 6px 8px 0; }
.plantilla-color-cards { display: flex; gap: 5px; padding: 6px 8px 8px; }
.plantilla-color-cards span { flex: 1; height: 26px; border: 1px solid; border-radius: 6px; display: block; }
.plantilla-color-nombre { font-size: .8rem; font-weight: 600; text-align: center; margin-top: 8px; }
.detalle-add-row { display: flex; justify-content: flex-start; }
.detalle-add-row .btn-add-cart { width: 42px; height: 42px; font-size: 1.3rem; }
.detalle-add-row .product-qty-badge { min-width: 24px; height: 24px; font-size: .78rem; top: -8px; right: -8px; }
.detalle-add-row .product-agotado-label { font-size: .9rem; }

.catalogo-footer { text-align: center; padding: 30px 16px 10px; font-size: .78rem; color: var(--ink-soft); }

/* Botón flotante para contactar al negocio directo por WhatsApp (fuera del flujo de pedido) */
.whatsapp-contact-btn {
  position: fixed; right: 16px; bottom: 16px; z-index: 1040;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--whatsapp); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; box-shadow: var(--shadow-lg);
  transition: transform .15s ease;
}
.whatsapp-contact-btn:hover, .whatsapp-contact-btn:active { color: #fff; transform: scale(.94); }
