/* ============================================================
   NUBI CATÁLOGO – style.css
   Para cambiar colores principales: modificá las variables en :root
   ============================================================ */

/* ─── Variables globales ─── */
:root {
  /* Paleta principal */
  --negro:          #1a1a1a;
  --blanco:         #ffffff;
  --gris-fondo:     #f2f2f2;
  --gris-borde:     #e0e0e0;
  --gris-texto:     #666666;
  --gris-claro:     #f8f8f8;

  /* Colores de acción */
  --verde-wa:       #25D366;
  --verde-wa-hover: #1db954;
  --azul-link:      #2563eb;
  --rojo:           #e74c3c;
  --verde-sub:      #16a34a;

  /* Tipografía */
  --fuente:         'DM Sans', Arial, sans-serif;

  /* Espaciado */
  --max-ancho:      1100px;
  --radio:          10px;
  --radio-sm:       6px;
  --radio-pill:     50px;

  /* Sombras */
  --sombra-header:  0 2px 10px rgba(0, 0, 0, 0.07);
  --sombra-footer:  0 -4px 20px rgba(0, 0, 0, 0.1);
  --sombra-wa:      0 4px 18px rgba(37, 211, 102, 0.45);

  /* Transiciones */
  --trans-rapida:   0.15s ease;
  --trans-media:    0.2s ease;
  --trans-lenta:    0.3s ease;
}

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

/* ─── Base ─── */
body {
  font-family: var(--fuente);
  background: var(--gris-fondo);
  color: var(--negro);
  min-height: 100vh;
  padding-bottom: 160px; /* espacio para el footer fijo */
  -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════
   HEADER
═══════════════════════════════════════ */
header {
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-borde);
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--sombra-header);
}

.header-inner {
  max-width: var(--max-ancho);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Logo: reemplazá nubi-logo.png por tu archivo en assets/img/logo/ */
.logo img {
  height: 36px;
  width: auto;
  display: block;
}

.header-sub {
  position: absolute;
  right: 0;
  font-size: 12px;
  color: var(--gris-texto);
}

/* ═══════════════════════════════════════
   TOOLBAR – Buscador y categorías
═══════════════════════════════════════ */
.toolbar {
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-borde);
  padding: 12px 20px;
  position: sticky;
  top: 65px; /* altura del header */
  z-index: 99;
}

.toolbar-inner {
  max-width: var(--max-ancho);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Buscador ── */
.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 16px 10px 38px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-pill);
  font-size: 14px;
  font-family: var(--fuente);
  outline: none;
  background: var(--gris-fondo);
  transition: border-color var(--trans-media), background var(--trans-media);
}

.search-box input:focus {
  border-color: var(--negro);
  background: var(--blanco);
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gris-texto);
  font-size: 15px;
  pointer-events: none;
}

/* ── Categorías (chips) ── */
/* Agregá o quitá botones .cat-btn en index.html */
.categorias {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-btn {
  padding: 7px 18px;
  border-radius: var(--radio-pill);
  border: 1.5px solid var(--gris-borde);
  background: var(--blanco);
  font-family: var(--fuente);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans-media);
  color: var(--negro);
  white-space: nowrap;
}

.cat-btn:hover,
.cat-btn.activo {
  background: var(--negro);
  color: var(--blanco);
  border-color: var(--negro);
}

/* ═══════════════════════════════════════
   TABLA – Encabezado
═══════════════════════════════════════ */
.tabla-header {
  max-width: var(--max-ancho);
  margin: 16px auto 0;
  display: grid;
  grid-template-columns: 90px 1fr 110px 90px 80px 120px 110px;
  background: var(--negro);
  color: var(--blanco);
  border-radius: var(--radio) var(--radio) 0 0;
  padding: 10px 16px;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  align-items: center;
}

.th            { text-align: center; }
.th-producto   { text-align: left; }

/* ═══════════════════════════════════════
   TABLA – Filas de productos
═══════════════════════════════════════ */
.tabla-body {
  max-width: var(--max-ancho);
  margin: 0 auto;
  background: var(--blanco);
  border-radius: 0 0 var(--radio) var(--radio);
  border: 1px solid var(--gris-borde);
  border-top: none;
  overflow: hidden;
}

.producto-fila {
  display: grid;
  grid-template-columns: 90px 1fr 110px 90px 80px 120px 110px;
  align-items: center;
  padding: 14px 16px;
  gap: 8px;
  border-bottom: 1px solid #f0f0f0;
  transition: background var(--trans-rapida);
}

.producto-fila:last-child { border-bottom: none; }
.producto-fila:hover      { background: #fafafa; }

/* ── Columna foto ── */
.col-foto { text-align: center; }

.prod-img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radio-sm);
  display: block;
  margin: 0 auto;
  background: var(--gris-fondo);
}

/* El botón "ver más" dispara consulta por WhatsApp */
.ver-mas {
  font-size: 11px;
  color: var(--azul-link);
  cursor: pointer;
  display: block;
  margin-top: 4px;
  text-align: center;
  background: none;
  border: none;
  font-family: var(--fuente);
  padding: 0;
  transition: text-decoration var(--trans-rapida);
}

.ver-mas:hover { text-decoration: underline; }

/* ── Columna info ── */
/* col-info: contenedor de datos de texto del producto (generado por ui.js) */
.col-info { min-width: 0; }

.prod-ingreso { font-size: 11px; color: #bbb; text-align: right; margin-bottom: 4px; }
.prod-nombre  { font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 3px; }
.prod-codigo  { font-size: 11px; color: #aaa; margin-bottom: 4px; }
.prod-desc    { font-size: 12px; color: var(--gris-texto); line-height: 1.4; }

/* ── Columnas precio / unidad / cxb ── */
.col-precio { font-size: 15px; font-weight: 700; text-align: center; }
.col-unidad { font-size: 12px; color: var(--gris-texto); text-align: center; }
.col-cxb    { font-size: 13px; font-weight: 600; text-align: center; color: #555; }

/* ── Controles de cantidad ── */
.col-cantidad {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--gris-borde);
  background: var(--gris-fondo);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-rapida);
  line-height: 1;
  color: var(--negro);
}

.qty-btn.menos { border-radius: var(--radio-sm) 0 0 var(--radio-sm); }
.qty-btn.mas   { border-radius: 0 var(--radio-sm) var(--radio-sm) 0; }

.qty-btn:hover {
  background: var(--negro);
  color: var(--blanco);
  border-color: var(--negro);
}

.qty-num {
  width: 38px;
  height: 30px;
  border: 1.5px solid var(--gris-borde);
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--fuente);
  outline: none;
  background: var(--blanco);
  -moz-appearance: textfield;
}

.qty-num::-webkit-inner-spin-button,
.qty-num::-webkit-outer-spin-button { display: none; }

/* ── Subtotal ── */
.col-subtotal {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  color: #aaa;
  transition: color var(--trans-media);
}

.col-subtotal.activo { color: var(--verde-sub); }

/* ── Sin resultados ── */
.sin-resultados {
  max-width: var(--max-ancho);
  margin: 0 auto;
  background: var(--blanco);
  text-align: center;
  padding: 60px 20px;
  color: var(--gris-texto);
  border-radius: 0 0 var(--radio) var(--radio);
  border: 1px solid var(--gris-borde);
  border-top: none;
  display: none;
}

.sin-resultados-icono {
  font-size: 36px;
  margin-bottom: 10px;
}

/* ═══════════════════════════════════════
   CONDICIONES DE COMPRA
   Editá los textos directamente en index.html, sección #condiciones
═══════════════════════════════════════ */
.condiciones {
  max-width: var(--max-ancho);
  margin: 20px auto 16px;
  background: var(--blanco);
  border-radius: var(--radio);
  border: 1px solid var(--gris-borde);
  padding: 20px 24px;
}

.condiciones-titulo {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #555;
  margin-bottom: 14px;
}

.condiciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.cond-item {
  background: var(--gris-claro);
  border-radius: var(--radio-sm);
  padding: 12px 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.cond-icono { font-size: 20px; }

.cond-texto strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
}

.cond-texto span { font-size: 12px; color: var(--gris-texto); }

/* ═══════════════════════════════════════
   FOOTER CARRITO FIJO
═══════════════════════════════════════ */
.footer-carrito {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--blanco);
  border-top: 2px solid var(--gris-borde);
  z-index: 200;
  box-shadow: var(--sombra-footer);
}

.footer-inner {
  max-width: var(--max-ancho);
  margin: 0 auto;
  padding: 12px 20px;
}

/* ── Detalle del carrito (expandible) ── */
.carrito-detalle {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--trans-lenta);
}

.carrito-detalle.abierto {
  max-height: 220px;
  overflow-y: auto;
}

.carrito-fila {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.carrito-fila:last-child { border-bottom: none; }

.cf-nombre { font-weight: 600; flex: 1; }
.cf-qty    { color: var(--gris-texto); margin: 0 12px; white-space: nowrap; }
.cf-precio { font-weight: 700; color: var(--verde-sub); white-space: nowrap; }

/* ── Totales ── */
.footer-totales {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.total-label { font-size: 13px; color: var(--gris-texto); }
.total-monto { font-size: 22px; font-weight: 800; color: var(--negro); }
.total-sep   { color: var(--gris-borde); }
.total-items { font-size: 13px; color: var(--gris-texto); }

.btn-detalle {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--azul-link);
  cursor: pointer;
  font-family: var(--fuente);
  padding: 0;
  display: none;
}

/* ── Botón completar pedido ── */
.btn-completar {
  width: 100%;
  background: var(--verde-wa);
  color: var(--blanco);
  border: none;
  border-radius: var(--radio);
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--fuente);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--trans-media);
}

.btn-completar:hover    { background: var(--verde-wa-hover); }
.btn-completar:disabled { background: #ccc; cursor: not-allowed; }

/* ═══════════════════════════════════════
   BOTÓN FLOTANTE DE WHATSAPP
═══════════════════════════════════════ */
.wa-flotante {
  position: fixed;
  bottom: 175px;
  right: 20px;
  background: var(--verde-wa);
  color: var(--blanco);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: var(--sombra-wa);
  text-decoration: none;
  z-index: 150;
  transition: transform var(--trans-media);
}

.wa-flotante:hover { transform: scale(1.1); }

/* ═══════════════════════════════════════
   LIGHTBOX DE IMAGEN
═══════════════════════════════════════ */

/* Bloquea el scroll del body cuando el lightbox está abierto */
body.lb-sin-scroll { overflow: hidden; }

/* Fondo oscuro */
.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: lb-fade-in 0.2s ease;
}

.lb-overlay.lb-abierto {
  display: flex;
}

@keyframes lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Caja blanca central */
.lb-box {
  position: relative;
  background: var(--blanco);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: lb-zoom-in 0.2s ease;
}

@keyframes lb-zoom-in {
  from { transform: scale(0.93); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Botón cerrar (×) */
.lb-cerrar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.55);
  color: var(--blanco);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-media);
  line-height: 1;
}

.lb-cerrar:hover { background: rgba(0, 0, 0, 0.8); }

/* Contenedor de imagen */
.lb-img-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gris-fondo);
  min-height: 260px;
  max-height: 70vh;
  overflow: hidden;
}

.lb-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  padding: 8px;
}

/* Botones anterior / siguiente */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.45);
  color: var(--blanco);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--trans-media);
  z-index: 10;
  line-height: 1;
}

.lb-nav:hover { background: rgba(0, 0, 0, 0.75); }

.lb-prev { left: 10px; }
.lb-next { right: 10px; }

/* Footer del lightbox: nombre y contador */
.lb-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 8px;
  border-top: 1px solid var(--gris-borde);
  min-height: 40px;
}

.lb-nombre {
  font-size: 13px;
  font-weight: 600;
  color: var(--negro);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.lb-contador {
  font-size: 12px;
  color: var(--gris-texto);
  white-space: nowrap;
}

/* ── Responsive lightbox ── */
@media (max-width: 480px) {
  .lb-box     { max-height: 95vh; border-radius: 8px; }
  .lb-nav     { width: 34px; height: 34px; font-size: 18px; }
  .lb-img-wrap { min-height: 200px; }
}

/* ─── Selector de moneda ─── */
.moneda-selector {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: var(--gris-texto);
}

.moneda-selector label { font-weight: 600; }

.moneda-selector select {
  padding: 7px 12px;
  border: 1.5px solid var(--gris-borde);
  border-radius: var(--radio-pill);
  background: var(--blanco);
  color: var(--negro);
  font-family: var(--fuente);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.moneda-selector select:focus { border-color: var(--negro); }

@media (max-width: 600px) {
  .moneda-selector { justify-content: stretch; }
  .moneda-selector select { flex: 1; }
}
