/* ==========================================================================
   ESTILOS SINGLE PRODUCT: APPLE GLASSMORPHISM CARD (HERO)
   ========================================================================== */

/* Fondo Neutro para toda la página de producto */
body.single-product {
    background-color: #f5f5f7 !important;
}

.ps-single-product-luxury {
    width: 100%;
}

/* Contenedor fluido que centra la tarjeta */
.ps-product-glass-card-wrapper {
    position: relative;
    width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    padding-top: 10px; /* Flota sutilmente bajo el header */
    padding-bottom: 60px; /* Espacio antes de los recomendados */
    display: flex;
    justify-content: center;
}

/* Configuración Glassmorphism Card Premium */
.ps-product-glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    border-radius: 32px;
    max-width: 1150px;
    width: 95%; /* Seguridad en tablets/laptops pequeños */
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    z-index: 2;
    position: relative;
}

@media (max-width: 900px) {
    .ps-product-glass-card {
        grid-template-columns: 1fr;
    }
}

/* --- LEFT VISUAL (3D) --- */
.ps-product-left-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 40px; /* Reducción agresiva de padding top */
}

.ps-product-floating-img {
    position: relative;
    z-index: 2;
    max-width: 85%; /* Imagen más grande */
    height: auto;
    max-height: 80vh;
    filter: drop-shadow(0 40px 50px rgba(0, 51, 102, 0.25)); /* Sombra profunda */
    object-fit: contain;
}

/* --- RIGHT CONVERSION --- */
.ps-product-right-conversion {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 40px; /* Alineación limpia con la imagen */
    z-index: 3;
    background: transparent;
}

.ps-product-summary-block {
    max-width: 500px;
}

.ps-product-h1 {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 3.5rem;
    line-height: 1.1;
    color: var(--color-text-dark, #0f172a);
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.ps-product-price-custom {
    margin-bottom: 30px;
}

.ps-product-price-custom .price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #003366; /* Azul Salud */
}

/* Tipografía de WooCommerce tachada si hay oferta */
.ps-product-price-custom del {
    font-size: 1.4rem;
    color: #94a3b8;
    margin-right: 15px;
    font-weight: 500;
}

/* --- BENEFICIOS DINÁMICOS --- */
.ps-product-benefits-dynamic {
    margin-bottom: 40px;
    padding: 25px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(10px);
}

.ps-benefits-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #003366;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Maquetación automática para etiquetas ul>li del Short Description */
.ps-benefits-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ps-benefits-content ul li {
    position: relative;
    padding-left: 35px;
    margin-bottom: 15px;
    font-size: 1rem;
    color: #334155;
    line-height: 1.6;
}

.ps-benefits-content ul li::before {
    content: '\f058'; /* Icono check circle de FontAwesome */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    color: #4CAF50; /* Verde Premium */
    font-size: 1.2rem;
}

.ps-benefits-content p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* --- BOTONES Y FORMULARIOS --- */
.ps-product-add-to-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.ps-product-add-to-cart-wrapper form.cart {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

/* Cantidad (iOS Style) */
.ps-product-add-to-cart-wrapper .quantity input.qty {
    width: 65px;
    height: 55px;
    border-radius: 100px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    font-size: 1.2rem;
    font-weight: 800;
    color: #003366;
    text-align: center;
    transition: var(--transition-smooth);
}

.ps-product-add-to-cart-wrapper .quantity input.qty:focus {
    border-color: #11998e;
    outline: none;
    box-shadow: 0 0 0 4px rgba(17, 153, 142, 0.1);
}

/* Botón Añadir al Carrito (Premium Verde) */
.ps-product-add-to-cart-wrapper button.single_add_to_cart_button {
    height: 55px;
    padding: 0 35px;
    border-radius: 100px;
    background: #4CAF50;
    border: none;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 20px -5px rgba(76, 175, 80, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ps-product-add-to-cart-wrapper button.single_add_to_cart_button::after {
    content: '\f291';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 10px;
}

.ps-product-add-to-cart-wrapper button.single_add_to_cart_button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(76, 175, 80, 0.6);
    background: #45a049;
}

/* Botón Comprar Ahora (Azul Salud Ghost/Solid) */
.ps-btn-quick-buy {
    flex: 1;
    min-width: 200px;
    height: 55px;
    border-radius: 100px;
    background: #003366;
    border: none;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px -5px rgba(0, 51, 102, 0.3);
}

.ps-btn-quick-buy:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(0, 51, 102, 0.5);
}

/* Soporte Preparado para Variaciones */
.ps-product-add-to-cart-wrapper .variations {
    width: 100%;
    margin-bottom: 20px;
}

.ps-product-add-to-cart-wrapper .variations select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-weight: 600;
    color: #334155;
    background-color: #f8fafc;
    cursor: pointer;
}

/* Categorías y Etiquetas */
.ps-product-meta-custom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #64748b;
}

.ps-product-meta-custom a {
    color: #11998e;
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
}

.ps-product-meta-custom a:hover {
    text-decoration: underline;
}

/* Responsividad Fina */
@media (max-width: 768px) {
    .ps-product-h1 {
        font-size: 2.5rem;
    }
    .ps-product-right-conversion {
        padding: 50px 20px;
        align-items: center;
        text-align: center;
    }
    .ps-product-summary-block {
        max-width: 100%;
    }
    .ps-benefits-content ul li {
        text-align: left;
    }
    .ps-product-left-visual {
        min-height: 400px;
    }
    .ps-product-add-to-cart-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .ps-product-add-to-cart-wrapper form.cart {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ==========================================================================
   SECCIÓN: PRODUCTOS RECOMENDADOS
   ========================================================================== */
.ps-related-products-wrapper {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 100px 20px !important;
    text-align: center !important;
    display: block !important; /* Anula cualquier Flex de Astra */
    clear: both !important;
    width: 100% !important;
    float: none !important;
}

/* Ocultar el título de WooCommerce H2 por defecto que se duplica */
body .ps-related-products-wrapper section.related > h2 {
    display: none !important;
}

body .ps-related-title {
    font-size: 2.5rem !important;
    font-weight: 900 !important;
    color: #003366 !important;
    text-align: center !important;
    margin-bottom: 50px !important;
    letter-spacing: -0.5px !important;
    display: block !important; /* Previene alineación lateral */
    width: 100% !important;
    float: none !important;
    clear: both !important;
}

/* Fuerza al contenedor de la grilla de woo a ser bloque */
body .ps-related-products-wrapper section.related {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
}

body .ps-related-products-wrapper .products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 30px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* ==========================================================================
   INTERFAZ DE PRODUCTOS RELACIONADOS (LAYOUT GRID/SLIDER)
   (El diseño interno de las tarjetas se hereda ahora de catalogo.css)
   ========================================================================== */

/* Mostrar botones en recomendados ahora que son de consulta WhatsApp */
body .ps-related-products-wrapper .ps-product-card__action,
body .ps-related-products-wrapper .products li.product .button {
    display: block !important;
}

@media (max-width: 1024px) {
    body .ps-related-products-wrapper .products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    /* Ajuste responsivo de título */
    body .ps-related-title {
        font-size: 1.8rem !important;
        margin-bottom: 30px !important;
    }
    
    /* Native CSS Scroll Snap Carousel para Mobile */
    body .ps-related-products-wrapper .products {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        scroll-behavior: smooth !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 15px !important;
        padding-bottom: 25px !important;
        padding-top: 10px !important;
    }

    body .ps-related-products-wrapper .products::-webkit-scrollbar {
        height: 0px; 
        background: transparent;
    }

    body .ps-related-products-wrapper .products li.product {
        min-width: 75vw !important;
        max-width: 75vw !important;
        flex: 0 0 auto !important;
        scroll-snap-align: center !important;
        margin: 0 !important;
    }
}
