/* ========================================
   PRODUCTOS DESTACADOS
   ======================================== */

.products {
  padding-top: 50px;
  padding-bottom: 50px;
}

/* ========================================
   ENCABEZADO
   ======================================== */

#products-title {
  margin: 0;

  font-size: 32px;
  line-height: 1.2;
  font-weight: 500;
}

/* Ver todos los productos */

.products-view-all {
  color: #f97316;

  font-size: 16px;
  font-weight: 600;

  text-decoration: none;
}

.products-view-all:hover {
  color: #ea580c;
  text-decoration: none;
}

/* ========================================
   CARD
   ======================================== */

.product-card {
  height: 100%;
  box-sizing: border-box;

  border: 1px solid #e5e5e5;
  border-radius: 12px;

  overflow: hidden;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;

  /* Columna flex: empuja el botón de WhatsApp al fondo */
  display: flex;
  flex-direction: column;
}

/* ========================================
   ENLACE AL DETALLE DEL PRODUCTO
   ======================================== */

.product-card-link {
  display: flex;
  flex-direction: column;
  flex: 1; /* Ocupa todo el espacio libre dentro de la tarjeta */

  color: inherit;
  text-decoration: none;
}

.product-card-link:hover {
  color: inherit;
  text-decoration: none;
}

/* ========================================
   CONTENEDOR BOTÓN WHATSAPP
   ======================================== */

.product-card-whatsapp {
  padding: 0 14px 18px;
  box-sizing: border-box;
}

/* ========================================
   GRID DE PRODUCTOS
   ======================================== */

.products .uk-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;

  margin: 0;
}

/* ========================================
   CARD DENTRO DEL GRID
   ======================================== */

.products .uk-grid > * {
  width: auto;
  padding-left: 0;
}

/* ========================================
   ESTADO VACÍO (SIN RESULTADOS)
   ======================================== */

.products-empty,
.products .uk-grid > .products-empty {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 50px 20px 60px;
  box-sizing: border-box;
}

.products-empty p {
  margin: 0 0 16px;
  color: #6b7280;
  font-size: 18px;
  max-width: 600px;
}

.products-empty .uk-button {
  margin-top: 0;
  border-radius: 8px;
  font-weight: 500;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.products-empty .uk-button:hover {
  border-color: #f97316;
  color: #f97316;
}

/* Hover */

.product-card:hover {
  transform: translateY(-3px);

  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* ========================================
   IMAGEN
   ======================================== */

.product-card .uk-card-media-top {
  height: 190px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 15px 20px;

  box-sizing: border-box;
}

.product-card .uk-card-media-top img {
  width: 100%;
  height: 100%;

  object-fit: contain;

  display: block;
}

/* ========================================
   CONTENIDO
   ======================================== */

.product-card .uk-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 15px 14px 18px;
}

/* ========================================
   NOMBRE
   ======================================== */

.product-card .uk-card-title {
  margin: 0 0 8px;

  color: #222222;

  font-size: 15px;
  line-height: 1.3;
  font-weight: 500;

  /* Reserva espacio para 2 líneas (15px × 1.3 × 2 ≈ 39px) */
  min-height: calc(15px * 1.3 * 2);
}

/* ========================================
   DESCRIPCIÓN
   ======================================== */

.product-card .uk-card-body > p:not(.product-price) {
  margin: 0 0 8px;

  color: #666666;

  font-size: 14px;
  line-height: 1.3;
}

/* ========================================
   PRECIO
   ======================================== */

.product-card .product-price {
  margin: 0 0 14px;

  color: #222222;

  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

/* ========================================
   BOTÓN WHATSAPP
   ======================================== */

.product-card .product-whatsapp {
  width: 100%;

  min-height: 36px;

  padding: 0 10px;

  border: 1px solid #f97316;
  border-radius: 8px;

  background-color: #ffffff;

  color: #222222;

  font-size: 13px;
  font-weight: 500;

  text-transform: none;

  box-sizing: border-box;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

/* Icono WhatsApp */

.product-card .product-whatsapp img {
  width: 18px;
  height: 18px;

  object-fit: contain;

  display: block;

  flex-shrink: 0;
}

/* Hover */

.product-card .product-whatsapp:hover {
  background-color: #fff7ed;

  border-color: #f97316;

  color: #222222;

  text-decoration: none;
}

/* Texto mobile oculto por defecto */

.product-card .text-mobile {
  display: none;
}

/* ========================================
   TABLET
   ======================================== */

@media (min-width: 768px) and (max-width: 1100px) {
  .products {
    padding-top: 45px;
    padding-bottom: 45px;
  }

  #products-title {
    font-size: 30px;
  }

  .products .uk-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .product-card .uk-card-media-top {
    height: 175px;
    padding: 14px 15px;
  }

  .product-card .uk-card-body {
    padding: 14px 12px 16px;
  }

  .product-card .uk-card-title {
    font-size: 15px;
  }

  .product-card .uk-card-body > p:not(.product-price) {
    font-size: 13px;
  }

  .product-card .product-price {
    font-size: 16px;
  }

  .products .uk-grid > *:nth-child(10) {
    display: none;
  }
}

/* ========================================
   MOBILE
   ======================================== */

@media (max-width: 767px) {
  .products {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .product-card .text-desktop {
    display: none;
  }

  .product-card .text-mobile {
    display: block;
  }

  /* ========================================
       ENCABEZADO
       ======================================== */

  .products .uk-flex {
    flex-wrap: nowrap;
    gap: 10px;

    margin-bottom: 25px !important;
  }

  #products-title {
    font-size: 22px;
    line-height: 1.2;

    white-space: nowrap;
  }

  .products-view-all {
    font-size: 12px;
    line-height: 1.2;

    white-space: nowrap;

    flex-shrink: 0;
  }

  /* ========================================
       IMAGEN
       ======================================== */

  .product-card .uk-card-media-top {
    height: 160px;

    padding: 12px 15px;
  }

  /* ========================================
       CONTENIDO
       ======================================== */

  .product-card .uk-card-body {
    padding: 12px 15px 15px;
  }

  /* ========================================
       NOMBRE
       ======================================== */

  .product-card .uk-card-title {
    font-size: 14px;

    /* Ajusta min-height para 2 líneas con font-size de 14px */
    min-height: calc(14px * 1.3 * 2);
  }

  /* ========================================
       DESCRIPCIÓN
       ======================================== */

  .product-card .uk-card-body > p:not(.product-price) {
    font-size: 13px;
  }

  /* ========================================
       PRECIO
       ======================================== */

  .product-card .product-price {
    font-size: 16px;
  }

  /* ========================================
       GRID MOBILE
       ======================================== */

  .products .uk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  /* ========================================
       BOTÓN WHATSAPP - MOBILE
       ======================================== */

  .product-card .product-whatsapp {
    width: auto;

    min-height: 32px;

    padding: 0 12px;

    font-size: 12px;

    gap: 6px;

    white-space: nowrap;
  }

  /* Icono */

  .product-card .product-whatsapp img {
    width: 17px;
    height: 17px;
  }
}
