/* ================================
   SECCIÓN: PRODUCTOS RELACIONADOS
================================== */
.productos-relacionados{
  /* Ajusta aquí tamaños por defecto */
  --rel-card-w: 180px;  /* ancho tarjeta */
  --rel-img-w: 180px;   /* ancho imagen  */
  --rel-img-h: 120px;   /* alto imagen   */
  width: 100%;
  padding: 2rem 0rem;
}

.productos-relacionados > h2{
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 1.5rem 3rem; /* si no quieres sangría, deja solo margin:0 0 1.5rem; */
}

/* Contenedor y grilla */
.productos-relacionados .contenedor-relacionados{
  width: 100%;
  max-width: 100%;
  padding: 0 1.5rem;
  box-sizing: border-box;
  overflow: hidden;
}

.productos-relacionados .carrusel-relacionados{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--rel-card-w), 1fr));
  gap: 16px;
  justify-items: center;
}

/* Tarjeta */
.productos-relacionados .tarjeta-producto{
  width: var(--rel-card-w);
  background: #fff;
  box-shadow: 0 2px 12px rgba(28,36,75,.10);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Imagen (control por variables) */
.productos-relacionados .tarjeta-producto .img-wrap{
  width: var(--rel-img-w);
  height: var(--rel-img-h);
  display: block;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 8px;
  text-decoration: none; /* por si el tema subraya anchors */
}
.productos-relacionados .tarjeta-producto .img-wrap img{
  width: 100%;
  height: 100%;
  object-fit: cover;         /* << llena y recorta */
  object-position: center;   /* centra el recorte */
  display: block;
}

/* Contenido inferior */
.productos-relacionados .tarjeta-producto .contenido-producto{
  border: 2px solid #BCC1C3;
  border-top: 0;
  background: #fff;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: .5rem;
  text-align: center;
  min-height: 150px;
}

/* Título con alto fijo (2 líneas) */
.productos-relacionados .tarjeta-producto .nombre-producto{
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
  color: #1C244B;
  text-decoration: none;
  margin: 8px 0 6px;
  min-height: calc(1.25em * 2);
  max-height: calc(1.25em * 2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Precio con altura mínima para no mover el botón */
.productos-relacionados .tarjeta-producto .precio-producto{
  font-size: .9rem;
  font-weight: 800;
  color: #000;
  min-height: 1.6em;
  margin: 0 0 6px;
}

/* CTA centrado (botón o formulario) */
.productos-relacionados .tarjeta-producto .cta-wrap{
  display: flex;
  justify-content: center;
  width: 100%;
}
.productos-relacionados .tarjeta-producto .btn-carrito,
.productos-relacionados .tarjeta-producto .add_to_cart_button,
.productos-relacionados .tarjeta-producto .button{
  display: inline-block;
  width: 100%;
  text-align: center;
  background-color: #0F1B31;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 22px;
  padding: .55rem .75rem;
  font-size: .8rem;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s;
}
.productos-relacionados .tarjeta-producto .btn-carrito:hover,
.productos-relacionados .tarjeta-producto .add_to_cart_button:hover,
.productos-relacionados .tarjeta-producto .button:hover{
  background: #fff;
  color: #0F1B31;
  border-color: #0F1B31;
}
.productos-relacionados .tarjeta-producto form.cart{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  margin: 0 auto;
}

/* Responsive estrecho */
@media (max-width:480px){
  .productos-relacionados .carrusel-relacionados{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .productos-relacionados .tarjeta-producto{
    width: 100%;
    max-width: 220px;
  }
  .productos-relacionados .tarjeta-producto .img-wrap{
    width: 100%;
    height: auto;
    aspect-ratio: var(--rel-img-w) / var(--rel-img-h);
  }
}







/* ======================================================
   Título tipo BOX con línea (único para productos-relacionados)
   Prefijo: productos-relacionados-*
   ====================================================== */

.productos-relacionados-titulo-box-container {
  display: flex;
  align-items: center;
  /* gap: 1rem; */
  margin: 0 0 1.5rem 0;
  padding: 0 1rem;
}

.productos-relacionados-titulo-box-container.is-left {
  justify-content: flex-start;
}

.productos-relacionados-titulo-box-container.is-center {
  justify-content: center;
}

.productos-relacionados-titulo-box-container.is-right {
  justify-content: flex-end;
}

.productos-relacionados-titulo-box-line {
  flex-grow: 1;
  height: 2px;
  background-color: #1C244B;
  /* margin: 0 0.5rem; */
}

.productos-relacionados-titulo-box {
  border: 2px solid #1C244B;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1.3rem;
  color: #1C244B;
  white-space: normal;
  z-index: 1;
}

.productos-relacionados-titulo-box-text {
  display: inline-block;
  line-height: 1;
}

/* Responsivo */
@media (max-width: 768px) {
  .productos-relacionados-titulo-box {
    padding: 0.4rem 0.8rem;
    font-size: 0.95rem;
  }
  .productos-relacionados-titulo-box-container { padding: 0 0.5rem; }
}
