/* =========================
   BASE
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: auto;
}

body {
  margin: 0;
  padding: 0;
  background-color: #2F1B14;
  font-family: "Segoe UI", Arial, sans-serif;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================
   NAVBAR
========================= */
.navbar-brand span {
  font-family: "Neonderthaw", cursive;
  font-size: 1.9em;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* =========================
   ENCABEZADO CATÁLOGO
========================= */
.catalogo-header {
  text-align: center;
  padding: 40px 20px 10px;
  background-color: #2F1B14;
}

.catalogo-header h2 {
  font-family: "Dancing Script", cursive;
  font-size: 3em;
  color: #ffbb00;
  margin-bottom: 8px;
  animation: slideInFromBottom 1s ease-out;
}

.catalogo-subtitulo {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1em;
  margin: 0;
  animation: fadeIn 1.2s ease-in;
}

/* =========================
   FILTROS Y BÚSQUEDA
========================= */
.catalogo-filtros {
  background-color: #2F1B14;
  padding: 20px 10px 10px;
  position: sticky;
  top: 56px;
  z-index: 900;
}

.input-busqueda-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.icono-busqueda {
  position: absolute;
  left: 14px;
  color: #8d6e63;
  font-size: 1.1em;
  z-index: 2;
  pointer-events: none;
}

.input-busqueda {
  background-color: #f3eadb;
  border: 2px solid #8b6d35;
  border-radius: 30px;
  padding: 12px 44px 12px 42px;
  font-size: 1em;
  color: #3e2f23;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-busqueda::placeholder {
  color: #9a8672;
}

.input-busqueda:focus {
  border-color: #ffbb00;
  box-shadow: 0 0 0 3px rgba(255, 187, 0, 0.2);
  outline: none;
}

.btn-limpiar-busqueda {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #8d6e63;
  font-size: 1.1em;
  cursor: pointer;
  padding: 4px 8px;
  z-index: 2;
}

.btn-limpiar-busqueda:hover {
  color: #c65a43;
}

/* Scroll horizontal de categorías */
.categorias-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 14px;
  justify-content: center;
  flex-wrap: wrap;
  -webkit-overflow-scrolling: touch;
}

.categorias-scroll::-webkit-scrollbar {
  height: 4px;
}

.categorias-scroll::-webkit-scrollbar-thumb {
  background: #8b6d35;
  border-radius: 4px;
}

.btn-categoria {
  background-color: rgba(255, 255, 255, 0.08);
  color: #d8c6a2;
  border: 1.5px solid rgba(139, 109, 53, 0.4);
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  text-transform: capitalize;
}

.btn-categoria:hover {
  background-color: rgba(139, 109, 53, 0.3);
  color: #fff;
}

.btn-categoria.activa {
  background: linear-gradient(135deg, #8b6d35, #be7b54);
  color: #fff;
  border-color: #be7b54;
  box-shadow: 0 2px 8px rgba(139, 109, 53, 0.35);
}

/* =========================
   INFO RESULTADOS
========================= */
.info-resultados {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9em;
  padding: 8px 0;
  text-align: center;
}

/* =========================
   GRID DE PRODUCTOS
========================= */
.catalogo-resultados {
  background-color: #2F1B14;
  padding: 10px 10px 30px;
  min-height: 50vh;
}

.row1 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================
   TARJETA DE PRODUCTO
========================= */
.producto-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background-color: #f3eadb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

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

/* Contenedor de imagen */
.producto-imagen-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #e8ddd0;
  overflow: hidden;
}

.producto-imagen-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease;
}

.producto-card:hover .producto-imagen-wrapper img {
  transform: scale(1.05);
}

/* Imagen placeholder */
.producto-sin-imagen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8ddd0, #d5c4b0);
  color: #a08a6f;
  font-size: 3em;
}

/* =========================
   STICKER DE STOCK
========================= */
.sticker-stock {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.sticker-stock.en-stock {
  background-color: #2f8f4e;
  color: #fff;
}

.sticker-stock.agotado {
  background-color: #c65a43;
  color: #fff;
}

/* =========================
   INFO DEL PRODUCTO
========================= */
.producto-info {
  padding: 14px;
  background-color: #f3eadb;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.producto-nombre {
  font-size: 0.95em;
  font-weight: 700;
  color: #5a3e2b;
  margin: 0 0 4px;
  text-transform: capitalize;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.producto-marca {
  font-size: 0.82em;
  color: #8d6e63;
  margin: 0;
  text-transform: capitalize;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================
   BOTÓN VER MÁS
========================= */
.btn-ver-mas {
  background: linear-gradient(135deg, #8b6d35, #be7b54);
  color: #fff;
  border: 2px solid #9e8461;
  border-radius: 30px;
  padding: 12px 32px;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ver-mas:hover {
  background: linear-gradient(135deg, #be7b54, #8b6d35);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 109, 53, 0.4);
}

/* =========================
   SIN RESULTADOS
========================= */
.sin-resultados {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 60px 20px;
}

.sin-resultados i {
  color: #8b6d35;
}

.sin-resultados h4 {
  color: rgba(255, 255, 255, 0.7);
  margin-top: 10px;
}

/* =========================
   MODAL IMAGEN AMPLIADA
========================= */
.modal-imagen {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-imagen.visible {
  display: flex;
}

.modal-imagen-contenido {
  position: relative;
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.modal-imagen-contenido img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.modal-imagen-cerrar {
  position: absolute;
  top: -40px;
  right: 0;
  color: #f1f1f1;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 10;
}

.modal-imagen-cerrar:hover {
  color: #ffbb00;
}

.modal-info-producto {
  margin-top: 16px;
  color: #fff;
  text-align: center;
}

.modal-info-producto h4 {
  font-family: "Dancing Script", cursive;
  font-size: 1.6em;
  color: #ffbb00;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.modal-info-producto p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95em;
  margin: 0;
  text-transform: capitalize;
}

/* =========================
   FOOTER
========================= */
footer a {
  color: #fff;
  text-decoration: none;
  margin: 0 10px;
}

/* =========================
   WHATSAPP
========================= */
.whatsapp-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25d366;
  padding: 10px;
  border-radius: 50px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 1500;
}

.whatsapp-btn a {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  padding: 10px;
}

.whatsapp-btn img {
  margin-left: 10px;
  width: 30px;
  height: 30px;
}

/* =========================
   ANIMACIONES
========================= */
@keyframes slideInFromBottom {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.animated-text {
  animation: slideInFromBottom 1s ease-out;
}

/* =========================
   RESPONSIVE — DESKTOP
========================= */
@media (min-width: 769px) {
  .catalogo-filtros {
    top: 62px;
  }

  .categorias-scroll {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* =========================
   RESPONSIVE — MÓVIL
========================= */
@media (max-width: 768px) {
  .catalogo-header {
    padding: 28px 16px 6px;
  }

  .catalogo-header h2 {
    font-size: 2.2em;
  }

  .catalogo-subtitulo {
    font-size: 0.95em;
  }

  .catalogo-filtros {
    top: 54px;
    padding: 14px 8px 6px;
  }

  .input-busqueda {
    padding: 10px 40px 10px 38px;
    font-size: 0.95em;
  }

  .categorias-scroll {
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 8px 4px 12px;
  }

  .btn-categoria {
    padding: 6px 14px;
    font-size: 0.82em;
  }

  .producto-info {
    padding: 10px;
  }

  .producto-nombre {
    font-size: 0.85em;
  }

  .producto-marca {
    font-size: 0.75em;
  }

  .sticker-stock {
    top: 6px;
    right: 6px;
    padding: 3px 8px;
    font-size: 0.65em;
  }

  .whatsapp-btn {
    bottom: 60px;
    right: 14px;
    padding: 6px;
    border-radius: 36px;
  }

  .whatsapp-btn a {
    padding: 6px 10px;
    font-size: 14px;
  }

  .whatsapp-btn img {
    width: 22px;
    height: 22px;
    margin-left: 6px;
  }
}

/* =========================
   SCROLL SUAVE
========================= */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 160px;
}

section[id] {
  scroll-margin-top: 160px;
}
