/**
 * ======================================================
 * ARCHIVO: components.css
 * UBICACIÓN: frontend-public/css/
 * VERSIÓN: 2.0 — REFACTORIZADO (SIN MEDIA QUERIES)
 * ÚLTIMA ACTUALIZACIÓN: 2026-05-31 13:15
 *
 * 🎯 PROPÓSITO:
 * Componentes UI reutilizables: tarjetas, badges, grids, paginación.
 * LAS MEDIA QUERIES ESTÁN EN responsive.css
 *
 * ======================================================
 * 📋 REGLAS PARA PRODUCCIÓN:
 * ------------------------------------------------------
 * - Console.log marcados con // @strip se eliminan
 * - Esta cabecera se elimina en build para cliente
 *
 * ======================================================
 * 📋 HISTORIAL DE CAMBIOS:
 * ------------------------------------------------------
 * [2.0] - 2026-05-31 13:15
 *    ✅ REFACTORIZADO: Eliminadas media queries
 *    ✅ ELIMINADO: Código duplicado
 *    ✅ LIMPIEZA: Organizado por secciones
 *
 * [1.1] - 2026-05-31 08:00
 *    ✅ Versión inicial
 * ======================================================
 */

/* ======================================================
 * GRID DE PRODUCTOS (SOLO ESTRUCTURA BASE)
 * LAS MEDIDAS RESPONSIVE ESTÁN EN responsive.css
 * ====================================================== */

.productos-grid {
  display: grid;
  gap: 24px;
}

/* ======================================================
 * TARJETA DE PRODUCTO
 * ====================================================== */

.producto-card {
  background: var(--baby-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 1px solid var(--card-edge);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.producto-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.producto-img-wrap {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: linear-gradient(145deg, var(--baby-beige), #fff);
  position: relative;
  border-radius: var(--radius);
}

.producto-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--transition);
  border-radius: inherit;
}

.producto-card:hover .producto-img-wrap img {
  transform: scale(1.08);
}

.producto-card h3 {
  margin: 16px 18px 4px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.producto-categoria {
  margin: 0 18px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--theme-strong);
}

.catalog-preview-note {
  margin: 0 0 12px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-soft);
  background: rgba(144, 202, 249, 0.15);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--theme-strong);
}

.catalog-toolbar {
  margin: 0 0 24px;
}

.catalog-filters-label {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
}

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-filter-btn {
  border: 1px solid var(--card-edge);
  background: var(--baby-white);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.catalog-filter-btn:hover,
.catalog-filter-btn:focus-visible {
  border-color: var(--theme-strong);
  outline: none;
}

.catalog-filter-btn.is-active {
  background: var(--theme-strong);
  border-color: var(--theme-strong);
  color: #fff;
}

.precio {
  margin: 0 18px 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent-price);
}

.precio-original {
  margin: 0 18px 4px;
  font-size: 0.85rem;
  color: var(--text-soft);
  text-decoration: line-through;
}

.producto-desc {
  margin: 0 18px 16px;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.5;
  flex: 1;
}

/* ======================================================
 * BADGES
 * ====================================================== */

.promo-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #ff6b6b, #ff4757);
  color: white;
  padding: 5px 12px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
  backdrop-filter: blur(4px);
}

.stock-badge-out {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(158, 158, 158, 0.9);
  color: white;
  padding: 5px 12px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* ======================================================
 * BOTONES DE CARRITO
 * ====================================================== */

.btn-add-cart {
  background: linear-gradient(135deg, var(--wa), var(--wa-dark));
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin: 0 18px 18px;
  width: calc(100% - 36px);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-add-cart:hover {
  background: linear-gradient(135deg, var(--wa-dark), var(--wa));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

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

/* ======================================================
 * BOTONES NIÑO / NIÑA - CENTRADOS CON ESTILO MODERNO
 * ====================================================== */

.page-theme-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 16px 0;
  margin: 8px 0;
}

.theme-toggle.theme-toggle--bar {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 60px;
  padding: 8px 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 110px;
  padding: 12px 20px;
  border: none;
  border-radius: 50px;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  font-family: var(--font);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.theme-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  background: #f8f8f8;
}

.theme-btn.is-active {
  background: linear-gradient(135deg, var(--theme-soft), var(--theme-strong));
  color: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.theme-btn.is-active:hover {
  transform: translateY(-2px);
}

.theme-btn-media {
  width: 60px;
  height: 45px;
  overflow: hidden;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-btn-illu {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
}

.theme-btn-text {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ======================================================
 * PAGINACIÓN
 * ====================================================== */

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  padding: 20px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--card-edge);
  background: var(--baby-white);
  color: var(--text);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--theme-soft);
  border-color: var(--theme-strong);
  transform: translateY(-2px);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--theme-soft), var(--theme-strong));
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 8px;
  color: var(--text-soft);
  font-weight: 600;
}

.page-info {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-left: 16px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 20px;
}

/* ======================================================
 * LOADING SPINNER
 * ====================================================== */

.loading-spinner {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-soft);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.loading-spinner::before {
  content: "";
  width: 24px;
  height: 24px;
  border: 3px solid var(--theme-soft);
  border-top-color: var(--theme-strong);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ======================================================
 * EMPTY / ERROR MESSAGES
 * ====================================================== */

.empty-message {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-soft);
  font-size: 1rem;
  background: var(--baby-beige);
  border-radius: var(--radius);
  margin: 20px;
}

.error-message {
  text-align: center;
  padding: 60px 20px;
  color: #c62828;
  font-size: 1rem;
  background: rgba(198, 40, 40, 0.05);
  border-radius: var(--radius);
  margin: 20px;
  border: 1px solid rgba(198, 40, 40, 0.2);
}

.catalog-maintenance {
  text-align: center;
  padding: 48px 24px;
  margin: 20px auto;
  max-width: 520px;
  background: linear-gradient(180deg, var(--baby-beige) 0%, #fff 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(144, 202, 249, 0.35);
  box-shadow: 0 8px 24px rgba(42, 49, 66, 0.06);
}

.catalog-maintenance-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.catalog-maintenance h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 1.35rem;
}

.catalog-maintenance p {
  margin: 0 0 12px;
  color: var(--text-soft);
  line-height: 1.55;
}

.catalog-maintenance-note {
  font-size: 0.92rem;
  font-style: italic;
}

.catalog-maintenance-wa {
  margin-top: 8px;
  display: inline-flex;
}

/* ======================================================
 * CATEGORY BLOCKS
 * ====================================================== */

.category-block {
  margin-bottom: 40px;
}

.category-block:last-child {
  margin-bottom: 0;
}

.category-heading {
  margin: 0 0 20px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  padding-bottom: 12px;
  border-bottom: 3px solid var(--theme-soft);
  display: inline-block;
  letter-spacing: -0.02em;
}

.category-heading span {
  background: linear-gradient(135deg, var(--theme-soft), var(--theme-strong));
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.8rem;
  margin-left: 10px;
  color: white;
}

/* ======================================================
 * SIDEBAR LATERAL (MENÚ HAMBURGUESA)
 * ====================================================== */

.sections-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 25;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-shell.sections-menu-open .sections-menu-backdrop {
  opacity: 1;
  visibility: visible;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 85vw);
  background: linear-gradient(180deg, var(--baby-white) 0%, var(--baby-beige) 100%);
  z-index: 26;
  padding: 24px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  border-right: 1px solid var(--card-edge);
}

.app-shell.sections-menu-open .app-sidebar {
  transform: translateX(0);
}

.app-sidebar-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--theme-soft);
  text-align: center;
}

.app-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 80px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--card-edge);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  text-align: center;
}

.sidebar-btn:hover {
  transform: translateX(5px);
  border-color: var(--theme-strong);
  background: white;
  box-shadow: var(--shadow);
}

.sidebar-btn.is-active {
  background: linear-gradient(135deg, var(--theme-soft), var(--theme-strong));
  color: white;
  border-color: transparent;
}

.sidebar-btn--with-bg {
  background-size: cover;
  background-position: center;
}

.sidebar-btn--drawer-catalogo {
  background-image: url("../images/illustrations/nino-2.png");
}

.sidebar-btn--baby {
  background-image: url("../images/illustrations/ambos-2.png");
}

.sidebar-btn--drawer-promo {
  background-image: url("../images/illustrations/ambos-4.png");
}

.sidebar-btn--with-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.sidebar-btn--with-bg:hover::before {
  background: rgba(0, 0, 0, 0.5);
}

.sidebar-btn-label {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 16px;
  border-radius: 30px;
  backdrop-filter: blur(4px);
}

.sidebar-btn.is-active .sidebar-btn-label {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}