/* ==========================================================================
   VITALSALUD - HOJA DE ESTILOS: DETALLE DE PRODUCTO (producto.css)
   ========================================================================== */

/* 1. BREADCRUMBS */
.breadcrumbs-bar {
    background-color: var(--bg-light);
    border-bottom: 1px solid #e9ecef;
    padding: 14px 5%;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    font-family: var(--font-secondary);
    color: var(--text-gray);
}

.breadcrumbs a {
    color: var(--text-gray);
    transition: var(--transition-smooth);
}

.breadcrumbs a:hover {
    color: var(--secondary);
}

.breadcrumbs .separator {
    font-size: 11px;
    color: #999999;
}

.breadcrumbs .current {
    color: var(--primary);
    font-weight: 600;
}

/* 2. CONTENEDOR PRINCIPAL DEL PRODUCTO */
.product-detail-section {
    padding: 40px 5% 60px 5%;
    background-color: #ffffff;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

/* 3. GALERÍA DE IMÁGENES */
.product-gallery-wrapper {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gallery-main-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #ffffff;
    border: 1px solid #edf0f3;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.gallery-main-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.4s ease;
}

.gallery-main-frame:hover img {
    transform: scale(1.06);
}

.gallery-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background-color: #e63946;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb-item {
    width: 76px;
    height: 76px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-color: #ffffff;
    padding: 4px;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.thumb-item.active,
.thumb-item:hover {
    border-color: var(--secondary);
    box-shadow: 0 2px 8px rgba(2, 146, 219, 0.25);
}

/* 4. INFORMACIÓN DE COMPRA (BUY BOX) */
.product-buy-box {
    display: flex;
    flex-direction: column;
}

.product-buy-box .product-category a{
    font-size: 0.75rem;
    color: var(--secondary);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.8px;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
    margin-bottom: 18px;
    font-family: var(--font-primary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 13px;
    font-family: var(--font-secondary);
    color: var(--text-gray);
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffb703;
}

.detail-rating span {
    font-size: 16px;
}

.detail-reviews-count {
    color: var(--text-gray);
    margin-left: 4px;
}

.detail-sku {
    color: #888888;
}

.detail-stock-status {
    color: #2b9348;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Precios */
.detail-price-container {
    background-color: #fbfbfd;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.detail-prices {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 6px;
}

.detail-price-current bdi,
.detail-price-current bdi span{
    font-size: 32px;
    font-weight: 800;
    color: var(--secondary);
    font-family: var(--font-primary);
}

.detail-price-current span {
    font-size: 16px;
    font-weight: 600;
    color: #777777;
}

.detail-price-old {
    font-size: 18px;
    color: #999999;
    text-decoration: line-through;
    font-family: var(--font-secondary);
}

.detail-discount-tag {
    background-color: #e63946;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.detail-installments {
    font-size: 13px;
    color: var(--text-dark);
    font-family: var(--font-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.detail-installments strong {
    color: var(--primary);
}

/* Lista rápida de atributos */
.detail-highlights {
    margin-bottom: 24px;
}

.detail-short-desc {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-family: var(--font-secondary);
}

.detail-stock-alert {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2b9348;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-secondary);
}

.detail-stock-alert span {
    font-size: 18px;
    color: #2b9348;
}

.detail-highlights ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.detail-highlights li {
    font-size: 14px;
    color: var(--text-dark);
    font-family: var(--font-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-highlights li span {
    color: var(--secondary);
    font-size: 18px;
}

/* Opciones de Variantes */
.detail-variant-group {
    margin-bottom: 24px;
}

.variant-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
    display: block;
    font-family: var(--font-secondary);
}

.variant-options {
    display: flex;
    gap: 10px;
}

.variant-btn {
    padding: 8px 16px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background-color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-secondary);
    color: var(--text-dark);
}

.variant-btn.active,
.variant-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    background-color: #f0f9ff;
}

/* Controles de Compra */
.purchase-row {
    display: flex;
    gap: 14px;
    margin-bottom: 16px;
    align-items: stretch;
}

.qty-control {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
}

.btn-qty {
    width: 40px;
    height: 48px;
    background-color: #f8f9fa;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-dark);
    transition: var(--transition-smooth);
}

.btn-qty:hover {
    background-color: #e9ecef;
}

.qty-input {
    width: 45px;
    height: 48px;
    border: none;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-secondary);
    outline: none;
    color: var(--primary);
}

.btn-add-cart-detail {
    flex-grow: 1 !important;
    height: 48px !important;
    background-color: var(--secondary) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-family: var(--font-primary) !important;
    letter-spacing: 0.5px !important;
    transition: var(--transition-smooth) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
}

.btn-add-cart-detail:hover {
    background-color: var(--secondary-dark);
    box-shadow: 0 4px 14px rgba(2, 146, 219, 0.35);
}

.btn-buy-now {
    width: 100%;
    height: 48px;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-primary);
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    margin-bottom: 24px;
}

.btn-buy-now:hover {
    background-color: var(--primary-light);
}

/* Beneficios y Garantías */
.detail-perks-box {
    border-top: 1px solid #edf0f3;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.perk-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-family: var(--font-secondary);
    color: var(--text-dark);
}

.perk-item span.icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #f0f7fc;
    color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* 5. PESTAÑAS DE INFORMACIÓN (TABS) */
.product-tabs-section {
    padding: 0 5% 70px 5%;
    background-color: #ffffff;
}

.tabs-nav {
    display: flex;
    gap: 20px;
    border-bottom: 2px solid #eaedf0;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 18px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-gray);
    cursor: pointer;
    font-family: var(--font-primary);
    position: relative;
    transition: var(--transition-smooth);
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary);
    border-radius: 3px 3px 0 0;
}

.tab-panel {
    display: none;
    line-height: 1.7;
    font-family: var(--font-secondary);
    color: var(--text-dark);
    max-width: 900px;
}
.tab-panel p{
    margin: 15px 10px;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.specs-table th,
.specs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
    font-size: 14px;
}

.specs-table th {
    width: 35%;
    color: var(--primary);
    font-weight: 700;
    background-color: #fbfbfd;
}

.specs-subtitle {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin: 24px 0 8px 0;
    font-family: var(--font-primary);
    border-left: 3px solid var(--secondary);
    padding-left: 10px;
}

.specs-subtitle:first-child {
    margin-top: 0;
}

/* 6. PRODUCTOS RELACIONADOS */
.related-section {
    padding: 50px 5% 80px 5%;
    background-color: var(--bg-light);
    margin-bottom: 60px;
}

.related-header {
    text-align: center;
    margin-bottom: 35px;
}

.related-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Separador Blanco entre Productos Relacionados y Bloque de Suscripción */
.section-divider-white {
    height: 60px;
    background-color: #ffffff;
    width: 100%;
}

/* 7. RESPONSIVE (MÓVIL Y TABLET) */
@media (max-width: 992px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-gallery-wrapper {
        position: static;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .detail-title {
        font-size: 22px;
    }

    .detail-prices {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .detail-price-old {
        order: 1;
        font-size: 15px;
        margin-bottom: 2px;
    }

    .detail-price-current {
        order: 2;
        font-size: 26px;
    }

    .detail-discount-tag {
        order: 3;
        margin-top: 4px;
        align-self: flex-start;
    }

    .purchase-row {
        flex-direction: column;
    }

    .tabs-nav {
        gap: 10px;
        overflow-x: auto;
    }

    .tab-btn {
        font-size: 14px;
        padding: 10px 12px;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}
/* 1. Forzar a todos los contenedores intermedios de variaciones a ocupar el 100% */
.vs-product-add-to-cart-wrapper form.variations_form,
.vs-product-add-to-cart-wrapper .single_variation_wrap,
.vs-product-add-to-cart-wrapper .woocommerce-variation-add-to-cart {
    width: 100% !important;
    display: block !important;
}

/* 2. Contenedor de compra (cantidad + botón): fila horizontal al 100% */
.vs-product-add-to-cart-wrapper .woocommerce-variation-add-to-cart {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    margin-top: 15px !important;
}

/* 3. Selector de cantidad fijo a la izquierda */
.vs-product-add-to-cart-wrapper .woocommerce-variation-add-to-cart .quantity {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.vs-product-add-to-cart-wrapper .woocommerce-variation-add-to-cart .quantity input.qty {
    width: 60px !important;
    height: 48px !important;
    text-align: center !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
}
.button.alt,
.checkout-button.button.alt.wc-forward,
.vs-product-add-to-cart-wrapper .woocommerce-variation-add-to-cart .single_add_to_cart_button {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    height: 48px !important;
    background-color: #009fe3 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease, opacity 0.2s ease !important;
}

/* Estado deshabilitado (cuando no se ha elegido talla/color) */
.vs-product-add-to-cart-wrapper .single_add_to_cart_button.disabled,
.vs-product-add-to-cart-wrapper .single_add_to_cart_button:disabled {
    background-color: #009fe3 !important;
    color: #ffffff !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* Estado activo */
.vs-product-add-to-cart-wrapper .single_add_to_cart_button:not(.disabled):hover {
    background-color: #0087c2 !important;
    opacity: 1 !important;
}