/**
 * Estilos del Catálogo y Home de la Multitienda (index.html)
 * - Hero de Autoridad y Beneficios COD
 * - Buscador en vivo instantáneo y selector de categorías
 * - Grilla de Productos de Alta Conversión
 * - Sección de Garantías y Confianza Nacional
 */

/* ==========================================================================
   HERO DE LA MULTITIENDA
   ========================================================================== */
.home-hero-section {
  background: radial-gradient(100% 100% at 50% 0%, #ecfdf5 0%, #f8fafc 100%);
  padding-top: var(--space-12);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 700;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.home-hero-badge .dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.home-hero-title {
  font-size: var(--font-3xl);
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-4);
}

.home-hero-title .text-gradient {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero-subtitle {
  font-size: var(--font-md);
  color: var(--color-text-body);
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-6);
  line-height: 1.6;
}

.home-hero-perks {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero-perk-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--color-text-main);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .home-hero-section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
  .home-hero-perks {
    gap: 8px;
  }
  .hero-perk-item {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

/* ==========================================================================
   BARRA DE BÚSQUEDA EN VIVO Y FILTROS POR CATEGORÍA
   ========================================================================== */
.catalog-toolbar-section {
  padding-top: var(--space-8);
  padding-bottom: var(--space-6);
}

.search-box-wrap {
  position: relative;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-6);
}

.search-icon-inside {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input-field {
  width: 100%;
  height: 52px;
  padding-left: 48px;
  padding-right: 48px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  background: white;
  font-size: var(--font-base);
  color: var(--color-text-main);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.15);
}

.clear-search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--color-bg-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.clear-search-btn:hover {
  background: #e2e8f0;
  color: var(--color-text-main);
}

/* Filtros por Categoría (Pills horizontales) */
.category-pills-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--color-text-body);
  border: 1px solid var(--color-border);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 700;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.category-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.category-pill.is-active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

@media (max-width: 600px) {
  .category-pills-wrap {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
  }
  .category-pill {
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

/* ==========================================================================
   GRILLA DE PRODUCTOS DE ALTA CONVERSIÓN
   ========================================================================== */
.catalog-grid-section {
  padding-bottom: var(--space-16);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-8);
}

.product-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), border-color var(--transition-smooth);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: #cbd5e1;
}

/* Área de Imagen */
.product-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
  overflow: hidden;
}

.product-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  z-index: 2;
}

.card-discount {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-accent);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.4);
  z-index: 2;
}

/* Cuerpo de la Tarjeta */
.product-card-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.stars-gold {
  color: #fbbf24;
  font-size: 0.85rem;
}

.rating-num {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.card-title {
  font-size: var(--font-md);
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.3;
  margin-bottom: 6px;
}

.card-title a {
  transition: color var(--transition-fast);
}

.card-title a:hover {
  color: var(--color-primary);
}

.card-tagline {
  font-size: var(--font-sm);
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-bottom: var(--space-4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-trust-snippet {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #065f46;
  background: #ecfdf5;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
}

.card-pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: auto;
  margin-bottom: var(--space-4);
}

.price-current {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.price-old {
  font-size: 0.95rem;
  color: var(--color-text-light);
  text-decoration: line-through;
  font-weight: 500;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
}

.btn-card-details {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: white;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
  font-size: var(--font-xs);
  font-weight: 700;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-card-details:hover {
  border-color: var(--color-text-main);
  background: var(--color-bg-subtle);
}

.btn-card-cod {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  font-size: var(--font-xs);
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.3);
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-card-cod:hover {
  background: linear-gradient(135deg, #047857 0%, #065f46 100%);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(5, 150, 105, 0.4);
}

/* Estado de Sin Resultados */
.no-results-box {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--color-border);
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: inline-block;
}

.no-results-box h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--color-text-main);
}

.no-results-box p {
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   SECCIÓN DE GARANTÍAS Y POR QUÉ COMPRAR EN MULTITIENDA CHILE
   ========================================================================== */
.home-guarantees-section {
  background: white;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.guarantees-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.guarantee-card {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--color-bg-body);
  border: 1px solid var(--color-border);
  text-align: center;
  transition: transform var(--transition-fast);
}

.guarantee-card:hover {
  transform: translateY(-3px);
}

.guarantee-card-icon {
  width: 52px;
  height: 52px;
  background: #ecfdf5;
  color: var(--color-primary);
  border-radius: var(--radius-md);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.guarantee-card h4 {
  font-size: var(--font-base);
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 8px;
}

.guarantee-card p {
  font-size: 0.85rem;
  color: var(--color-text-body);
  line-height: 1.5;
}
