/* ==================================================
   CATÁLOGO – ESTILOS GLOBALES
   Basado 100% en variables :root
================================================== */

.catalogo {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-text);
  padding-top: var(--space-16);
}

/* ----------------------------------
   CONTENEDORES
---------------------------------- */

.catalogo .container {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 640px) {
  .catalogo .container {
    padding: 0 var(--space-4);
  }
}

/* ----------------------------------
   TÍTULOS DE SECCIÓN
---------------------------------- */

.section-title {
  font-family: var(--font-title);
  font-size: var(--text-2xl);
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-10);
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: var(--space-4) auto 0;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

/* ----------------------------------
   BOTONES GENERALES
---------------------------------- */

.catalog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 500;

  background: var(--gradient-accent);
  color: var(--color-text);

  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.catalog-btn:hover {
  box-shadow: var(--shadow-glow-accent);
  transform: translateY(-1px);
}

/* ----------------------------------
   CATEGORÍAS / FILTROS
---------------------------------- */

.catalog-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-12);
}

.category-btn {
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  border: var(--border-light);
  background: var(--color-bg-light);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  cursor: pointer;

  transition:
    background var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.category-btn:hover,
.category-btn.active {
  background: var(--gradient-primary);
  color: var(--color-text);
  box-shadow: var(--shadow-glow-primary);
}

/* ----------------------------------
   DESTACADOS
---------------------------------- */

.catalog-featured {
  margin-bottom: var(--space-16);
}

/* ----------------------------------
   PRODUCTOS – LAYOUT GENERAL
---------------------------------- */

.catalog-products {
  margin-bottom: var(--space-16);
}

.catalog-flex,
.featured-flex {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  justify-content: center;
  
}



.featured-flex {
    max-width: 1200px;
    margin-left: var(--space-4);
  }

/* ----------------------------------
   TARJETA DE PRODUCTO (AJUSTE ML)
---------------------------------- */

.product-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-sm); /* antes lg */
  border: var(--border-strong);
  box-shadow: none; /* ML no usa sombras fuertes */
  overflow: hidden;

  width: calc(33.333% - var(--space-8));
  min-width: 280px;

  display: flex;
  flex-direction: column;

  transition:
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* ----------------------------------
   IMAGEN (ML REAL)
---------------------------------- */

/* TARJETA DE PRODUCTO – IMAGEN LLENA EL CONTENEDOR */
.product-image {
  background: var(--color-bg-card);
  width: 100%;
  height: 220px; /* altura fija para cards */
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 🔹 llena el contenedor sin deformarse, se puede cortar */
  object-position: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.product-image img:hover {
  transform: scale(1.04);
}



/* ----------------------------------
   CONTENIDO
---------------------------------- */

.product-content {
    height: 60%;
  padding: var(--space-4); /* más compacto */
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.product-content h3 {

    font-family: var(--font-title);
  font-size: var(--text-sm); /* más chico */
  font-weight: bold;
  color: var(--color-text-muted);
  line-height: 1.4;

  display: -webkit-box;
  -webkit-line-clamp: 2; /* corte tipo ML */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-content p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}

.product-description {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;

  display: -webkit-box;
  -webkit-line-clamp: 2;     /* 👈 cantidad de líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description::after {
  content: "";
}



/* ----------------------------------
   ACCIONES (ML)
---------------------------------- */

.product-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column; /* ML apila */
  align-items: flex-start;
  gap: var(--space-1);
  justify-self: flex-end;
}

.product-price {
  font-size: var(--text-xl); /* protagonista */
  font-weight: 600;
  color: var(--color-text);
}

.product-btn {
    width: 100%;
    height: 100%;
    color: var(--color-text);
}

.product-btn:hover {
}

.btn-consultar{
    border-radius: var(--radius-lg);
    margin-top: var(--space-5);
}




/* ----------------------------------
   INFO / CONDICIONES
---------------------------------- */

.catalog-conditions {
  background: var(--color-bg-light);
  border: var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-16);
}

.catalog-conditions ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: center;
}

.catalog-conditions li {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ----------------------------------
   CONTACTO RÁPIDO
---------------------------------- */

.catalog-contact {
  text-align: center;
  border-top: var(--border-strong);
  padding: var(--space-12) var(--space-6);
}

.catalog-contact p {
  font-size: var(--text-lg);
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

/* ----------------------------------
   RESPONSIVE
---------------------------------- */

/* ----------------------------------
   RESPONSIVE (SE MANTIENE, SOLO AJUSTE VISUAL)
---------------------------------- */

@media (max-width: 768px) {
  .catalog-flex,
.featured-flex {
    gap: var(--space-2);
  }

  .product-card {
    width: calc(50% - var(--space-4));
    min-width: unset;
    margin-bottom: var(--space-8);
  }

  .product-image img {
    height: 160px;
  }

  .product-image {
    height: 160px; /* menor altura en móvil */
  }

  

  .product-price {
    font-size: var(--text-lg);
  }
}

@media (min-width: 768px) {
  .catalog-flex
 {
    max-width: 1200px;
    margin: 0 auto;
  }

  

}









/* ----------------------------------
   DESTACADOS – SLIDER (DESKTOP + MOBILE)
---------------------------------- */

.catalog-featured .featured-flex {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-6);

  justify-content: flex-start; /* 🔥 CLAVE */
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;

  margin: 0 var(--space-16);
  padding: var(--space-4) var(--space-6) var(--space-6);
}


/* Ocultar scrollbar (opcional, ML-like) */
.catalog-featured .featured-flex::-webkit-scrollbar {
  display: none;
}

/* Cards dentro del slider */
.catalog-featured .product-card {
  scroll-snap-align: start;
  flex: 0 0 auto;

  width: 300px; /* desktop base */
}

/* Mobile: cards un poco más chicas */
@media (max-width: 768px) {
  .catalog-featured .product-card {
    width: 240px;
  }

  .catalog-featured .featured-flex {
    margin: 0 var(--space-8);
    }
}


/* ----------------------------------
   BADGE DESTACADO
---------------------------------- */

.catalog-featured .product-card {
  position: relative;
}

.catalog-featured .product-card::before {
  content: "DESTACADO";
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);

  background: var(--color-accent);
  color: var(--color-text);

  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);

  box-shadow: var(--shadow-soft);
  z-index: 2;
}


.catalog-featured {
  position: relative;
}

.catalog-featured::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 100%;
  pointer-events: none;

  background: linear-gradient(
    to left,
    var(--color-bg) 0%,
    transparent 100%
  );
}






.featured-slider {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}


.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 42px;
  height: 42px;
  border-radius: 50%;

  background: rgba(0, 0, 0, 0.6);
  color: #fff;

  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 10;
  transition: background var(--transition-fast),
              transform var(--transition-fast);
}

.slider-arrow i {
  font-size: 16px;
}

.slider-arrow:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: translateY(-50%) scale(1.05);
}

.slider-arrow.prev {
  left: 6px;
}

.slider-arrow.next {
  right: 6px;
}




/* ----------------------------------
   FEATURED – DOTS
---------------------------------- */

.slider-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
}

.slider-dots .slider-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);

  background: var(--color-primary-dark);
  cursor: pointer;

  transition:
    background var(--transition-fast),
    transform var(--transition-fast);
}

.slider-dots .slider-dot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.slider-dots .slider-dot.active {
  background: var(--color-accent);
  transform: scale(1.2);
}








/* ==========================================
   MODAL PRODUCTO – PROLIJO / CONSISTENTE
========================================== */

.product-modal {
    display: flex;
    justify-content: center;
    align-items: center;
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.product-modal.active,
.product-modal.closing {
  pointer-events: auto;
}

/* Overlay */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.product-modal.active .modal-overlay {
  opacity: 1;
}

.product-modal.closing .modal-overlay {
  opacity: 0;
}

/* Caja principal */
.modal-content {
  position: relative;
  background: var(--color-bg-card); /* MISMO FONDO QUE LAS CARDS */
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.08);

  max-width: 880px;
  width: calc(100% - var(--space-8));
  margin: 4vh auto;

  padding: var(--space-6);

  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.product-modal.active .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.product-modal.closing .modal-content {
  transform: translateY(24px);
  opacity: 0;
}

/* Botón cerrar */
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);

  width: 36px;
  height: 36px;
  border-radius: 50%;

  background: var(--color-bg-light);
  border: var(--border-light);

  color: var(--color-text-muted);
  font-size: 18px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

/* Grid desktop */
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

/* MODAL – IMAGEN COMPLETA */
.modal-image {
  background: var(--color-bg-card);
  padding: var(--space-4) 0;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.modal-image img {
  height: auto;      /* mantiene proporción */
  max-height: 400px; /* o lo que estimes conveniente */
  object-fit: contain; /* 🔹 se ve completa, sin recorte */
}


/* Info */
.modal-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: bold;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.modal-description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

.modal-price {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-2);
}

.modal-btn {
  margin-top: var(--space-4);
  align-self: flex-start;
}

/* ==========================================
   MOBILE – ARREGLADO
========================================== */

@media (max-width: 768px) {

  .modal-content {
    margin: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;

    padding: var(--space-4);

    display: flex;
    flex-direction: column;
  }

  .modal-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    overflow-y: auto;
  }

  .modal-image img {
    max-height: 200px; /* se ajusta al tamaño móvil */
  }

  .modal-image img {
    height: 200px;
  }

  .modal-info {
    gap: var(--space-2);
  }

  .modal-title {
    font-size: var(--text-md);
  }

  .modal-price {
    font-size: var(--text-lg);
  }

  .modal-btn {
    width: 100%;
    justify-content: center;
  }
}
