/* =======================================================
   CATÁLOGO PÚBLICO — CIC
   Estilos estilo tienda online moderna
   ======================================================= */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cic-primary: #0f172a;
  --cic-accent: #f97316;
  --cic-accent-light: #fb923c;
  --cic-accent-dark: #ea580c;
  --cic-success: #10b981;
  --cic-danger: #ef4444;
  --cic-warning: #f59e0b;
  --cic-text: #0f172a;
  --cic-text-muted: #64748b;
  --cic-border: #e2e8f0;
  --cic-bg: #f8fafc;
  --cic-radius: 12px;
  --cic-radius-sm: 8px;
  --cic-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --cic-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --cic-shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1);
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cic-bg);
  color: var(--cic-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--cic-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== HEADER ====== */
.catalogo-header {
  background: white;
  border-bottom: 1px solid var(--cic-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--cic-shadow-sm);
}
.catalogo-header .header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.catalogo-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.catalogo-header .logo {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--cic-primary), #334155);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
}
.catalogo-header .name {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
}
.catalogo-header .slogan {
  font-size: 11px;
  color: var(--cic-text-muted);
}

.header-search {
  flex: 1;
  max-width: 500px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 1px solid var(--cic-border);
  border-radius: 24px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--cic-bg);
}
.header-search input:focus {
  border-color: var(--cic-accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}
.header-search::before {
  content: "🔎";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-outline {
  background: white;
  border: 1px solid var(--cic-border);
  color: var(--cic-text);
}
.btn-outline:hover {
  border-color: var(--cic-accent);
  color: var(--cic-accent);
}
.btn-accent {
  background: var(--cic-accent);
  color: white;
}
.btn-accent:hover {
  background: var(--cic-accent-dark);
}
.btn-primary {
  background: var(--cic-primary);
  color: white;
}
.btn-primary:hover {
  background: #1e293b;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Badge de carrito */
.btn-cart {
  position: relative;
}
.btn-cart .cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--cic-accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ====== SUCURSAL BAR ====== */
.sucursal-bar {
  background: var(--cic-primary);
  color: white;
  padding: 8px 20px;
  text-align: center;
  font-size: 13px;
}
.sucursal-bar strong { color: var(--cic-accent-light); }
.sucursal-bar .change-link {
  color: white;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 8px;
}

/* ====== HERO / BANNER ====== */
.hero-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 20px;
}
.hero {
  background: linear-gradient(135deg, var(--cic-primary), #1e293b);
  color: white;
  padding: 40px;
  border-radius: var(--cic-radius);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.3) 0%, transparent 70%);
  border-radius: 50%;
}
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
  position: relative;
  line-height: 1.2;
}
.hero p {
  font-size: 16px;
  opacity: 0.85;
  max-width: 600px;
  position: relative;
}

/* ====== MAIN LAYOUT ====== */
.catalogo-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
}

@media (max-width: 768px) {
  .catalogo-main {
    grid-template-columns: 1fr;
  }
  .sidebar-cat {
    display: none;
  }
  .mobile-filter-btn {
    display: flex !important;
  }
}

/* ====== SIDEBAR CATEGORÍAS ====== */
.sidebar-cat {
  position: sticky;
  top: 80px;
  align-self: start;
}
.sidebar-cat h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cic-text-muted);
  margin-bottom: 12px;
  padding: 0 12px;
}
.sidebar-cat .cat-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--cic-text);
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-cat .cat-item:hover {
  background: white;
}
.sidebar-cat .cat-item.active {
  background: var(--cic-primary);
  color: white;
  font-weight: 600;
}
.sidebar-cat .cat-item .icono {
  font-size: 16px;
}
.sidebar-cat .cat-item .count {
  margin-left: auto;
  background: rgba(0,0,0,0.06);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.sidebar-cat .cat-item.active .count {
  background: rgba(255,255,255,0.2);
}

.mobile-filter-btn {
  display: none;
  margin-bottom: 16px;
}

/* ====== SECCIÓN ====== */
.seccion {
  margin-bottom: 32px;
}
.seccion-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.seccion-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--cic-text);
}
.seccion-header .subtitle {
  color: var(--cic-text-muted);
  font-size: 13px;
  margin-top: 2px;
}
.seccion-header .ver-todos {
  font-size: 13px;
  color: var(--cic-accent);
  font-weight: 600;
  cursor: pointer;
}

/* ====== GRID DE PRODUCTOS ====== */
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
@media (max-width: 500px) {
  .productos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

.producto-card {
  background: white;
  border-radius: var(--cic-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  border: 1px solid var(--cic-border);
  position: relative;
  display: flex;
  flex-direction: column;
}
.producto-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cic-shadow-lg);
  border-color: var(--cic-accent);
}

.producto-card .img-container {
  aspect-ratio: 1 / 1;
  background: var(--cic-bg);
  position: relative;
  overflow: hidden;
}
.producto-card .img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.producto-card:hover .img-container img {
  transform: scale(1.05);
}
.producto-card .img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.2;
}

/* Badges */
.producto-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1;
}
.badge {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: var(--cic-shadow-sm);
}
.badge-destacado {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}
.badge-novedad {
  background: linear-gradient(135deg, #34d399, #10b981);
  color: white;
}
.badge-agotado {
  background: linear-gradient(135deg, #64748b, #475569);
  color: white;
}
.badge-proximo {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: white;
}

/* Info del producto */
.producto-info {
  padding: 12px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.producto-categoria {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cic-text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.producto-nombre {
  font-size: 14px;
  font-weight: 600;
  color: var(--cic-text);
  line-height: 1.3;
  margin-bottom: 4px;
  /* Clamp a 2 líneas */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.producto-sku {
  font-size: 11px;
  color: var(--cic-text-muted);
  font-family: monospace;
  margin-bottom: 8px;
}
.producto-precios {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--cic-border);
}
.precio-locked {
  font-size: 12px;
  color: var(--cic-text-muted);
  font-weight: 500;
  text-align: center;
  padding: 4px 0;
}
.precio-locked a {
  font-weight: 700;
}

/* Agotado: toda la card atenuada */
.producto-card.agotado .img-container img,
.producto-card.agotado .img-placeholder {
  filter: grayscale(100%);
  opacity: 0.6;
}
.producto-card.agotado .producto-info {
  opacity: 0.7;
}

/* Variantes indicator */
.variantes-ind {
  font-size: 11px;
  color: var(--cic-text-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ====== EMPTY STATE ====== */
.empty-state {
  padding: 80px 20px;
  text-align: center;
  color: var(--cic-text-muted);
}
.empty-state .icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 {
  color: var(--cic-text);
  margin-bottom: 8px;
  font-size: 18px;
}

/* ====== LOADER ====== */
.loader {
  padding: 80px 20px;
  text-align: center;
  color: var(--cic-text-muted);
}
.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--cic-border);
  border-top-color: var(--cic-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== MODAL ====== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-backdrop.show {
  display: flex;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  background: white;
  border-radius: var(--cic-radius);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--cic-shadow-lg);
}
.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--cic-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 18px;
  margin: 0;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--cic-text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.modal-close:hover {
  background: var(--cic-bg);
}
.modal-body {
  padding: 20px;
}
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--cic-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Selector de sucursal (modal) */
.sucursal-opcion {
  display: block;
  width: 100%;
  padding: 16px;
  margin-bottom: 8px;
  border: 2px solid var(--cic-border);
  border-radius: var(--cic-radius-sm);
  cursor: pointer;
  text-align: left;
  background: white;
  font-family: inherit;
  transition: all 0.15s;
}
.sucursal-opcion:hover {
  border-color: var(--cic-accent);
}
.sucursal-opcion.selected {
  border-color: var(--cic-accent);
  background: #fff7ed;
}
.sucursal-opcion h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.sucursal-opcion .info {
  font-size: 12px;
  color: var(--cic-text-muted);
}

/* ====== FOOTER ====== */
.catalogo-footer {
  background: var(--cic-primary);
  color: white;
  padding: 32px 20px;
  margin-top: 60px;
  text-align: center;
}
.catalogo-footer .inner {
  max-width: 1280px;
  margin: 0 auto;
}
.catalogo-footer .brand-ft {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 4px;
}
.catalogo-footer .slogan-ft {
  opacity: 0.7;
  font-size: 13px;
  margin-bottom: 16px;
}
.catalogo-footer .links {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 13px;
  margin-bottom: 16px;
}
.catalogo-footer a {
  color: white;
  opacity: 0.8;
}
.catalogo-footer a:hover {
  opacity: 1;
}
.catalogo-footer .copyright {
  opacity: 0.5;
  font-size: 12px;
}

/* ====== TOAST ====== */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: white;
  padding: 14px 18px;
  border-radius: 8px;
  box-shadow: var(--cic-shadow-lg);
  z-index: 2000;
  max-width: 340px;
  font-size: 14px;
  border-left: 4px solid var(--cic-accent);
  animation: slideIn 0.25s;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.success { border-left-color: var(--cic-success); }
.toast.danger { border-left-color: var(--cic-danger); }
.toast.warning { border-left-color: var(--cic-warning); }

/* ====== MODAL DETALLE PRODUCTO ====== */
.modal-producto {
  max-width: 900px !important;
  max-height: 92vh;
}
.modal-producto .modal-body {
  padding: 0;
}
.prod-detalle-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 480px;
}
@media (max-width: 768px) {
  .prod-detalle-layout {
    grid-template-columns: 1fr;
  }
}

.prod-galeria {
  background: var(--cic-bg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 540px;
}
.prod-img-principal {
  aspect-ratio: 1/1;
  background: white;
  border-radius: var(--cic-radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid var(--cic-border);
  max-height: 400px;
  flex-shrink: 1;
  min-height: 0;
}
.prod-img-principal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.2s;
}
.prod-img-principal .img-placeholder-big {
  font-size: 100px;
  opacity: 0.15;
}
.prod-img-principal .badges-detalle {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}
/* ==== Thumbs horizontales estilo POS ==== */
.prod-thumbs {
  display: flex;
  flex-direction: row !important;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--cic-accent) transparent;
  flex-shrink: 0;
}
.prod-thumbs::-webkit-scrollbar {
  height: 6px;
}
.prod-thumbs::-webkit-scrollbar-track {
  background: transparent;
}
.prod-thumbs::-webkit-scrollbar-thumb {
  background: var(--cic-border);
  border-radius: 3px;
}
.prod-thumbs:hover::-webkit-scrollbar-thumb {
  background: var(--cic-accent-light);
}
.prod-thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--cic-border);
  background: white;
  transition: all 0.15s;
  display: block;
  position: relative;
}
.prod-thumb:hover {
  border-color: var(--cic-accent-light);
  transform: translateY(-1px);
}
.prod-thumb.active {
  border-color: var(--cic-accent);
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}
.prod-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Título debajo del thumb en hover (tooltip fake) */
.prod-thumb::after {
  content: attr(title);
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cic-primary);
  color: white;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}
.prod-thumb:hover::after {
  opacity: 1;
}

/* Móvil: galería más compacta */
@media (max-width: 768px) {
  .prod-galeria {
    padding: 16px;
    max-height: none;
  }
  .prod-img-principal {
    max-height: 280px;
  }
  .prod-thumb {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
  }
}

.prod-info {
  padding: 28px 28px 100px;
  overflow-y: auto;
  position: relative;
}
.prod-info .categoria-small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cic-text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.prod-info h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--cic-text);
  margin-bottom: 6px;
  line-height: 1.25;
}
.prod-info .sku-detalle {
  font-size: 12px;
  font-family: monospace;
  color: var(--cic-text-muted);
  margin-bottom: 14px;
}
.prod-info .descripcion {
  font-size: 13px;
  color: var(--cic-text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--cic-border);
}

/* Bloque de precios (3 niveles) */
.precios-bloque {
  background: var(--cic-bg);
  border-radius: var(--cic-radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}
.precios-bloque h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cic-text-muted);
  margin-bottom: 10px;
}
.precios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.precio-nivel {
  background: white;
  padding: 10px 8px;
  border-radius: 6px;
  text-align: center;
  border: 2px solid transparent;
  position: relative;
  transition: all 0.2s;
}
.precio-nivel.activo {
  border-color: var(--cic-accent);
  background: #fff7ed;
}
.precio-nivel.activo::before {
  content: "✓ ACTUAL";
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cic-accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
}
.precio-nivel .nivel-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cic-text-muted);
  margin-bottom: 4px;
}
.precio-nivel .nivel-precio {
  font-size: 16px;
  font-weight: 800;
  color: var(--cic-text);
  line-height: 1.1;
}
.precio-nivel .nivel-cantidad {
  font-size: 10px;
  color: var(--cic-text-muted);
  margin-top: 2px;
}
.precio-nivel.activo .nivel-precio {
  color: var(--cic-accent-dark);
}

.ayuda-precios {
  font-size: 12px;
  color: var(--cic-accent-dark);
  background: #fff7ed;
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 10px;
  border-left: 3px solid var(--cic-accent);
}

/* Variantes */
.variantes-selector {
  margin-bottom: 16px;
}
.variantes-selector h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--cic-text);
  margin-bottom: 8px;
}
.variantes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.variante-btn {
  padding: 8px 14px;
  border: 2px solid var(--cic-border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
  position: relative;
}
.variante-btn:hover {
  border-color: var(--cic-accent);
}
.variante-btn.selected {
  border-color: var(--cic-accent);
  background: #fff7ed;
  color: var(--cic-accent-dark);
  font-weight: 600;
}
.variante-btn.agotada {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: line-through;
}
.variante-btn .stock-var {
  font-size: 10px;
  color: var(--cic-text-muted);
  display: block;
  margin-top: 2px;
}
.variante-btn.selected .stock-var { color: var(--cic-accent-dark); }

/* ==== Mini-tabla multi-variante ==== */
.multivar-tabla {
  background: white;
  border: 1px solid var(--cic-border);
  border-radius: var(--cic-radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}
.multivar-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--cic-border);
  transition: background 0.15s;
}
.multivar-row:last-child { border-bottom: none; }
.multivar-row:hover { background: var(--cic-bg); }
.multivar-row.agotada { opacity: 0.5; }
.multivar-row.con-cantidad { background: #fff7ed; }
.multivar-row .var-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--cic-text);
  line-height: 1.2;
}
.multivar-row .var-nombre .sub {
  font-size: 10px;
  color: var(--cic-text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.multivar-row .var-stock {
  font-size: 11px;
  color: var(--cic-text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.multivar-row .var-stock.pocos {
  color: var(--cic-warning);
}
.multivar-row .var-stock.agotado-txt {
  color: var(--cic-danger);
}
.multivar-row .cantidad-mini {
  display: flex;
  align-items: center;
  border: 1px solid var(--cic-border);
  border-radius: 6px;
  overflow: hidden;
  height: 30px;
  background: white;
}
.multivar-row .cantidad-mini button {
  width: 26px;
  height: 28px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--cic-text);
}
.multivar-row .cantidad-mini button:hover { background: var(--cic-bg); }
.multivar-row .cantidad-mini button:disabled { opacity: 0.3; cursor: not-allowed; }
.multivar-row .cantidad-mini input {
  width: 40px;
  height: 28px;
  text-align: center;
  border: none;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
}

.multivar-resumen {
  background: var(--cic-bg);
  padding: 10px 14px;
  border-radius: var(--cic-radius-sm);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}
.multivar-resumen .total-unid {
  font-weight: 600;
}
.multivar-resumen .total-unid strong {
  color: var(--cic-accent-dark);
  font-size: 16px;
  margin-right: 2px;
}
.multivar-resumen .nivel-indicador {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--cic-accent);
  color: white;
  border-radius: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* Cantidad + agregar */
.cantidad-bloque {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.cantidad-control {
  display: flex;
  align-items: center;
  border: 2px solid var(--cic-border);
  border-radius: 8px;
  overflow: hidden;
  height: 42px;
}
.cantidad-control button {
  width: 36px;
  height: 40px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--cic-text);
  transition: background 0.15s;
}
.cantidad-control button:hover {
  background: var(--cic-bg);
}
.cantidad-control button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.cantidad-control input {
  width: 56px;
  height: 40px;
  text-align: center;
  border: none;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
}

.prod-footer-sticky {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 28px;
  background: white;
  border-top: 1px solid var(--cic-border);
  display: flex;
  gap: 10px;
  align-items: center;
}
.prod-footer-sticky .total-preview {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cic-text-muted);
  flex: 1;
}
.prod-footer-sticky .total-preview strong {
  display: block;
  font-size: 20px;
  color: var(--cic-accent-dark);
  margin-top: 2px;
}
.prod-footer-sticky .btn {
  padding: 12px 20px;
}

/* Stock indicator */
.stock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 12px;
}
.stock-indicator.disponible {
  background: #dcfce7;
  color: #166534;
}
.stock-indicator.limitado {
  background: #fef3c7;
  color: #92400e;
}
.stock-indicator.agotado {
  background: #fee2e2;
  color: #991b1b;
}

/* Login prompt en modal (precios bloqueados) */
.precios-locked-box {
  background: linear-gradient(135deg, var(--cic-primary), #1e293b);
  color: white;
  padding: 20px;
  border-radius: var(--cic-radius-sm);
  margin-bottom: 16px;
  text-align: center;
}
.precios-locked-box .icono {
  font-size: 36px;
  margin-bottom: 8px;
}
.precios-locked-box h4 {
  font-size: 15px;
  margin-bottom: 6px;
  color: white;
}
.precios-locked-box p {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 12px;
}
.precios-locked-box .btn {
  background: var(--cic-accent);
  color: white;
}
.precios-locked-box .btn:hover {
  background: var(--cic-accent-light);
}

/* Usuario logueado en header */
.user-pill {
  background: #fff7ed;
  border: 1px solid var(--cic-accent-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--cic-accent-dark);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.user-pill:hover {
  background: #ffedd5;
}

/* ==================== CARRITO LATERAL ==================== */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
  display: none;
  backdrop-filter: blur(2px);
}
.cart-backdrop.show {
  display: block;
  animation: fadeIn 0.2s;
}

.cart-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: white;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease-out;
  box-shadow: -10px 0 30px rgba(0,0,0,0.2);
}
.cart-panel.show {
  transform: translateX(0);
}

.cart-header {
  padding: 20px;
  border-bottom: 1px solid var(--cic-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--cic-primary);
  color: white;
}
.cart-header h3 {
  font-size: 16px;
  margin: 0;
}
.cart-header .modal-close {
  color: white;
}
.cart-header .modal-close:hover {
  background: rgba(255,255,255,0.1);
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  padding: 12px;
  background: var(--cic-bg);
  border-radius: var(--cic-radius-sm);
  margin-bottom: 10px;
  position: relative;
}
.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--cic-border);
}
.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-item-img .ph {
  font-size: 24px;
  opacity: 0.3;
}
.cart-item-info {
  min-width: 0;
}
.cart-item-info .nombre {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item-info .variante {
  font-size: 11px;
  color: var(--cic-text-muted);
  margin-bottom: 6px;
}
.cart-item-info .precio-unit {
  font-size: 11px;
  color: var(--cic-text-muted);
  margin-bottom: 6px;
}
.cart-item-info .nivel-tag {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  background: var(--cic-accent);
  color: white;
  border-radius: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 4px;
}
.cart-item-qty {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cart-qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--cic-border);
  border-radius: 6px;
  overflow: hidden;
  height: 28px;
  background: white;
}
.cart-qty-control button {
  width: 24px;
  height: 26px;
  background: white;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--cic-text);
}
.cart-qty-control button:hover { background: var(--cic-bg); }
.cart-qty-control button:disabled { opacity: 0.3; cursor: not-allowed; }
.cart-qty-control input {
  width: 36px;
  height: 26px;
  text-align: center;
  border: none;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  outline: none;
  background: white;
}
.cart-item-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--cic-accent-dark);
}
.cart-item-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--cic-text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}
.cart-item-remove:hover {
  color: var(--cic-danger);
  background: #fee2e2;
}

.cart-empty {
  padding: 80px 20px;
  text-align: center;
  color: var(--cic-text-muted);
}
.cart-empty .icono {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--cic-border);
  background: white;
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13px;
}
.cart-subtotal-row strong {
  font-size: 16px;
  color: var(--cic-accent-dark);
}
.cart-nota {
  font-size: 11px;
  color: var(--cic-text-muted);
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--cic-bg);
  border-radius: 6px;
  line-height: 1.4;
}

/* ==================== CHECKOUT ==================== */
.checkout-resumen {
  background: var(--cic-bg);
  padding: 14px;
  border-radius: var(--cic-radius-sm);
  margin-bottom: 16px;
}
.checkout-resumen .item-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}
.checkout-resumen .item-line:not(:last-child) {
  border-bottom: 1px dashed var(--cic-border);
}
.checkout-resumen .item-desc {
  flex: 1;
  min-width: 0;
}
.checkout-resumen .item-desc strong {
  display: block;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.checkout-resumen .item-desc .sub {
  font-size: 11px;
  color: var(--cic-text-muted);
}
.checkout-resumen .item-total {
  font-weight: 700;
  white-space: nowrap;
}
.checkout-total-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--cic-primary);
  color: white;
  border-radius: var(--cic-radius-sm);
  font-size: 15px;
  font-weight: 700;
  margin-top: 10px;
}
.checkout-total-line strong {
  color: var(--cic-accent-light);
  font-size: 17px;
}

/* ==================== CONFIRMACIÓN APARTADO ==================== */
.apartado-exito {
  text-align: center;
  padding: 24px 12px 12px;
}
.apartado-exito .check-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin-bottom: 16px;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}
.apartado-exito h3 {
  font-size: 20px;
  margin-bottom: 4px;
}
.apartado-exito .folio-big {
  font-size: 22px;
  font-weight: 800;
  color: var(--cic-accent-dark);
  font-family: monospace;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  background: #fff7ed;
  border-radius: 8px;
  display: inline-block;
  margin: 10px 0;
  border: 2px dashed var(--cic-accent);
}
.apartado-exito .instrucciones {
  text-align: left;
  background: var(--cic-bg);
  padding: 14px;
  border-radius: var(--cic-radius-sm);
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.6;
}
.apartado-exito .instrucciones ol {
  margin: 0;
  padding-left: 20px;
}
.apartado-exito .instrucciones li {
  margin-bottom: 6px;
}

.transferencia-box {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  padding: 16px;
  border-radius: var(--cic-radius-sm);
  margin-top: 16px;
  text-align: left;
}
.transferencia-box h4 {
  font-size: 14px;
  color: #1e40af;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.transferencia-box .datos-pago {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  font-size: 13px;
  align-items: center;
}
.transferencia-box .datos-pago .label {
  color: #475569;
  font-weight: 500;
}
.transferencia-box .datos-pago .valor {
  font-weight: 700;
  color: #0f172a;
  font-family: monospace;
}
.transferencia-box .btn-copiar {
  padding: 2px 8px;
  font-size: 10px;
  border: 1px solid #93c5fd;
  background: white;
  color: #1e40af;
  border-radius: 4px;
  cursor: pointer;
}
.transferencia-box .btn-copiar:hover {
  background: #dbeafe;
}
.transferencia-box .mensaje {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #bfdbfe;
  font-size: 12px;
  color: #1e40af;
  line-height: 1.5;
}

.tiempo-expiracion {
  background: #fef3c7;
  color: #92400e;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
  border-left: 4px solid var(--cic-warning);
}

/* Stock warning */
.stock-warning {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 8px;
}

/* Animaciones */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.shake {
  animation: shake 0.3s;
}

/* ====== UTILS ====== */
.text-muted { color: var(--cic-text-muted); }
.text-sm { font-size: 12px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

.hidden { display: none !important; }
