/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,600;1,700&family=Poppins:wght@300;500;600;700&display=swap');

:root {
  /* Paleta de colores */
  --color-primario: #4a6fa5;
  --color-primario-oscuro: #3a5a8c;
  --color-primario-claro: #6b8cae;
  --color-secundario: #ff7e5f;
  --color-fondo: #f8f9fa;
  --color-fondo-secundario: #e9ecef;
  --color-texto: #000000;
  --color-texto-claro: #333333;
  --color-borde: #dee2e6;
  --color-blanco: #ffffff;
  --color-exito: #28a745;
  --color-alerta: #ffc107;
  --color-peligro: #dc3545;
  --color-destacado: #6f42c1;
  --color-morado: #8c33ff;
  
  /* Sombras */
  --sombra-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --sombra: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --sombra-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --sombra-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Bordes */
  --radio-borde: 0.75rem;
  --radio-borde-sm: 0.5rem;
  
  /* Transiciones */
  --transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-index */
  --z-index-nav: 1000;
  --z-index-modal: 2000;
  --z-index-whatsapp: 999;
}

/* ======================
   RESET Y BASE
   ====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--color-texto);
  background-color: var(--color-fondo);
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

/* ======================
   NAVBAR
   ====================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: white;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: var(--z-index-nav);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
  height: 80px;
  transition: var(--transicion);
}

.navbar.scrolled {
  padding: 10px 40px;
  height: 70px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Logo */
.logo,
.logo-link {
  display: flex;
  align-items: center;
  gap: 15px;
  font-weight: 700;
  font-size: clamp(18px, 4vw, 24px);
  color: #333;
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.logo-img {
  height: clamp(35px, 5vw, 40px);
  width: auto;
  border-radius: 50%;
  transition: transform 0.5s ease-in-out;
  animation: float 4s ease-in-out infinite;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  object-fit: contain;
  flex-shrink: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.logo-text {
  color: #333;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* Navegación */
.nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-morado);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-morado);
}

/* Iconos de navegación */
.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-btn,
.user-btn,
.cart-link {
  color: #444;
  text-decoration: none;
  transition: var(--transicion);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: relative;
}

.search-btn:hover,
.user-btn:hover,
.cart-link:hover {
  color: var(--color-morado);
  background-color: rgba(140, 51, 255, 0.1);
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #2d3559;
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  padding: 2px 5px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Menú móvil */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1002;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
}

.hamburger {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #333;
  transition: var(--transicion);
  transform-origin: center;
}

.menu-toggle.active .hamburger:nth-child(1) {
  transform: translateY(11px) rotate(45deg);
}

.menu-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
  transform: translateY(-11px) rotate(-45deg);
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* ======================
   CONTENIDO PRINCIPAL
   ====================== */
.contenido-principal {
  padding-top: 120px;
  min-height: calc(100vh - 200px);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.contenedor {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header de la página */
.pagina-header {
  text-align: center;
  margin-bottom: 3rem;
}

.titulo-pagina {
  font-size: 2.5rem;
  color: #2d3559;
  margin-bottom: 2rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.titulo-pagina::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--color-primario);
}

/* Buscador */
.buscador {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.buscador input {
  width: 100%;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 2px solid var(--color-borde);
  border-radius: 50px;
  font-size: 1rem;
  transition: var(--transicion);
  background-color: white;
}

.buscador input:focus {
  outline: none;
  border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.2);
}

.buscador .material-icons {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-texto-claro);
  pointer-events: none;
}

/* ======================
   FILTROS
   ====================== */
.filtros-container {
  margin-bottom: 2rem;
  width: 100%;
}

.filtros-categorias {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem 0;
}

.filtro-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--color-borde);
  border-radius: 50px;
  background-color: white;
  color: var(--color-texto);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transicion);
  text-transform: capitalize;
  font-family: 'Poppins', sans-serif;
}

.filtro-btn .material-icons {
  font-size: 1.2rem;
}

.filtro-btn:hover {
  background-color: var(--color-fondo-secundario);
  border-color: var(--color-primario);
  color: var(--color-primario);
  transform: translateY(-2px);
}

.filtro-btn.active {
  background-color: var(--color-primario);
  border-color: var(--color-primario);
  color: white;
  box-shadow: var(--sombra);
}

.filtro-btn.active .material-icons {
  color: white;
}

/* ======================
   PRODUCTOS GRID - 4 COLUMNAS
   ====================== */
.products-grid,
.productos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

.products-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.product-card,
.producto-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  border: 1px solid #f0f0f0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.product-card:hover,
.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Imagen del producto */
.product-image-container {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: #f8fafc;
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image,
.producto-card:hover .product-image {
  transform: scale(1.05);
}

/* Badge destacado */
.product-badge,
.producto-destacado {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--color-primario);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

/* Información del producto */
.product-info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.producto-categoria {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--color-primario);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #333;
  line-height: 1.4;
  min-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primario);
  margin: 0.5rem 0;
}

/* Detalles del producto */
.producto-detalles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  color: #666;
}

.producto-talla,
.producto-color {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.producto-talla i,
.producto-color i {
  color: var(--color-primario);
  font-size: 0.9rem;
}

/* Acciones del producto */
.product-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-borde);
}

.btn-ver-detalle,
.btn-view-details {
  flex: 1;
  padding: 0.7rem 1rem;
  background: var(--color-morado);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transicion);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

.btn-ver-detalle:hover,
.btn-view-details:hover {
  background: var(--color-primario);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(140, 51, 255, 0.3);
}

.btn-ver-detalle i,
.btn-view-details i {
  font-size: 0.9rem;
}

/* ======================
   ESTADOS
   ====================== */
.loading,
.error-container,
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  min-height: 300px;
}

.loading {
  display: none;
}

.spinner {
  border: 4px solid var(--color-borde);
  border-top: 4px solid var(--color-primario);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-container i,
.no-results i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.error-container p,
.no-results p {
  color: #64748b;
  font-size: 1.1rem;
}

.contador-resultados {
  text-align: center;
  margin: 1rem 0;
  font-size: 1.1rem;
  color: #666;
  font-weight: 500;
}

/* ======================
   FOOTER
   ====================== */
.footer,
#footer-placeholder {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
}

.footer-section h3 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
  font-weight: 600;
}

.footer-section h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background: var(--color-primario);
}

.footer-section p {
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.8rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: var(--transicion);
  display: block;
  padding: 0.3rem 0;
}

.footer-links a:hover {
  color: var(--color-primario-claro);
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  transition: var(--transicion);
}

.social-links a:hover {
  background: var(--color-primario);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #888;
}

/* Botón WhatsApp */
.whatsapp-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #25D366;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: var(--z-index-whatsapp);
  transition: var(--transicion);
  text-decoration: none;
}

.whatsapp-button:hover {
  background-color: #128C7E;
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ======================
   RESPONSIVE
   ====================== */

/* ===============================
   GRID BASE (UNA SOLA DEFINICIÓN)
   =============================== */
.products-grid,
.productos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 0;
  box-sizing: border-box;
}

/* Refuerzo tarjetas */
.product-card,
.producto-card {
  width: 100%;
  min-width: 0;
  margin: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 10px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.producto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Imagen */
.product-image-container {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.producto-card:hover .product-image {
  transform: scale(1.05);
}

/* Info producto */
.product-info {
  padding: 1.2rem;
}

.product-title {
  font-size: 1rem;
  margin: 0.5rem 0;
  color: #333;
  font-weight: 600;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #4a6fa5;
  margin: 0.5rem 0;
}

.producto-detalles {
  margin: 0.8rem 0;
  font-size: 0.85rem;
  color: #666;
}

.product-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* ===============================
   DESKTOP GRANDE → 4 COLUMNAS
   =============================== */
@media (min-width: 1201px) {
  .products-grid,
  .productos-grid {
    grid-template-columns: repeat(4, minmax(280px, 1fr));
  }
}

/* ===============================
   DESKTOP MEDIANO → 3 COLUMNAS
   =============================== */
@media (min-width: 993px) and (max-width: 1200px) {
  .products-grid,
  .productos-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
  }

  .navbar {
    padding: 15px 2%;
  }
}

/* ===============================
   TABLET → 2 COLUMNAS
   =============================== */
@media (min-width: 577px) and (max-width: 992px) {
  .products-grid,
  .productos-grid {
    grid-template-columns: repeat(2, minmax(240px, 1fr));
  }
}

/* ===============================
   MÓVIL → 1 COLUMNA
   =============================== */
@media (max-width: 576px) {
  .products-grid,
  .productos-grid {
    grid-template-columns: 1fr;
    padding: 1rem 0;
  }

  .producto-card {
    width: 100%;
    margin: 0 auto;
  }

  .product-title {
    font-size: 0.95rem;
    height: auto;
  }

  .product-price {
    font-size: 1.05rem;
  }
}

/* ===============================
   NAVEGACIÓN Y OTROS (SIN CAMBIOS)
   =============================== */
@media (max-width: 992px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 80px;
    right: -100%;
    width: 300px;
    height: calc(100vh - 80px);
    background: white;
    flex-direction: column;
    padding: 2rem;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
  }

  .main-nav.active {
    right: 0;
  }

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

@media (max-width: 768px) {
  .navbar {
    padding: 12px 20px;
    height: 70px;
  }

  .contenido-principal {
    padding-top: 100px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 10px 15px;
    height: 65px;
  }
}

@media (max-width: 360px) {
  .navbar {
    padding: 8px 10px;
  }
}
