/**
 * ======================================================
 * ARCHIVO: catalog-home.css
 * UBICACIÓN: frontend/public/styles/
 * VERSIÓN: 1.0
 * ÚLTIMA ACTUALIZACIÓN: 2026-03-05
 *
 * 🎯 PROPÓSITO:
 * Estilos para la página inicial tipo catálogo promocional.
 * Diseño inspirado en catalogospromocionales.com.
 * - Header oscuro con navegación
 * - Slider principal, productos destacados, categorías, marcas
 * - Footer con info y WhatsApp flotante (bounce + titileo)
 *
 * ======================================================
 */

/* ===============================
   VARIABLES CATÁLOGO
================================ */
:root {
  --catalog-dark: #1a1d23;
  --catalog-dark-alt: #252830;
  --catalog-nav-bg: #1e2128;
  --catalog-text-light: #ffffff;
  --catalog-text-muted: rgba(255,255,255,0.85);
  --catalog-accent: #4a90d9;
  --catalog-accent-hover: #5da3ed;
}

/* ===============================
   HEADER CATÁLOGO
================================ */
.catalog-header {
  background: var(--catalog-nav-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.catalog-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 24px;
  position: relative;
}

.catalog-header .menu-toggle {
  display: none;
}

.catalog-header .logo-wrap {
  flex-shrink: 0;
}

.catalog-header .logo-wrap {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.catalog-header .logo-wrap img {
  height: clamp(48px, 11vw, 120px);
  width: auto;
  max-width: min(300px, 46vw);
  object-fit: contain;
  display: block;
}

.catalog-header .logo-placeholder {
  height: clamp(48px, 11vw, 120px);
  min-width: 160px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--catalog-accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.catalog-header .nav-main {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.catalog-header .nav-main a {
  color: var(--catalog-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.catalog-header .nav-main a:hover {
  color: var(--catalog-text-light);
  background: rgba(255,255,255,0.06);
}

.catalog-header .nav-main a::before {
  content: '◆';
  font-size: 6px;
  vertical-align: middle;
  margin-right: 6px;
  color: var(--catalog-accent);
}

.catalog-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.catalog-header .btn-search-catalog,
.catalog-header .btn-auth-compact.btn-search-compact {
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.catalog-header .btn-search-catalog:hover {
  background: rgba(255,255,255,0.18);
}

.catalog-header .btn-login-catalog,
.catalog-header .btn-auth-compact.btn-login-compact {
  background: linear-gradient(135deg, #4a90d9 0%, #3a7bc8 100%);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.catalog-header .btn-login-catalog:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
}

.catalog-header #user-box .user-toggle {
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.catalog-header .header-actions {
  position: relative;
}

.catalog-header .search-box {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  z-index: 100;
}

.catalog-header .search-box input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
}

.catalog-header .search-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.catalog-header .search-results {
  background: var(--catalog-dark-alt);
  border: 1px solid rgba(255,255,255,0.1);
}

.catalog-header .search-results li {
  color: rgba(255,255,255,0.9);
}

.catalog-header .search-results li:hover {
  background: rgba(255,255,255,0.08);
}

/* ===============================
   BANNER / SLIDER PRINCIPAL
================================ */
.catalog-hero-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--catalog-dark);
}

.catalog-hero-track {
  display: flex;
  transition: transform 0.6s ease;
  min-height: 380px;
}

.catalog-hero-slide {
  flex: 0 0 100%;
  min-width: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #2d3139;
}

.catalog-hero-slide-placeholder {
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2d3139 0%, #1a1d23 100%);
  color: rgba(255,255,255,0.4);
  font-size: 1rem;
}

.catalog-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 380px;
}

.catalog-hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--catalog-dark);
  z-index: 10;
  transition: background 0.2s, transform 0.2s;
}

.catalog-hero-nav:hover {
  background: white;
  transform: translateY(-50%) scale(1.05);
}

.catalog-hero-nav.prev { left: 16px; }
.catalog-hero-nav.next { right: 16px; }

/* ===============================
   PRODUCTOS DESTACADOS
================================ */
.catalog-productos-section {
  background: #fff;
  padding: 48px 24px;
}

.catalog-productos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto 32px;
  padding: 0 16px;
}

.catalog-productos-title {
  background: var(--catalog-dark);
  color: white;
  padding: 16px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.catalog-productos-carousel {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 50px;
}

.catalog-productos-track {
  display: flex;
  gap: 16px;
  overflow: hidden;
  scroll-behavior: smooth;
}

.catalog-productos-track .track-inner {
  display: flex;
  gap: 16px;
  transition: transform 0.4s ease;
}

.catalog-producto-card {
  flex: 0 0 180px;
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background-color: #e5e7eb;
}

.catalog-producto-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-producto-card.no-img img { display: none; }
.catalog-producto-card.no-img { background: #cbd5e1; }

.catalog-producto-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.75) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
}

.catalog-producto-card .card-title {
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.2;
}

.catalog-producto-card .card-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--catalog-dark);
  cursor: pointer;
  transition: transform 0.2s;
}

.catalog-producto-card .card-plus:hover {
  transform: scale(1.1);
}

.catalog-productos-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 5;
  transition: background 0.2s;
}

.catalog-productos-nav:hover {
  background: var(--catalog-accent);
  color: white;
  border-color: var(--catalog-accent);
}

.catalog-productos-nav.prev { left: 8px; }
.catalog-productos-nav.next { right: 8px; }

.catalog-btn-categorias {
  background: var(--catalog-accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

/* ===============================
   CATEGORÍAS GRID
================================ */
.catalog-categorias-section {
  background: #f8fafc;
  padding: 48px 24px;
}

.catalog-categorias-header {
  max-width: 1400px;
  margin: 0 auto 32px;
  display: flex;
  justify-content: flex-end;
  padding: 0 16px;
}

.catalog-categorias-grid-wrap {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 50px;
}

.catalog-categorias-track {
  overflow: hidden;
}

.catalog-categorias-inner {
  display: flex;
  gap: 16px;
  transition: transform 0.4s ease;
  flex-wrap: nowrap;
}

.catalog-categoria-card {
  flex: 0 0 calc(25% - 12px);
  min-width: 160px;
}

@media (min-width: 1200px) {
  .catalog-categoria-card {
    flex: 0 0 calc(20% - 13px);
  }
}

.catalog-categoria-card {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background-color: #cbd5e1;
}

.catalog-categoria-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-categoria-card.no-img img { display: none; }
.catalog-categoria-card.no-img { background: #94a3b8; }

.catalog-categoria-card .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(0,0,0,0.8) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 16px;
}

.catalog-categoria-card .card-title {
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.2;
}

.catalog-categoria-card .card-plus {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--catalog-dark);
  cursor: pointer;
}

.catalog-categorias-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 5;
}

.catalog-categorias-nav.prev { left: 8px; }
.catalog-categorias-nav.next { right: 8px; }

/* ===============================
   MARCAS / ASOCIADOS
================================ */
.catalog-marcas-section.bonos-empresas-section {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

/* Título arriba, fuera de la franja negra */
.catalog-marcas-header {
  padding: 32px 24px 16px;
  background: #fff !important;
}

.catalog-marcas-title {
  color: #000 !important;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

/* Franja negra: solo logos, ocupa casi todo el espacio */
.catalog-marcas-strip {
  position: relative;
  background: var(--catalog-dark);
  padding: 48px 60px;
  min-height: 320px;
}

.catalog-marcas-strip .catalog-marcas-track {
  overflow: hidden;
}

.catalog-marcas-inner {
  display: flex;
  gap: 56px;
  align-items: center;
  padding: 24px 0;
  min-height: 240px;
  /* Animación controlada por JS */
}

.catalog-marca-item {
  flex-shrink: 0;
  width: 340px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  background: transparent;
  border: none;
}

.catalog-marca-item:hover {
  transform: scale(1.08);
  opacity: 1;
}

.catalog-marca-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* Para logos oscuros usar: filter: brightness(0) invert(1); */
}

.catalog-marca-placeholder {
  width: 340px;
  height: 220px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  font-size: 12px;
}

.catalog-marcas-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 5;
  transition: background 0.2s;
}

.catalog-marcas-nav:hover {
  background: rgba(255,255,255,0.25);
}

.catalog-marcas-nav.prev { left: 12px; }
.catalog-marcas-nav.next { right: 12px; }

/* ===============================
   FOOTER CATÁLOGO
================================ */
.catalog-footer {
  background: var(--catalog-dark);
  color: var(--catalog-text-muted);
  padding: 48px 24px 24px;
}

.catalog-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 36px;
  margin-bottom: 32px;
}

.catalog-footer .footer-lead {
  margin: 0 0 12px;
}

.catalog-footer .footer-hours {
  margin: 14px 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.catalog-footer .footer-phone,
.catalog-footer .footer-email {
  cursor: pointer;
}

.catalog-footer .footer-col.footer-brand {
  min-width: 0;
}

.catalog-footer h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 16px;
}

.catalog-footer p, .catalog-footer ul {
  font-size: 0.9rem;
  line-height: 1.6;
}

.catalog-footer ul {
  list-style: none;
}

.catalog-footer a {
  color: var(--catalog-text-muted);
  text-decoration: none;
}

.catalog-footer a:hover {
  color: white;
}

.catalog-footer-social {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.catalog-footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
}

.catalog-footer-social a:hover {
  background: var(--catalog-accent);
}

.catalog-footer-social a img {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

.catalog-footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
}

/* ===============================
   WHATSAPP FLOTANTE (bounce + titileo)
================================ */
.whatsapp-float-catalog {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.5);
  z-index: 9999;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  animation: whatsapp-bounce 2.5s ease-in-out infinite;
}

.whatsapp-float-catalog img {
  width: 32px;
  height: 32px;
  filter: brightness(0) invert(1);
  animation: whatsapp-titileo 1.5s ease-in-out infinite;
}

@keyframes whatsapp-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes whatsapp-titileo {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 1024px) {
  .catalog-header .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
  }

  .catalog-header .nav-main {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--catalog-nav-bg);
    padding: 16px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }

  .catalog-header .nav-main.open {
    display: flex;
  }

  .catalog-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    text-align: left;
  }

  .catalog-footer-social {
    justify-content: flex-start;
  }

  .catalog-categorias-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .catalog-footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .catalog-footer-social {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .catalog-hero-slide,
  .catalog-hero-slide img,
  .catalog-hero-slide-placeholder {
    min-height: 280px;
  }

  .catalog-producto-card {
    flex: 0 0 140px;
    width: 140px;
    height: 140px;
  }
}
