/* =============================================
   Merchandising – Estilos + Responsive completo
   ============================================= */

/* ---- Reset base ---- */
*, *::before, *::after { box-sizing: border-box; }
body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  min-height: 70px;
  overflow: visible !important;
}
.navbar .navbar-brand img {
  position: relative;
  margin-top: -45px;
  margin-bottom: -45px;
}

/* En móvil el logo no sobresale para no tapar el menú */
@media (max-width: 991px) {
  .navbar .navbar-brand img {
    height: 60px !important;
    margin-top: 0;
    margin-bottom: 0;
  }
  .navbar { min-height: 60px; }
}

/* =============================================
   HERO / BANNER
   ============================================= */
.hero-section {
  background: #f1f3f5;
}

/* Banner a ancho completo, alineado con el contenido y nítido en cualquier pantalla */
.hero-banner-wrap {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
}
.hero-banner-wrap .carousel,
.hero-banner-wrap .carousel-inner,
.hero-banner-wrap .carousel-item { width: 100%; }
.hero-banner-img {
  width: 100%;
  height: 360px;          /* altura pareja para todas las slides */
  object-fit: cover;      /* mantiene proporción sin deformar */
  display: block;
}

/* Responsive: la altura del banner se adapta al ancho de pantalla */
@media (max-width: 991px) { .hero-banner-img { height: 280px; } }
@media (max-width: 767px) { .hero-banner-img { height: 200px; } }
@media (max-width: 480px) { .hero-banner-img { height: 150px; } }

/* ============================================= 
   HEADER (3 columnas balanceadas)
   ============================================= */
.site-header {
  background: #f8f9fa;
  border-bottom: 1px solid #e2e8f0;
}
/* Solo se muestra en desktop (lg+). En móvil se oculta con d-none. */
.header-grid.d-lg-flex {
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 10px 0;
  flex-wrap: wrap;            /* si falta espacio, envuelve ordenadamente en vez de desbordar */
}
.header-logo { flex: 0 0 auto; }
.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.header-link {
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
}
.header-link:hover { color: #0d6efd; }

/* ============================================= 
   LOGO COMAR (cursor SVG + texto)
   ============================================= */
.logo-comar { display:inline-flex; align-items:center; gap:14px; text-decoration:none; }
.logo-comar .logo-icono {
  position:relative;
  width:80px; height:80px; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #1f8bff 0%, #0d5cff 55%, #0b45d6 100%);
  box-shadow: 0 4px 12px rgba(13,110,253,.35);
  flex:0 0 auto; overflow:visible;
}
.logo-comar .logo-icono svg { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.logo-comar .logo-texto { line-height:1; }
.logo-comar .logo-texto .marca { font-size:2rem; font-weight:800; letter-spacing:1px; color:#0d3fb0; display:block; }
.logo-comar .logo-texto .sub { font-size:1.1rem; font-weight:600; color:#2f6bff; display:block; margin-top:2px; letter-spacing:.5px; }
.logo-comar .logo-texto .slogan { font-size:.6rem; font-weight:600; letter-spacing:3px; color:#8a94a6; display:block; margin-top:4px; text-transform:uppercase; }

/* Versión compacta (móvil) */
.logo-comar.chico .logo-icono { width:52px; height:52px; }
.logo-comar.chico .logo-texto .marca { font-size:1.3rem; }
.logo-comar.chico .logo-texto .sub { font-size:.8rem; }

/* Ajustes responsivos del logo de escritorio */
@media (max-width: 1199px) {
  .logo-comar .logo-icono { width:66px; height:66px; }
  .logo-comar .logo-texto .marca { font-size:1.6rem; }
  .logo-comar .logo-texto .sub { font-size:.95rem; }
}

/* ============================================= 
   BUSCADOR CENTRAL
   ============================================= */
.search-hero {
  display: flex;
  width: 100%;
  max-width: 520px;
  justify-self: center;
  flex: 1 1 320px;           /* se encoge en pantallas medianas sin romper el header */
  min-width: 220px;
}
@media (max-width: 1199px) { .search-hero { max-width: 380px; } }
.search-input {
  border-radius: 24px 0 0 24px;
  border: 1px solid #d5d9e0;
  border-right: none;
  padding-left: 18px;
  box-shadow: none;
}
.search-input:focus {
  border-color: #0d6efd;
  box-shadow: none;
}
.search-btn {
  border-radius: 0 24px 24px 0;
  background: #0d6efd;
  color: #fff;
  border: 1px solid #0d6efd;
  padding-left: 18px;
  padding-right: 18px;
}
.search-btn:hover { background: #0b5ed7; color: #fff; }

/* ============================================= 
   BARRA DE CATEGORÍAS (píldoras)
   ============================================= */
.catbar {
  background: #1a1a2e;          /* mismo azul oscuro del navbar/footer */
  border-bottom: 3px solid #0d6efd;
  padding: 10px 0;
}
.catbar-scroll {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;   /* centrar las píldoras como en la referencia */
}
.catpill {
  display: inline-flex;
  align-items: center;
  background: #0d6efd;         /* azul de marca */
  color: #fff;
  text-decoration: none;
  font-size: .85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.catpill:hover {
  background: #0b5ed7;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(13,110,253,.35);
}
/* Inicio y Contacto: variante más clara para distinguirlos sin romper la armonía azul */
.catpill-inicio,
.catpill-contacto {
  background: transparent;
  border-color: rgba(255,255,255,.5);
}
.catpill-inicio:hover,
.catpill-contacto:hover {
  background: rgba(255,255,255,.12);
  border-color: #fff;
  box-shadow: none;
}

/* En móvil, barra desplazable horizontal para no romper el layout */
@media (max-width: 767px) {
  .catbar-scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .catbar-scroll::-webkit-scrollbar { height: 4px; }
  .catbar-scroll::-webkit-scrollbar-thumb { background: #c3ccdf; border-radius: 4px; }
}
.hero-logo {
  max-width: 210px;
  width: 70%;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.15));
}

/* =============================================
   CATEGORÍAS
   ============================================= */
.categoria-card {
  transition: transform .25s ease, box-shadow .25s ease;
  cursor: pointer;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #cbd5e1 !important;
}
.categoria-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,.15) !important;
  border-color: #0d6efd !important;
}
.categoria-img {
  height: 180px;
  object-fit: cover;
  width: 100%;
}
.categoria-icon-wrap {
  height: 180px;
  background: #f0f4ff;
}

@media (max-width: 575px) {
  .categoria-img,
  .categoria-icon-wrap { height: 140px; }
}

/* =============================================
   CABECERA CATEGORÍA
   ============================================= */
.categoria-header {
  background: linear-gradient(135deg, #0d1117 0%, #1c3a5f 100%);
  padding: 2rem 0;
}
.categoria-header h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); }

@media (max-width: 575px) {
  .categoria-header .display-4 { font-size: 2rem; }
}

/* =============================================
   TARJETAS PRODUCTOS (listado)
   ============================================= */
.producto-card {
  transition: transform .2s ease, box-shadow .2s ease;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 2px solid #e2e8f0 !important;
}
.producto-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;
  border-color: #0d6efd !important;
}
.producto-img-wrap {
  background: #f8f9fa;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  overflow: hidden;
}
.producto-img {
  max-height: 210px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 8px;
}
.producto-placeholder { height: 220px; }

@media (max-width: 575px) {
  .producto-img-wrap { height: 180px; }
  .producto-img      { max-height: 170px; }
  .producto-placeholder { height: 180px; }
}

/* =============================================
   DETALLE PRODUCTO – galería
   ============================================= */
.galeria-marco {
  position: relative;
  border: 3px solid #0d6efd;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(13,110,253,.18);
  background: #f8f9fa;
}
.producto-detalle-img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  background: #f8f9fa;
  padding: 10px;
}
.producto-placeholder-lg { height: 400px; }

/* Flechas grandes y siempre visibles */
.galeria-flecha {
  width: 44px;
  height: 44px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(13,110,253,.85) !important;
  border-radius: 50% !important;
  opacity: 1 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  position: absolute;
  z-index: 10;
}
.galeria-flecha.carousel-control-prev { left: 10px; }
.galeria-flecha.carousel-control-next { right: 10px; }
.galeria-flecha i { font-size: 1.4rem; color: #fff; line-height: 1; }
.galeria-flecha:hover { background: #0d6efd !important; }

.galeria-indicadores { bottom: 8px; }
.galeria-indicadores button {
  width: 10px; height: 10px;
  border-radius: 50%;
  background-color: #0d6efd;
  opacity: .5;
}
.galeria-indicadores button.active { opacity: 1; }

@media (max-width: 767px) {
  .producto-detalle-img   { height: 280px; }
  .producto-placeholder-lg{ height: 280px; }
  .galeria-flecha         { width: 36px; height: 36px; }
  .galeria-flecha i       { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .producto-detalle-img   { height: 220px; }
  .producto-placeholder-lg{ height: 220px; }
}

/* =============================================
   DETALLE PRODUCTO – texto
   ============================================= */
.detalle-contenido {
  color: #444;
  line-height: 1.8;
  font-size: 0.97rem;
}
.detalle-contenido b,
.detalle-contenido strong { color: #1a1a2e; font-size: 1rem; }
.detalle-contenido p      { margin-bottom: 0.8rem; }
.detalle-contenido ul,
.detalle-contenido ol     { margin-bottom: 0.8rem; padding-left: 1.4rem; }
.detalle-contenido li     { margin-bottom: 0.3rem; }
.detalle-contenido hr     { border: none; border-top: 1px solid #dee2e6; margin: 1rem 0; }

/* =============================================
   FOOTER
   ============================================= */
.footer { background: #f8f9fa !important; }

/* =============================================
   WHATSAPP FLOTANTE
   ============================================= */
.whatsapp-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 16px rgba(37,211,102,.5);
  z-index: 9999;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.whatsapp-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,.7);
  color: #fff;
}
@media (max-width: 575px) {
  .whatsapp-fab { bottom: 16px; right: 16px; width: 50px; height: 50px; font-size: 1.6rem; }
}

/* ============================================= 
   NUESTROS CLIENTES (corredor de logos)
   ============================================= */
.clientes-section { background: #ffffff; }
/* Pocos logos: centrados y estáticos */
.clientes-estatico {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 60px;
}
@media (max-width: 767px) { .clientes-estatico { gap: 30px; } }
.clientes-marquee {
  overflow: hidden;
  width: 100%;
  position: relative;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.clientes-track {
  display: flex;
  align-items: center;
  justify-content: center;   /* centrado cuando hay pocos logos */
  gap: 60px;
  width: max-content;
  min-width: 100%;           /* ocupa al menos todo el ancho para poder centrarse */
  margin: 0 auto;
  animation: clientes-scroll 30s linear infinite;
}
.clientes-marquee:hover .clientes-track { animation-play-state: paused; }
.cliente-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
}
.cliente-item img {
  max-height: 80px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .7;
  transition: filter .3s, opacity .3s, transform .3s;
}
.cliente-item img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.06);
}
@keyframes clientes-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* recorre la primera mitad (logos duplicados) */
}
/* Responsivo: logos y velocidad se ajustan en pantallas chicas */
@media (max-width: 767px) {
  .clientes-track { gap: 36px; animation-duration: 22s; }
  .cliente-item { height: 66px; }
  .cliente-item img { max-height: 56px; max-width: 120px; }
}
/* Respeta a quienes prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  .clientes-track { animation: none; flex-wrap: wrap; justify-content: center; }
}
