/* ============================================================
  DG LIMPIEZA — Sistema de diseño base
  Paleta: #39EBE1 (turquesa), #0C0C62 (marino), blanco
   ============================================================ */

:root {
  /* ── Paleta principal ─────────────────────────────────── */
  --color-turquoise:      #3F97CE;   /* azul acero: color principal */
  --color-turquoise-dark: #2C77AC;   /* azul acero oscuro para hovers */
  --color-turquoise-light:#D4E6F3;   /* azul muy claro para fondos suaves */

  --color-navy:           #0B2A45;   /* azul marino profundo: nav, fondos, botones */
  --color-navy-mid:       #1B4D74;   /* marino medio para hovers */
  --color-navy-light:     #E8F3FA;   /* marino muy claro para superficies */

  --color-white:          #FFFFFF;
  --color-bg:             #F2F8FC;   /* fondo general: azul casi blanco */
  --color-surface:        #FFFFFF;   /* fondo de cards */
  --color-border:         #DCEAF3;   /* bordes suaves con tono azul */
  --color-text:           #0C2A40;   /* texto principal = marino */
  --color-text-muted:     #5C7589;   /* texto secundario: azul-gris */

  /* Alias sky (mismo que turquoise, para compatibilidad con estilos legacy) */
  --color-sky:            #3F97CE;
  --color-sky-light:      #D4E6F3;
  --color-sky-dark:       #2C77AC;

  /* ── Semánticos ───────────────────────────────────────── */
  --color-success:        #22C55E;
  --color-danger:         #EF4444;
  --color-warning:        #F59E0B;
  --color-sin-stock:      #94A3B8;

  /* ── Tipografía ───────────────────────────────────────── */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  /* ── Espaciado (escala 4px) ───────────────────────────── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --max-width: 1200px;

  /* ── Radios ───────────────────────────────────────────── */
  --radius-sm:   6px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-full: 9999px;

  /* ── Sombras ──────────────────────────────────────────── */
  --shadow-sm: 0 1px 3px rgba(12, 12, 98, 0.07);
  --shadow-md: 0 4px 16px rgba(12, 12, 98, 0.11);
  --shadow-lg: 0 8px 32px rgba(12, 12, 98, 0.16);

  --transition: 0.2s ease;
}

/* ── Accesibilidad ───────────────────────────────────────────*/
.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;
}
.sr-only--focusable:focus {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  padding: 8px 16px;
  background: var(--color-navy);
  color: #fff;
  z-index: 9999;
}

/* ── Reset ──────────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── Tipografía ─────────────────────────────────────────────*/
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-navy);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ── Layout ─────────────────────────────────────────────────*/
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

main { flex: 1; }

/* ════════════════════════════════════════════════════════════
   NAVBAR — blanca / glassmorphism
════════════════════════════════════════════════════════════ */
.navbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  height: 72px;
}

/* Logo: imagen circular + nombre + tagline */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  line-height: 1.1;
}

.navbar__logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
}

.navbar__logo small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Grupo derecho: links + acciones juntos */
.navbar__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

/* Acciones: carrito + CTA */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Nav links — texto oscuro */
.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar__link {
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.navbar__link:hover {
  color: var(--color-navy);
  background: rgba(11,42,69,.06);
}

.navbar__link--active {
  color: var(--color-turquoise-dark);
  font-weight: 600;
}

/* Carrito */
.navbar__cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-full);
  background: var(--color-turquoise);
  color: var(--color-navy);
  border: 1.5px solid var(--color-turquoise);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.navbar__cart:hover {
  background: var(--color-turquoise-dark);
  border-color: var(--color-turquoise-dark);
  transform: translateY(-1px);
}

.navbar__cart-label {
  font-family: var(--font-body);
}

.navbar__cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--color-navy);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* CTA pill principal (Comprar online) */
.navbar__cta {
  background: var(--color-navy);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.navbar__cta:hover { background: var(--color-navy-mid); transform: translateY(-1px); }

/* Botón outline secundario (Panel / Ingresar) */
.navbar__cta--outline {
  background: transparent;
  color: var(--color-navy) !important;
  border-color: var(--color-border);
}
.navbar__cta--outline:hover {
  background: rgba(11,42,69,.06);
  border-color: var(--color-navy);
  transform: translateY(-1px);
}

/* Hamburguesa (mobile) */
.navbar__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-navy);
  cursor: pointer;
  padding: var(--space-2);
}

/* ════════════════════════════════════════════════════════════
   FOOTER — marino con acentos turquesa
════════════════════════════════════════════════════════════ */
.footer {
  background-color: var(--color-navy);
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-12) 0 var(--space-8);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer__brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-white);
  margin-bottom: var(--space-3);
}

.footer__brand span { color: var(--color-turquoise); }

.footer__desc {
  font-size: 0.875rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.footer__title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-turquoise);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer__links li + li { margin-top: var(--space-2); }

.footer__links a {
  font-size: 0.875rem;
  transition: color var(--transition);
}

.footer__links a:hover { color: var(--color-turquoise); }

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
}

.footer__admin-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
  transition: color var(--transition);
}

.footer__admin-link:hover {
  color: rgba(255,255,255,0.7);
}

/* ════════════════════════════════════════════════════════════
   BOTONES
   Primary = turquesa con texto marino (máximo contraste)
   Secondary = marino con texto blanco
════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn--primary {
  background: var(--color-turquoise);
  color: var(--color-navy);       /* texto marino sobre turquosa: contraste perfecto */
  border-color: var(--color-turquoise);
}

.btn--primary:hover {
  background: var(--color-turquoise-dark);
  border-color: var(--color-turquoise-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(57, 235, 225, 0.35);
}

.btn--secondary {
  background: var(--color-navy);
  color: var(--color-white);
  border-color: var(--color-navy);
}

.btn--secondary:hover {
  background: var(--color-navy-mid);
  border-color: var(--color-navy-mid);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background: transparent;
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.btn--outline:hover {
  background: var(--color-navy);
  color: white;
}

.btn--outline-light {
  background: transparent;
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.35);
}

.btn--outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--color-navy-light);
  color: var(--color-navy);
}

.btn--sm  { padding: var(--space-2) var(--space-4); font-size: 0.8rem; }
.btn--lg  { padding: var(--space-4) var(--space-8); font-size: 1rem; }

.btn:disabled, .btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Cards ───────────────────────────────────────────────────*/
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-turquoise);
}

/* ── Badges ──────────────────────────────────────────────────*/
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge--turquoise { background: var(--color-turquoise-light); color: var(--color-navy); }
.badge--navy      { background: var(--color-navy-light);      color: var(--color-navy); }
.badge--gray      { background: #F1F5F9; color: var(--color-sin-stock); }
.badge--red       { background: #FEE2E2; color: #991B1B; }
.badge--success   { background: #DCFCE7; color: #15803D; }

/* ── Formularios ─────────────────────────────────────────────*/
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.form-input {
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  color: var(--color-navy);
}

.form-input:focus {
  border-color: var(--color-turquoise);
  box-shadow: 0 0 0 3px rgba(57, 235, 225, 0.18);
}

.form-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* ── Alertas ─────────────────────────────────────────────────*/
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border-left: 4px solid;
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
}

.alert--success { background: #DCFCE7; border-color: #22C55E; color: #15803D; }
.alert--error   { background: #FEE2E2; border-color: #EF4444; color: #991B1B; }
.alert--info    { background: var(--color-turquoise-light); border-color: var(--color-turquoise); color: var(--color-navy); }

/* ── Secciones ───────────────────────────────────────────────*/
.section    { padding: var(--space-16) 0; }
.section--sm { padding: var(--space-10) 0; }

.section__header {
  text-align: center;
  margin-bottom: var(--space-10);
}

.section__subtitle {
  color: var(--color-text-muted);
  font-size: 1.05rem;
  margin-top: var(--space-2);
}

/* Línea decorativa bajo títulos de sección */
.section__header h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 3px;
  background: var(--color-turquoise);
  border-radius: var(--radius-full);
  margin: var(--space-3) auto 0;
}

/* ── Utilidades ──────────────────────────────────────────────*/
.text-center   { text-align: center; }
.text-muted    { color: var(--color-text-muted); }
.text-turquoise { color: var(--color-turquoise-dark); }
.text-navy     { color: var(--color-navy); }
.mt-auto       { margin-top: auto; }
.w-full        { width: 100%; }

/* ── Responsive ──────────────────────────────────────────────*/
@media (max-width: 768px) {
  .navbar__cart-label { display: none; }
  .navbar__cart { padding: 9px 11px; }

  .navbar__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,.97);
    flex-direction: column;
    padding: var(--space-4);
    gap: 0;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--color-border);
  }

  .navbar__links.is-open { display: flex; }
  .navbar__toggle { display: flex; }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer__bottom {
    flex-direction: column;
    gap: var(--space-3);
    text-align: center;
  }
}

/* ══ CATÁLOGO ══════════════════════════════════════════════ */

.catalogo-header {
  background: var(--color-navy);
  color: white;
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.catalogo-header h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.catalogo-header p {
  opacity: 0.75;
  font-size: 1rem;
}

/* Filtros */
.catalogo-filtros {
  background: white;
  padding: 1.5rem 0;
  border-bottom: 1px solid #e8edf2;
  position: sticky;
  top: 64px; /* altura del navbar */
  z-index: 10;
}

.buscador-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.buscador-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 2px solid #e8edf2;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.buscador-input:focus {
  outline: none;
  border-color: var(--color-sky);
}

.btn-buscar {
  padding: 0.6rem 1.2rem;
  background: var(--color-sky);
  color: var(--color-navy);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-buscar:hover { opacity: 0.85; }

.filtros-categorias {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filtro-btn {
  padding: 0.4rem 1rem;
  border: 2px solid #e8edf2;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #555;
  text-decoration: none;
  transition: all 0.2s;
}

.filtro-btn:hover,
.filtro-btn.activo {
  border-color: var(--color-sky);
  background: var(--color-sky);
  color: var(--color-navy);
}

/* Grid */
.catalogo-resultados {
  padding: 2rem 0 4rem;
}

.resultados-count {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* Card */
.producto-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.producto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.producto-card.sin-stock .producto-img {
  opacity: 0.5;
  filter: grayscale(30%);
}

.producto-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #f5f7fa;
  overflow: hidden;
}

.producto-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.badge-sin-stock,
.badge-stock-bajo {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-sin-stock {
  background: #b00000;
  color: white;
}

.badge-stock-bajo {
  background: #ff9800;
  color: white;
}

.producto-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.producto-nombre {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.producto-precios {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
  flex: 1;
}

.precio-principal {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.precio-secundario {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: #666;
}

.precio-label {
  font-size: 0.8rem;
  color: #888;
}

.precio-valor {
  font-weight: 700;
  color: var(--color-navy);
}

.precio-principal .precio-valor {
  font-size: 1.1rem;
  color: var(--color-sky-dark, var(--color-navy));
}

.btn-ver-producto {
  display: block;
  text-align: center;
  padding: 0.6rem;
  background: var(--color-navy);
  color: white;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.btn-ver-producto:hover:not(.disabled) { opacity: 0.85; }

.btn-ver-producto.disabled {
  background: #ccc;
  cursor: not-allowed;
  pointer-events: none;
}

/* Estado vacío */
.catalogo-vacio {
  text-align: center;
  padding: 4rem 0;
  color: #666;
}

.catalogo-vacio p { margin-bottom: 1rem; }

/* ============================================================
   DETALLE DE PRODUCTO
   Agregar al final de styles.css
   ============================================================ */

/* ── Breadcrumb ─────────────────────────────────────────────────────────── */
.breadcrumb-nav {
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  padding: 0.75rem 0;
}

.breadcrumb {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb li a {
  color: var(--color-sky);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb li a:hover {
  color: var(--color-navy);
}

.breadcrumb li span {
  color: #adb5bd;
}

.breadcrumb-actual {
  color: #6c757d;
  font-weight: 500;
  /* Trunca si es muy largo en mobile */
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Layout principal ───────────────────────────────────────────────────── */
.detalle-section {
  padding: 3rem 0;
}

.detalle-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

/* ── Imagen ─────────────────────────────────────────────────────────────── */
.detalle-imagen-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #f8f9fa;
  aspect-ratio: 1 / 1;   /* siempre cuadrada */
}

.detalle-imagen-container.sin-stock {
  opacity: 0.75;
}

.detalle-sin-stock-overlay {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: #dc3545;
  color: white;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  z-index: 2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.detalle-imagen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1.5rem;
  transition: transform 0.3s ease;
}

.detalle-imagen-container:hover .detalle-imagen {
  transform: scale(1.04);
}

.detalle-categorias {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge-categoria {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--color-sky-light, #e8fffe);
  color: var(--color-navy);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.badge-categoria:hover {
  background: var(--color-sky);
  color: white;
}

/* ── Info del producto ──────────────────────────────────────────────────── */
.detalle-nombre {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.25;
  margin: 0 0 1.5rem 0;
}

/* ── Precios ────────────────────────────────────────────────────────────── */
.detalle-precios {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: #f8f9fa;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  border-left: 4px solid var(--color-sky);
}

.precio-principal,
.precio-secundario {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.precio-secundario {
  padding-top: 0.75rem;
  border-top: 1px solid #e9ecef;
}

.precio-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
}

.precio-label small {
  display: block;
  font-size: 0.75rem;
  color: #adb5bd;
  font-weight: 400;
}

.precio-valor {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
}

.precio-principal .precio-valor {
  font-size: 1.6rem;
  color: var(--color-sky);
}

.precio-mayor  { color: var(--color-navy); }
.precio-caja   { color: var(--color-navy); }

/* ── Badge de stock ─────────────────────────────────────────────────────── */
.detalle-stock {
  margin-bottom: 1.25rem;
}

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 700;
}

.stock-ok     { background: #d4edda; color: #155724; }
.stock-bajo   { background: #fff3cd; color: #856404; }
.stock-agotado{ background: #f8d7da; color: #721c24; }

/* ── Variantes ──────────────────────────────────────────────────────────── */
.detalle-variantes {
  margin-bottom: 1.25rem;
}

.variante-grupo {
  margin-bottom: 1rem;
}

.variante-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 0.5rem;
}

.variante-opciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variante-btn {
  padding: 0.4rem 1rem;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  background: white;
  color: #495057;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.variante-btn:hover:not(:disabled) {
  border-color: var(--color-sky);
  color: var(--color-sky);
}

/* Estado seleccionado: borde y fondo con el color primario */
.variante-btn.seleccionada {
  border-color: var(--color-sky);
  background: var(--color-sky);
  color: white;
}

/* Variante agotada: aparece tachada y no se puede clickear */
.variante-btn.variante-agotada {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── Control de cantidad ────────────────────────────────────────────────── */
.cantidad-wrap {
  margin-bottom: 1.25rem;
}

.cantidad-control {
  display: flex;
  align-items: center;
  gap: 0;
  width: fit-content;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
}

.cantidad-btn {
  width: 42px;
  height: 42px;
  background: #f8f9fa;
  border: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cantidad-btn:hover {
  background: var(--color-sky);
  color: white;
}

.cantidad-input {
  width: 64px;
  height: 42px;
  border: none;
  border-left: 2px solid #dee2e6;
  border-right: 2px solid #dee2e6;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  outline: none;
  -moz-appearance: textfield;  /* quita flechas en Firefox */
}

/* Quita flechas en Chrome/Safari */
.cantidad-input::-webkit-outer-spin-button,
.cantidad-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

/* ── Precio dinámico ────────────────────────────────────────────────────── */
.precio-dinamico {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--color-navy-light);
  color: var(--color-navy);
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--color-navy);
}

.precio-dinamico-label {
  font-size: 0.875rem;
  opacity: 0.8;
}

.precio-dinamico-valor {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-navy);
}

/* ── Botón agregar al carrito ───────────────────────────────────────────── */
.btn-carrito {
  width: 100%;
  padding: 0.9rem;
  background: var(--color-navy);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: background 0.2s, transform 0.15s;
  margin-bottom: 1.5rem;
}

.btn-carrito:hover {
  background: var(--color-sky);
  color: var(--color-navy);
  border: solid 1px #0C0C62;
}

.btn-carrito:active {
  transform: translateY(0);
}

.btn-deshabilitado {
  background: #dee2e6 !important;
  color: #adb5bd !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ── Descripción ────────────────────────────────────────────────────────── */
.detalle-descripcion {
  border-top: 1px solid #e9ecef;
  padding-top: 1.5rem;
}

.descripcion-titulo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0 0 0.75rem 0;
}

.descripcion-texto {
  font-size: 0.95rem;
  color: #495057;
  line-height: 1.7;
  margin: 0;
}

/* ── Productos relacionados ─────────────────────────────────────────────── */
.relacionados-section {
  padding: 3rem 0;
  background: #f8f9fa;
}

.relacionados-titulo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0 0 1.5rem 0;
}

.relacionados-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.rel-card {
  display: block;
  text-decoration: none;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e9ecef;
  transition: box-shadow 0.2s, transform 0.2s;
}

.rel-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.rel-card.sin-stock {
  opacity: 1;
}

.rel-card.sin-stock .rel-imagen {
  opacity: 0.5;
  filter: grayscale(30%);
}

.rel-imagen-wrap {
  position: relative;
  aspect-ratio: 1;
  background: #f8f9fa;
}

.rel-imagen {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
}

.rel-badge-stock {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: #dc3545;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.rel-info {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rel-nombre {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rel-precio {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-sky);
}

/* ── Toast de feedback ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(2rem);
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-ok    { background: #28a745; color: white; }
.toast-error { background: #dc3545; color: white; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .detalle-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .relacionados-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .detalle-nombre {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  .relacionados-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Card del catálogo clickeable ────────────────────────── */
.producto-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}
.producto-card-link:hover .producto-card {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* ============================================================
   CARRITO — Estilos para agregar al final de styles.css
   ============================================================ */

/* ── Página carrito ─────────────────────────────────────── */
.carrito-page {
  padding: 2rem 0 4rem;
  min-height: 70vh;
}

.carrito-titulo {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 2rem;
}

/* ── Layout: lista + resumen lado a lado en desktop ─────── */
.carrito-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 768px) {
  .carrito-layout {
    grid-template-columns: 1fr;
  }
}

/* ── Cada fila de producto ──────────────────────────────── */
.carrito-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}

.carrito-item:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.1);
}

@media (max-width: 480px) {
  .carrito-item {
    grid-template-columns: 48px 1fr auto;
    grid-template-rows: auto auto;
  }
}

/* ── Imagen ─────────────────────────────────────────────── */
.item-imagen img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
}

.item-imagen-placeholder {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  background: var(--color-sky-light, #e8fffe);
  border-radius: 8px;
}

/* ── Info del producto ──────────────────────────────────── */
.item-nombre {
  font-weight: 600;
  color: var(--color-navy);
  margin: 0 0 .25rem;
}

.item-precio-unit {
  font-size: .85rem;
  color: #888;
  margin: 0;
}

/* ── Controles de cantidad ──────────────────────────────── */
.item-controles {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #f5f5f5;
  border-radius: 8px;
  padding: .25rem .5rem;
}

.btn-cantidad {
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  font-size: 1.25rem;
  color: var(--color-navy);
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: background .15s;
}

.btn-cantidad:hover {
  background: var(--color-sky);
  color: white;
}

.item-cantidad {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--color-navy);
}

/* ── Subtotal ───────────────────────────────────────────── */
.item-subtotal {
  font-weight: 700;
  color: var(--color-navy);
  min-width: 80px;
  text-align: right;
}

/* ── Botón eliminar ─────────────────────────────────────── */
.item-eliminar {
  border: none;
  background: none;
  color: #ccc;
  font-size: 1rem;
  cursor: pointer;
  padding: .25rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.item-eliminar:hover {
  color: #e53e3e;
  background: #fff0f0;
}

/* ── Panel resumen ──────────────────────────────────────── */
.carrito-resumen {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: sticky;
  top: 1rem;
}

.carrito-resumen h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0 0 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--color-sky);
}

.resumen-linea {
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
  font-size: .95rem;
  color: #555;
}

.resumen-total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-navy);
  border-top: 1px solid #eee;
  padding-top: .75rem;
  margin-top: .5rem;
}

/* ── Botón WhatsApp ─────────────────────────────────────── */
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .9rem 1rem;
  background: #25D366;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: background .2s, transform .1s;
}

.btn-whatsapp:hover {
  background: #1ebe5d;
  transform: translateY(-1px);
}

.btn-whatsapp:active {
  transform: translateY(0);
}

/* ── Botones secundarios ────────────────────────────────── */
.btn-vaciar {
  display: block;
  width: 100%;
  padding: .65rem;
  margin-top: .75rem;
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #888;
  font-size: .9rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.btn-vaciar:hover {
  color: #e53e3e;
  border-color: #e53e3e;
}

.btn-seguir {
  display: block;
  text-align: center;
  margin-top: .75rem;
  font-size: .9rem;
  color: var(--color-sky-dark, #0C0C62);
  text-decoration: none;
}

.btn-seguir:hover {
  text-decoration: underline;
}

/* ── Estado vacío ───────────────────────────────────────── */
.carrito-vacio {
  text-align: center;
  padding: 4rem 1rem;
}

.carrito-vacio-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.carrito-vacio p {
  font-size: 1.25rem;
  color: #888;
  margin-bottom: 1.5rem;
}

.carrito-badge {
  background: var(--color-sky);
  color: var(--color-navy);
  border-radius: 999px;
  padding: 0 6px;
  font-size: .75rem;
  font-weight: 700;
  margin-left: 4px;
}

/* Badges de rol */
.badge-rol        { padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-admin      { background: var(--color-navy); color: #fff; }
.badge-vendedor   { background: var(--color-sky); color: var(--color-navy); }

/* Fila de usuario inactivo */
.row-inactivo td  { opacity: .55; }

/* Texto muted */
.admin-label-muted { font-size: .82rem; color: #888; font-weight: 400; }

/* Botón peligro */
.btn-danger       { background: #c0392b; color: #fff; }
.btn-danger:hover { background: #a93226; }

/* Botón ok (reactivar) */
.btn-ok           { background: #27ae60; color: #fff; }
.btn-ok:hover     { background: #219150; }

/* ── Reportes ───────────────────────────────────────────── */
.reportes-metricas {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.metrica-card {
  flex: 1;
  min-width: 140px;
  background: var(--color-sky-light, #EAF6FF);
  border-left: 4px solid var(--color-sky);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.metrica-valor {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-navy);
}
.metrica-label {
  font-size: .8rem;
  color: #666;
  margin-top: 2px;
}
.reporte-grafico-wrap {
  margin: 1.5rem 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1.25rem;
}
.reporte-grafico-wrap h3 {
  font-size: .95rem;
  color: var(--color-navy);
  margin-bottom: 1rem;
}
.badge-canal {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-pos       { background: #d4f4e7; color: #1a7a4a; }
.badge-whatsapp  { background: #d1f7d1; color: #1a6b1a; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE-FIRST — zona pública (≤ 768px)
   Solo se agregan overrides; el diseño desktop no se toca.
════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Layout general ─────────────────────────────────────── */
  .container {
    padding-inline: var(--space-4); /* 16px en vez de 24px */
  }

  .section    { padding: var(--space-10) 0; }
  .section--sm { padding: var(--space-8) 0; }

  /* ── Tipografía ─────────────────────────────────────────── */
  h1 { font-size: clamp(1.5rem, 7vw, 2rem); }
  h2 { font-size: clamp(1.25rem, 5vw, 1.6rem); }

  /* ── Botones touch-friendly (≥ 44 px) ──────────────────── */
  .btn          { min-height: 44px; }
  .btn--sm      { min-height: 36px; }
  .btn-buscar,
  .btn-ver-producto,
  .btn-carrito,
  .btn-whatsapp { min-height: 44px; }

  /* ── Formularios ────────────────────────────────────────── */
  .form-input   { width: 100%; }

  /* ── Catálogo — header ──────────────────────────────────── */
  .catalogo-header {
    padding: 1.5rem 0 1.25rem;
  }
  .catalogo-header h1 {
    font-size: 1.5rem;
  }

  /* ── Catálogo — sticky offset ajustado para navbar mobile ─ */
  .catalogo-filtros {
    top: 56px;
  }

  /* ── Catálogo — buscador apilado ────────────────────────── */
  .buscador-form {
    flex-direction: column;
  }
  .buscador-input,
  .btn-buscar {
    width: 100%;
  }

  /* ── Catálogo — grid: 2 columnas en mobile ──────────────── */
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.875rem;
  }

  /* ── Detalle producto — precio dinámico apilado ─────────── */
  .precio-dinamico {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  /* ── Carrito — resumen sin sticky ───────────────────────── */
  .carrito-resumen {
    position: static;
  }
  .carrito-titulo {
    font-size: 1.4rem;
  }

  /* ── Relacionados — 2 columnas ajustadas ────────────────── */
  .relacionados-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* ── Reportes métricas — min-width más chico ────────────── */
  .metrica-card {
    min-width: 110px;
    padding: 0.75rem 1rem;
  }
  .metrica-valor {
    font-size: 1.3rem;
  }
}

/* ── Catálogo — 1 sola columna en pantallas muy pequeñas ─── */
@media (max-width: 420px) {
  .productos-grid {
    grid-template-columns: 1fr;
  }

  .carrito-item {
    grid-template-columns: 48px 1fr auto;
  }
}