* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primario: #667eea;
  --primario-osc: #764ba2;
  --texto: #333;
  --gris: #777;
  --wa: #25d366;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f7f7fa;
  color: var(--texto);
}

/* ===== HEADER ===== */
.header {
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--primario);
  text-decoration: none;
  background: linear-gradient(135deg, var(--primario), var(--primario-osc));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.logo img {
  max-height: 45px;
  max-width: 200px;
  object-fit: contain;
}

.carrito-btn {
  position: relative;
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  padding: 5px;
}

/* Animación bounce al agregar producto */
@keyframes carritoBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); }
  50%  { transform: scale(0.9); }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.carrito-btn.bounce { animation: carritoBounce 0.5s ease; }

/* El contador también pulsa */
@keyframes contadorPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.5); background: #2e7d32; }
  100% { transform: scale(1); }
}
.carrito-btn.bounce .carrito-contador { animation: contadorPulse 0.5s ease; }

.carrito-contador {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #f44336;
  color: white;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ===== BANNER ===== */
.banner { width: 100%; line-height: 0; }
.banner img { width: 100%; height: auto; }
.banner-desktop { display: block; }
.banner-mobile { display: none; }

@media (max-width: 600px) {
  .banner-desktop { display: none; }
  .banner-mobile { display: block; }
}

/* ===== CARRUSEL DESTACADOS ===== */
.carrusel-seccion {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 10px;
}
.carrusel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.carrusel-track-wrapper {
  overflow: hidden;
  flex: 1;
  border-radius: 12px;
}
.carrusel-track {
  display: flex;
  transition: transform 0.4s ease;
}
.carrusel-card {
  flex: 0 0 20%; /* 5 visibles en desktop */
  max-width: 20%;
  min-width: 0;
  padding: 0 6px;
  box-sizing: border-box;
}
.carrusel-foto-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  width: 100%;
}
a.carrusel-foto-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.card-titulo-link {
  text-decoration: none;
  color: inherit;
}
a.card-titulo-link:hover .card-titulo {
  text-decoration: underline;
}
.carrusel-foto {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.carrusel-overlay-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 12px;
}
.carrusel-foto-wrapper:hover .carrusel-overlay-btn {
  opacity: 1;
}
.carrusel-card-body {
  padding: 10px 4px 6px;
  text-align: center;
}
.carrusel-card-body .card-titulo {
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.carrusel-card-body .card-precio {
  font-size: 14px;
  margin-bottom: 8px;
  white-space: nowrap;
}
.carrusel-card-body .precio-original {
  font-size: 0.65em;
}
.carrusel-card-body .badge-descuento {
  font-size: 0.55em;
  padding: 1px 5px;
  margin-left: 3px;
}
.carrusel-botones {
  justify-content: center;
}
.btn-comprar-carrusel {
  background: linear-gradient(135deg, var(--primario), var(--primario-osc));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
}
.btn-comprar-carrusel:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.35);
}
.btn-comprar-carrusel.agregado {
  background: #38a169;
}

/* Flechas */
.carrusel-flecha {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 22px;
  color: var(--texto);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1;
}
.carrusel-flecha:hover {
  border-color: var(--primario);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* Dots */
.carrusel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 4px;
}
.carrusel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #ddd;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}
.carrusel-dot.activo {
  background: var(--primario);
}

/* Móvil: 2.5 visibles, sin flechas, sin overlay */
@media (max-width: 768px) {
  .carrusel-seccion { padding: 10px 10px 4px; }
  .carrusel-card { flex: 0 0 44%; max-width: 44%; min-width: 0; padding: 0 4px; box-sizing: border-box; } /* ~2.2 visibles: el 3ro se asoma como pista de swipe */
  .carrusel-foto-wrapper { aspect-ratio: 3 / 4; border-radius: 8px; }
  .carrusel-flecha { display: none; }
  .carrusel-overlay-btn { display: none; }
  .carrusel-card-body { padding: 6px 2px 4px; }
  .carrusel-card-body .card-titulo { font-size: 12px; }
  .carrusel-card-body .card-precio { font-size: 12px; margin-bottom: 5px; }
  .carrusel-card-body .precio-original { font-size: 0.6em; }
  .carrusel-card-body .badge-descuento { font-size: 0.6em; padding: 2px 5px; }
  .btn-comprar-carrusel { padding: 6px 10px; font-size: 12px; }
  .carrusel-dots { padding: 8px 0 2px; gap: 6px; }
  .carrusel-dot { width: 8px; height: 8px; }
}

/* ===== CATÁLOGO ===== */
.catalogo {
  max-width: 1280px;
  margin: 0 auto;
  padding: 30px 20px;
}

.catalogo-titulo {
  font-size: 26px;
  margin-bottom: 25px;
  color: var(--texto);
}

.volver-inicio {
  display: inline-block;
  font-size: 18px;
  font-weight: 600;
  color: var(--primario);
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s;
  margin-bottom: 25px;
}
.volver-inicio:hover {
  opacity: .75;
  text-decoration: underline;
}

.grid-productos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .grid-productos { grid-template-columns: repeat(2, 1fr); }
}

.cargando {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--gris);
}

/* ===== CARD ===== */
.card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.card-foto-link { display: block; aspect-ratio: 1; overflow: hidden; }
.card-foto { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.card-foto-link:hover .card-foto { transform: scale(1.05); }

.card-body { padding: 15px; display: flex; flex-direction: column; flex: 1; }

.card-titulo {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--texto);
}

.card-precio {
  font-size: 20px;
  font-weight: 800;
  color: var(--primario);
  margin-bottom: 15px;
}

/* ===== OFERTAS ===== */
.precio-original {
  text-decoration: line-through;
  color: var(--gris);
  font-weight: 500;
  font-size: 0.8em;
  margin-right: 6px;
}

.precio-oferta {
  color: #e53e3e;
  font-weight: 800;
}

.badge-descuento {
  display: inline-block;
  background: #e53e3e;
  color: #fff;
  font-size: 0.65em;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Detalle del producto */
.detalle-precio .precio-original {
  font-size: 0.75em;
}
.detalle-precio .precio-oferta {
  font-size: 1em;
}
.detalle-precio .badge-descuento {
  font-size: 0.55em;
}

.card-botones {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-ver, .btn-agregar {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: none;
  transition: opacity 0.2s;
}

.btn-ver {
  background: #eee;
  color: var(--texto);
}

.btn-agregar {
  background: linear-gradient(135deg, var(--primario), var(--primario-osc));
  color: white;
}

.btn-ver:hover, .btn-agregar:hover { opacity: 0.85; }
.btn-agregar.agregado { background: var(--wa); }

/* ===== OVERLAY ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 200;
}
.overlay.visible { opacity: 1; visibility: visible; }

/* ===== MINICART ===== */
.minicart {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s;
  z-index: 300;
  display: flex;
  flex-direction: column;
}
.minicart.abierto { transform: translateX(0); }

.minicart-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.minicart-header h2 { font-size: 20px; }

.cerrar-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--gris);
}

.minicart-items { flex: 1; overflow-y: auto; padding: 15px; }

.minicart-vacio { text-align: center; color: var(--gris); padding: 40px 20px; }

.minicart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  align-items: center;
}

.minicart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
}

.minicart-item-info { flex: 1; }
.minicart-item-titulo { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.minicart-item-precio { font-size: 13px; color: var(--primario); font-weight: 700; margin-bottom: 8px; }

.cantidad-control { display: flex; align-items: center; gap: 10px; }

.cant-btn {
  width: 26px;
  height: 26px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  color: var(--texto);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cant-btn:hover { background: #f5f5f5; }
.cant-num { font-weight: 600; min-width: 20px; text-align: center; }

.quitar-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.6;
}
.quitar-btn:hover { opacity: 1; }

.minicart-footer { padding: 20px; border-top: 1px solid #eee; }

.minicart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 15px;
}
.minicart-total span:last-child { color: var(--primario); }

.btn-completar {
  width: 100%;
  padding: 14px;
  background: var(--wa);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-completar:hover { opacity: 0.9; }

/* ===== DETALLE ===== */
.detalle {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px 20px;
}

.volver-catalogo {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primario);
  text-decoration: none;
  font-weight: 600;
}
.volver-catalogo:hover { text-decoration: underline; }

.detalle-contenido {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

@media (max-width: 700px) {
  .detalle-contenido { grid-template-columns: 1fr; }

  /* En móvil: título → precio → botón → descripción (botón visible sin scroll) */
  .detalle-titulo { order: 1; }
  .detalle-precio { order: 2; margin-bottom: 15px; }
  .btn-agregar-detalle { order: 3; margin-top: 0; margin-bottom: 20px; }
  .detalle-descripcion { order: 4; margin-bottom: 0; }
}

.detalle-foto-principal {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
}

.detalle-miniaturas {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.miniatura {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
}
.miniatura.activa { border-color: var(--primario); opacity: 1; }
.miniatura:hover { opacity: 1; }

.detalle-info { display: flex; flex-direction: column; }
.detalle-titulo { font-size: 28px; margin-bottom: 12px; }
.detalle-precio { font-size: 30px; font-weight: 800; color: var(--primario); margin-bottom: 20px; }
.detalle-descripcion { color: #555; line-height: 1.6; margin-bottom: 25px; white-space: pre-wrap; }

.btn-agregar-detalle {
  padding: 15px 30px;
  background: linear-gradient(135deg, var(--primario), var(--primario-osc));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
  transition: opacity 0.2s;
}
.btn-agregar-detalle:hover { opacity: 0.9; }
.btn-agregar-detalle.agregado { background: var(--wa); }

/* ===================================================================== */
/* ===== AGREGADOS: barra superior, nav, botón flotante, footer, FAQ ==== */
/* ===================================================================== */

/* ===== BARRA SUPERIOR (topbar) ===== */
.topbar {
  background: linear-gradient(135deg, var(--primario), var(--primario-osc));
  color: #fff;
  font-size: 13px;
}
.topbar-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 7px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.topbar-wa {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
.topbar-wa:hover { text-decoration: underline; }
.topbar-wa svg { width: 16px; height: 16px; fill: currentColor; }
.topbar-envios {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.95;
}
@media (max-width: 600px) {
  .topbar-content { justify-content: center; gap: 14px; font-size: 12px; }
}

/* ===== NAV DEL HEADER (Nuestros clientes + carrito) ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.nav-clientes {
  color: var(--texto);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-clientes:hover { color: var(--primario); }
.nav-clientes.activo { color: var(--primario); }
@media (max-width: 600px) {
  .nav-clientes { font-size: 13px; }
  .header-nav { gap: 14px; }
}

/* ===== BOTÓN FLOTANTE DE WHATSAPP ===== */
.wa-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  background: var(--wa);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  z-index: 150; /* por debajo del overlay (200), así se oculta al abrir el carrito */
  transition: transform 0.2s, box-shadow 0.2s;
  animation: waFloatIn 0.4s ease;
}
.wa-flotante svg { width: 30px; height: 30px; fill: #fff; }
.wa-flotante:hover { transform: scale(1.08); box-shadow: 0 6px 18px rgba(0,0,0,0.30); }
@keyframes waFloatIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@media (max-width: 600px) {
  .wa-flotante { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .wa-flotante svg { width: 28px; height: 28px; }
}

/* ===== FAQ (preguntas frecuentes) ===== */
.faq {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 20px;
}
.faq-titulo {
  font-size: 24px;
  margin-bottom: 18px;
  color: var(--texto);
}
.faq-item {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 12px;
  padding: 16px 18px;
}
.faq-item h3 { font-size: 16px; margin-bottom: 6px; color: var(--primario); }
.faq-item p  { font-size: 14px; color: #555; line-height: 1.6; }

/* ===== FOOTER ===== */
.site-footer {
  background: #1f1d2b;
  color: #c9c7d6;
  margin-top: 50px;
  padding: 40px 20px 24px;
  font-size: 14px;
  line-height: 1.7;
}
.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
}
.footer-col h3 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
}
.footer-col p,
.footer-col li { color: #b6b4c6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { color: #b6b4c6; text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-wa {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff !important;
  font-weight: 600;
}
.footer-wa svg { width: 16px; height: 16px; fill: var(--wa); }
.footer-bottom {
  max-width: 1280px;
  margin: 24px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  font-size: 13px;
  color: #8f8da0;
}

/* ===== PLACEHOLDER PÁGINA DE CLIENTES ===== */
.clientes-placeholder {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 50px 30px;
  text-align: center;
  color: var(--gris);
  line-height: 1.7;
}
.clientes-placeholder p { margin-bottom: 12px; }
.btn-volver-clientes {
  display: inline-block;
  margin-top: 16px;
  color: var(--primario);
  text-decoration: none;
  font-weight: 600;
}
.btn-volver-clientes:hover { text-decoration: underline; }

/* ===================================================================== */
/* ===== AJUSTES MÓVIL (UI/UX optimizada para celular) ================= */
/* ===================================================================== */
@media (max-width: 600px) {

  /* --- Header más compacto para que no se apriete --- */
  .header-content { padding: 12px 16px; }
  .logo { font-size: 21px; }
  .logo img { max-height: 36px; max-width: 150px; }
  .header-nav { gap: 12px; }
  .nav-clientes { font-size: 13px; }

  /* --- Barra superior: un poco más de aire vertical --- */
  .topbar-content { padding: 8px 14px; }

  /* --- Catálogo: menos margen lateral => cards más anchas --- */
  .catalogo { padding: 20px 14px; }
  .catalogo-titulo { font-size: 22px; margin-bottom: 18px; }
  .grid-productos { gap: 12px; }

  .card-body { padding: 12px; }
  .card-titulo { font-size: 15px; }
  .card-precio { font-size: 18px; margin-bottom: 12px; }

  /* --- Botones de cada producto: apilados y a lo ancho ---
     Antes iban en fila y el texto "Añadir al carrito" se cortaba en 3 líneas.
     column-reverse deja el botón principal (Añadir) arriba, justo bajo el precio. */
  .card-botones {
    flex-direction: column-reverse;
    gap: 8px;
  }
  .btn-ver,
  .btn-agregar {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    white-space: nowrap;   /* refuerzo: el texto nunca se parte */
  }

  /* --- FAQ: mismo margen lateral que el catálogo --- */
  .faq { padding: 20px 14px; margin-top: 10px; }
  .faq-titulo { font-size: 22px; }
  .faq-item { padding: 14px 16px; }

  /* --- Footer: un poco más ajustado --- */
  .site-footer { padding: 34px 16px 20px; }
}

/* ===================================================================== */
/* ===== FILTRO DE CATEGORÍAS (chips en la PLP) ======================== */
/* ===================================================================== */
.filtro-categorias {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.chip-categoria {
  padding: 8px 16px;
  border: 2px solid #ddd;
  background: #fff;
  color: var(--texto);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.chip-categoria:hover { border-color: var(--primario); color: var(--primario); }
.chip-categoria[data-valor="__ofertas__"] { background: #dc2626; border-color: #dc2626; color: #fff; }
.chip-categoria[data-valor="__ofertas__"]:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.chip-categoria[data-valor="__ofertas__"].activo { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.chip-categoria.activo {
  background: linear-gradient(135deg, var(--primario), var(--primario-osc));
  border-color: transparent;
  color: #fff;
}

/* En móvil: los chips se deslizan en una fila (sin ocupar varias líneas) */
@media (max-width: 600px) {
  .filtro-categorias {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
  }
  .filtro-categorias::-webkit-scrollbar { display: none; }
  .chip-categoria { flex-shrink: 0; }
}

/* ===================================================================== */
/* ===== BUSCADOR (dentro del header) ================================== */
/* ===================================================================== */
.buscador {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 460px;
  margin: 0 24px;
}
.buscador-icono {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  opacity: 0.55;
}
.buscador-input {
  width: 100%;
  padding: 10px 42px 10px 40px;
  border: 2px solid #e2e2ea;
  border-radius: 999px;
  font-size: 15px;
  font-family: inherit;
  background: #f7f7fa;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.buscador-input:focus {
  outline: none;
  border-color: var(--primario);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.buscador-limpiar {
  position: absolute;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: #e2e2ea;
  color: var(--texto);
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.buscador-limpiar:hover { background: #d3d3dd; }

/* Tablet: el buscador se pega un poco más a los lados */
@media (max-width: 820px) {
  .buscador { margin: 0 14px; }
}

/* Móvil: el buscador baja a una segunda fila, a todo el ancho */
@media (max-width: 600px) {
  .header-content { flex-wrap: wrap; }
  .buscador {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin: 12px 0 0;
  }
  .buscador-input { font-size: 14px; padding: 10px 40px 10px 38px; }
}

/* ===================================================================== */
/* ===== NUESTROS CLIENTES (portafolio) =============================== */
/* ===================================================================== */
.clientes-intro {
  color: var(--gris);
  margin-bottom: 28px;
  font-size: 15px;
}

.proyectos-lista {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.proyecto {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 22px 24px 26px;
}

.proyecto-titulo {
  font-size: 21px;
  font-weight: 700;
  color: var(--texto);
  margin-bottom: 6px;
}
.proyecto-desc {
  color: #555;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 18px;
}
.proyecto-titulo + .proyecto-fotos { margin-top: 16px; }

/* Grilla de fotos: se adapta a la cantidad (1 a 4) */
.proyecto-fotos {
  display: grid;
  gap: 12px;
}
.proyecto-fotos .proyecto-foto {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #f0f0f0;
}
.proyecto-fotos.fotos-1 { grid-template-columns: 1fr; max-width: 460px; }
.proyecto-fotos.fotos-2 { grid-template-columns: repeat(2, 1fr); max-width: 620px; }
.proyecto-fotos.fotos-3 { grid-template-columns: repeat(3, 1fr); }
.proyecto-fotos.fotos-4 { grid-template-columns: repeat(4, 1fr); }

/* En móvil: 1 foto ocupa todo; el resto van en 2 columnas */
@media (max-width: 600px) {
  .proyectos-lista { gap: 28px; }
  .proyecto { padding: 18px 16px 20px; }
  .proyecto-titulo { font-size: 19px; }
  .proyecto-fotos.fotos-2,
  .proyecto-fotos.fotos-3,
  .proyecto-fotos.fotos-4 { grid-template-columns: repeat(2, 1fr); max-width: none; }
}
