/* ===== TÍTULO PRINCIPAL DE PRODUCTOS ===== */
.title-producto {
  margin: 0 auto;
  text-align: center;
  padding: clamp(20px, 4vw, 40px) clamp(10px, 3vw, 20px);
  max-width: clamp(320px, 90vw, 1100px);
}

.title-producto h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  color: #003366;
  margin-top: clamp(20px, 3vw, 40px);
  margin-bottom: clamp(20px, 3vw, 40px);
  position: relative;
  display: inline-block;
  line-height: 1.2;
}

/* Línea decorativa bajo el título */
.title-producto h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(100px, 50%, 300px);
  height: clamp(2px, 0.5vw, 3px);
  background: linear-gradient(to right, #2067af 20%, #e71919 20%, #e71919 80%, #2067af 80%);
  border-radius: 2px;
}

/* ===== SUBTÍTULO DE PRODUCTO ===== */
.title-sub-producto {
  text-align: start;
  padding: clamp(10px, 3vw, 20px) clamp(15px, 5vw, 40px);
  max-width: clamp(320px, 90vw, 1000px);
  margin: 0 auto;
}

.title-sub-producto h2 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: #003366;
  position: relative;
  display: block;
  padding-bottom: clamp(3px, 0.5vw, 5px);
  margin-bottom: clamp(10px, 1vw, 15px);
  font-weight: 700;
  line-height: 1.3;
}

/* Línea inferior sólida */
.title-sub-producto h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: clamp(1px, 0.3vw, 1.5px);
  background: #e71919;
  border-radius: 1px;
}


.container-producto {
    width: 100%;
    /*min-height: 100vh;*/
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px;
    box-sizing: border-box;
    padding-bottom: 50px;
}

/* Tarjeta de producto - ahora más compacta */
.product-card-3d-producto {
    width: 220px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
}

/* Contenedor 3D - ajustado para llenar espacio */
.image-3d-container-producto {
    perspective: 1000px;
    width: 100%;
    height: 220px; /* Cuadrado perfecto */
    position: relative;
    overflow: hidden;
    background: transparent; /* Fondo transparente */
    margin-bottom: 15px;
}

/* Ajustes para llenar el contenedor */
.front-3d-wrapper-producto {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.front-image-producto {
    width: 100%; /* Ahora ocupa el 100% */
    height: 100%; /* Ahora ocupa el 100% */
    object-fit: cover; /* Cambiado a cover para llenar el espacio */
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backface-visibility: hidden;
}

.back-image-producto {
    width: 100%; /* Ocupa todo el ancho */
    height: 100%; /* Ocupa todo el alto */
    object-fit: cover; /* Cambiado a cover */
    position: absolute;
    left: 0;
    bottom: 0;
    opacity: 0;
    transform: translateY(30%) scale(0.4);
    filter: brightness(1.1) contrast(1.1);
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 2;
}

/* Efectos hover (MANTENIDOS IGUAL) */
.product-card-3d-producto:hover .front-3d-wrapper-producto {
    transform: rotateX(15deg);
}

.product-card-3d-producto:hover .front-image-producto {
    opacity: 0.5;
    transform: rotateX(25deg) scale(0.9);
    filter: blur(1px) brightness(0.8);
}

.product-card-3d-producto:hover .back-image-producto {
    opacity: 1;
    transform: translateY(-5%) scale(0.9);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3)) brightness(1.1) contrast(1.1);
}

/* Texto del producto - más compacto */
.product-name-producto {
    margin: 10px 15px 5px;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    line-height: 1.2;
}

/* Botón más integrado */
.product-link-producto {
    display: inline-block;
    padding: 8px 20px;
    background: #4a6cf7;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease; /* Transición de 0.3 segundos con efecto ease (suave) */
    margin-top: 5px;
    text-decoration: none; /* Quita el subrayado */
    text-align: center;
}

.product-link-producto:hover {
    background: #0a3866;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Mejoras de accesibilidad */
.product-link-producto:focus {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .product-card-3d-producto {
        width: 180px;
    }
    
    .image-3d-container-producto {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .product-card-3d-producto {
        width: 160px;
    }
    
    .image-3d-container-producto {
        height: 160px;
    }
    
    .product-name-producto {
        font-size: 14px;
        margin: 8px 10px 3px;
    }
    
    .product-link-producto {
        padding: 6px 16px;
        font-size: 13px;
    }
}