/* ============================================================
   RESET Y BASE
   ============================================================ */
* { box-sizing: border-box; font-family: 'Inter', sans-serif; }
html, body { scroll-behavior: smooth; margin: 0; padding: 0; }
body {
  background: #F9FAFB;
  color: #222021;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(34,32,33,0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.logo img { height: 40px; border-radius: 6px; }

/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */
.content {
  display: flex;
  gap: 20px;
  padding: 20px;
  margin-top: 95px !important; /* Compensa navbar real */
  flex: 1;
}

/* ============================================================
   GRID DE PRODUCTOS
   ============================================================ */
.grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 380px;
  transition: .25s;
}
.card-img {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.card-img img { max-height: 100%; object-fit: contain; }

.card h3 {
  font-weight: 600;
  text-align: center;
  margin: 10px 0 6px;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(12px, 1.6vw, 15px);
}

.presentaciones {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
/* SEPARACIÓN ENTRE PRESENTACIONES Y CANTIDAD */
.presentaciones {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px; /* ← FIX */
}


.pres-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.pres-btn.active {
  background: #222021;
  color: #fff;
  border-color: #222021;
}

.cantidad { display: flex; justify-content: center; gap: 8px; }
.cantidad button {
  width: 34px; height: 34px;
  background: #e5e7eb;
  border-radius: 8px;
  border: none;
}
.cantidad input {
  width: 70px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.agregar {
  width: 100%;
  padding: 10px;
  background: #222021;
  border-radius: 10px;
  border: none;
  color: #fff;
  cursor: pointer;
  margin-top: 10px; /* ← ESPACIO NUEVO */
}

/* ============================================================
   SIDEBAR (A COTIZAR) – VERSIÓN FINAL, DEPURADA
   ============================================================ */
.sidebar {
  width: 320px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky !important;
  top: 115px !important;                     /* Alineado perfecto con navbar */
  height: calc(100vh - 130px) !important;    /* Ajuste de viewport */
  overflow-y: auto !important;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Título */
.header-cotizar {
  margin: 0 !important;
  padding: 0 !important;
}
.header-cotizar h3 {
  margin: 0;
}

/* Inputs */
.cliente-inline {
  margin: 6px 0 !important;
  display: block !important;
}
.cliente-inline input {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 8px;
}

/* Carrito */
#carrito {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

/* Item */
.item-carrito {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
}
.borrar { background: none; border: none; font-size: 1.3rem; color: #d33; }

/* Carrito vacío */
#carrito .vacio {
  text-align: center;
  padding: 20px 0;
  color: #777;
}

/* Legal */
.legal {
  font-size: 11px;
  color: #777;
  margin-top: 10px !important;
  text-align: center;
}

/* Acción: vaciar / enviar */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-x {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #e53935;
  border: none;
  color: #fff;
}

.btn-wa {
  flex: 1;
  border: none;
  background: #25D366;
  color: #fff;
  padding: 12px;
  border-radius: 30px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  text-align: center;
  color: rgba(0,0,0,.4);
  padding: 18px 0;
}

/* ============================================================
   ACTIVADORES VISUALES ADICIONALES (FAB, ETC)
   ============================================================ */
.cart-fab {
  position: fixed;
  right: 30px; bottom: 30px;
  width: 58px; height: 58px;
  background: #25D366;
  border-radius: 50%;
  display: flex; justify-content: center; align-items: center;
  border: none;
  box-shadow: 0 4px 8px rgba(0,0,0,.25);
  cursor: pointer;
}
.cart-icon { width: 28px; height: 28px; }

/* POPUP EDAD — CORRECTO, PROFESIONAL Y COMPATIBLE */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0,0,0,0.55) !important;
  backdrop-filter: blur(10px);
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  z-index: 99999 !important;
}

.modal {
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  padding: 30px 20px;
  max-width: 360px;
  width: 90%;
  text-align: center;
}
/* Fix — Logo dentro del popup de edad */
.modal-logo {
  width: 90px !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
  margin: 0 auto 15px auto !important;
}

/* Evitar que reglas globales modifiquen las imágenes del modal */
.modal img {
  max-width: 100% !important;
  height: auto !important;
}
/* Restauración del comportamiento del popup */
.modal-overlay {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .3s ease;
}

.modal-overlay.active {
  opacity: 1 !important;
  pointer-events: all !important;
}

/* NO forzar display:flex cuando no está activo */
.modal-overlay:not(.active) {
  display: flex !important; /* se mantiene para centrar, pero overlay queda invisible */
}
/* ALERTA ESTÉTICA */
.alert-box {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.alert-box.show {
  display: flex;
}

.alert-content {
  background: #fff;
  padding: 20px 24px;
  border-radius: 12px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: pop .25s ease;
}

@keyframes pop {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#alertMessage {
  font-size: 15px;
  margin-bottom: 16px;
  color: #222;
}

#alertBtn {
  background: #222021;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
}

#alertBtn:hover {
  background: #000;
}
/* --- Confirmación estética --- */

.confirm-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-cancel,
.btn-ok {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.btn-cancel {
  background: #e5e5e5;
  color: #222;
}

.btn-cancel:hover {
  background: #d4d4d4;
}

.btn-ok {
  background: #d63b3b;
  color: #fff;
}

.btn-ok:hover {
  background: #b72f2f;
}
