/* ==========================================================================
   ESTILOS DE PÁGINA DE PRODUCTO (DETALLE)
   ========================================================================== */

/* 1. Layout General (Ajuste de Ancho) */
.product-page-wrapper {
    /* Margin top para compensar navbar fixed */
    margin-top: 140px;
    margin-bottom: 80px;

    /* === CORRECCIÓN DE ANCHO === */
    width: 90%;
    max-width: 1400px;
    /* Igual que en shop.css */
    margin-left: auto;
    margin-right: auto;
}

.breadcrumbs {
    margin-bottom: 30px;
    color: #888;
    font-size: 14px;
}

.breadcrumbs a {
    color: #007bff;
    text-decoration: none;
}

.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Dos columnas iguales */
    gap: 60px;
}

/* 2. Galería (Imagen Principal) */
.main-image-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    /* Altura fija para consistencia */
}

.main-image-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stock-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
}

.stock-tag.in-stock {
    background: #e6fffa;
    color: #00b894;
}

.stock-tag.no-stock {
    background: #fff5f5;
    color: #ff7675;
}

/* 3. Información del Producto */
.product-title {
    font-size: 36px;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.2;
    font-weight: 700;
}

.product-ref {
    color: #999;
    font-weight: 600;
    margin-bottom: 25px;
    display: block;
}

.product-description {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
}

.divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 30px 0;
}

/* --- ESTILOS USUARIO LOGUEADO --- */
.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.price-row .label {
    font-size: 16px;
    color: #666;
}

.price-row .value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

/* Calibration Box */
.calibration-box {
    background: #f0f8ff;
    border: 1px solid #cce5ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calibration-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.toggle-label strong {
    display: block;
    color: #0056b3;
    font-size: 15px;
}

.calib-details {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 2px;
}

.calib-price {
    font-weight: 700;
    color: #007bff;
    font-size: 18px;
}

/* Toggle Switch CSS */
.calibration-toggle input {
    display: none;
}

.slider-round {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    position: relative;
    transition: .3s;
}

.slider-round:before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

input:checked+.slider-round {
    background: #007bff;
}

input:checked+.slider-round:before {
    transform: translateX(20px);
}

.shipping-box {
    display: flex;
    gap: 10px;
    align-items: center;
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 30px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: 700;
    border-top: 2px dashed #eee;
    padding-top: 20px;
}

.total-price {
    color: #007bff;
    font-size: 34px;
}

.actions-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.qty-selector {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    height: 50px;
}

.qty-btn {
    background: #f9f9f9;
    border: none;
    width: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #eee;
}

#qty-input {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: 700;
    font-size: 16px;
}

.btn-buy {
    flex: 2;
    background: #007bff;
    color: #fff;
    border: none;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-buy:hover {
    background: #0056b3;
}

.btn-quote {
    flex: 1;
    background: #fff;
    color: #007bff;
    border: 2px solid #007bff;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.btn-quote:hover {
    background: #007bff;
    color: #fff;
}

/* --- ESTILOS INVITADO (GUEST) --- */
.guest-lock-box {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    border: 1px solid #e9ecef;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.03);
}

.lock-icon {
    margin-bottom: 15px;
}

.guest-lock-box h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.guest-lock-box p {
    color: #666;
    margin-bottom: 25px;
}

.guest-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.btn-login {
    background: #333;
    color: #fff;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #000;
}

.btn-register {
    background: #fff;
    color: #333;
    border: 1px solid #333;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-register:hover {
    background: #f0f0f0;
}

.divider-text {
    position: relative;
    margin: 30px 0;
}

.divider-text span {
    background: #f8f9fa;
    padding: 0 10px;
    position: relative;
    z-index: 1;
    color: #888;
    font-size: 14px;
}

.divider-text:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #ddd;
}

.quick-quote-form input,
.quick-quote-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
}

.btn-send-quote {
    width: 100%;
    background: #007bff;
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-send-quote:hover {
    background: #0056b3;
}


/* ==========================================================================
   PRODUCTOS RELACIONADOS (GRID COPIADO DE SHOP.CSS)
   ========================================================================== */
.related-products-section {
    margin-top: 80px;
    border-top: 1px solid #eee;
    padding-top: 60px;
}

.related-products-section h2 {
    font-size: 28px;
    margin-bottom: 40px;
    color: #333;
    text-align: center;
}

/* Rejilla */
.products-grid {
    display: grid;
    /* Rejilla responsiva automática con mínimo de 240px */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 30px;
}

/* Tarjeta Producto */
.product-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Importante */
}

.product-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
    border-color: #e0e0e0;
}

.product-image-wrapper {
    height: 220px;
    padding: 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border-bottom: 1px solid #f9f9f9;
}

.product-image-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.product-info h3 {
    font-size: 16px;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botón ver más (reutilizamos estilo de add-cart-btn pero más simple) */
.add-cart-btn {
    align-self: flex-start;
    padding: 8px 20px;
    border-radius: 6px;
    background: #f0f8ff;
    color: #007bff;
    border: 1px solid #007bff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.add-cart-btn:hover {
    background: #007bff;
    color: #fff;
}

.value-usd {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.value-mxn {
    display: block;
    font-size: 16px;
    color: #888;
    font-weight: 500;
}

/* Calibration Wrapper */
.calibration-wrapper {
    background: #fff;
    border: 2px solid #eaf6ff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.calibration-header {
    background-color: #f0f8ff;
    padding: 15px 20px;
}

.calibration-details {
    padding: 20px;
    border-top: 1px solid #eaf6ff;
    display: block;
    /* JS controla esto, pero por defecto visible si checked */
}

.calib-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #555;
}

.calib-info-list li {
    margin-bottom: 8px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.calib-info-list li:last-child {
    border: 0;
    margin: 0;
}

/* Stock Control Row */
.stock-control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.stock-info {
    font-size: 14px;
    color: #666;
}

.stock-value {
    font-size: 18px;
    color: #333;
    margin-left: 5px;
}

/* Cost Summary */
.cost-summary {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 15px;
    color: #666;
}

.summary-row.total {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #eee;
    font-weight: 700;
    color: #333;
    font-size: 18px;
    align-items: flex-start;
}

.total-values {
    text-align: right;
}

.main-total {
    display: block;
    font-size: 24px;
    color: #007bff;
}

.secondary-total {
    display: block;
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.exchange-note {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin-top: 15px;
}

/* Detalles de Calibración más compactos */
.calib-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.calib-item.full {
    grid-column: span 2;
}

.calib-key {
    font-size: 11px;
    color: #888;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calib-val {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* NUEVO: GRID DE LOGÍSTICA (Mini Tarjetas) */
.logistics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.logistics-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.logistics-card.full-width {
    grid-column: span 2;
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.logistics-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
    font-weight: 700;
}

.logistics-value {
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logistics-value strong {
    font-size: 20px;
    color: #007bff;
}

/* Selector de cantidad compacto */
.qty-selector.compact {
    border: 1px solid #ddd;
    border-radius: 6px;
    height: 36px;
    width: 100%;
}

.qty-selector.compact .qty-btn {
    width: 30px;
    font-size: 16px;
}

.qty-selector.compact input {
    font-size: 16px;
    width: 100%;
}

/* Tarjeta de Tiempo de Entrega */
.delivery-card {
    border-left: 4px solid #007bff;
    /* Acento visual */
}

.delivery-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 14px;
    color: #444;
}

.delivery-row:last-child {
    margin-bottom: 0;
}

.delivery-row .icon {
    font-size: 18px;
}

.delivery-row strong {
    color: #007bff;
}

.delivery-total-line {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

/* BARRA DE ASESORÍA */
.advisory-bar {
    background-color: #007bff;
    color: #fff;
    padding: 15px 0;
    margin-top: 40px;
    border-radius: 10px;
    text-align: center;
    font-family: 'Lexend', sans-serif;
}

.advisory-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.advisory-title {
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
}

.advisory-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.advisory-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s;
}

.advisory-link:hover {
    opacity: 0.8;
}

.advisory-link svg {
    width: 18px;
    height: 18px;
}


/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 700px;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.modal-header h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 5px;
}

.modal-header p {
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.terms-scroll-box {
    height: 250px;
    overflow-y: auto;
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    text-align: justify;
}

.terms-scroll-box p {
    margin-bottom: 10px;
}

.terms-scroll-box strong {
    color: #333;
}

.terms-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}

.terms-check input {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
}

.modal-footer {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.btn-cancel {
    background: none;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    color: #666;
}

.btn-confirm-quote {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-confirm-quote:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-confirm-quote:hover:not(:disabled) {
    background: #0056b3;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- DESCRIPCIÓN CORTA --- */
.product-short-description {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* --- NUEVA SECCIÓN INFERIOR (Full Width dentro del container) --- */
.product-full-details-section {
    margin-top: 60px;
    background-color: #fff;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.03);
}

/* --- PESTAÑAS (TABS) AJUSTADAS --- */
.product-tabs-container {
    margin-bottom: 40px;
    overflow: hidden;
}

.product-description-html {
    font-size: 16px;
    color: #444;
    line-height: 1.8;
}

/* Reset básico para el HTML que venga de WP */
.product-description-html p {
    margin-bottom: 1.5em;
}

.product-description-html h2,
.product-description-html h3 {
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    color: #222;
}

.product-description-html img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.product-description-html ul,
.product-description-html ol {
    padding-left: 20px;
    margin-bottom: 1.5em;
}

/* --- VIDEOS --- */
.product-videos-section h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
    border-left: 4px solid #007bff;
    padding-left: 15px;
}

product-detail-layout {
    display: grid;
    /* CAMBIO: Usamos repeat(2, 1fr) para forzar 50% exacto */
    grid-template-columns: repeat(2, 1fr);
    gap: 60px;
    align-items: start;
    /* Alineación superior para que no se estiren si uno es más corto */
}

/* 2. Galería (Imagen Principal) */
.main-image-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    /* Altura fija */
    width: 100%;
    /* Forzamos ancho completo de su columna */
    box-sizing: border-box;
    /* Importante */
}

.main-image-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- NUEVO: ESTILOS DE GALERÍA --- */
.product-thumbnails {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    overflow-x: auto;
    /* Scroll horizontal si hay muchas */
    padding-bottom: 5px;
    /* Espacio para el scrollbar */
}

/* Scrollbar fino para la galería */
.product-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.product-thumbnails::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.thumb-item {
    width: 80px;
    height: 80px;
    min-width: 80px;
    /* Evita que se aplasten */
    border: 2px solid #eee;
    border-radius: 10px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
}

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

.thumb-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
}

.thumb-item.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

/* --- SELECTOR DE VARIANTES --- */
.variant-selector-box {
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.variant-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.custom-select-wrapper {
    position: relative;
}

.custom-select {
    width: 100%;
    padding: 12px 40px 12px 15px;
    /* Espacio para la flecha */
    font-size: 16px;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 8px;
    appearance: none;
    /* Quita estilo nativo */
    -webkit-appearance: none;
    background-color: #fff;
    cursor: pointer;
    font-family: 'Lexend', sans-serif;
    transition: border-color 0.3s;
}

.custom-select:focus {
    border-color: #007bff;
    outline: none;
}

.select-arrow {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 12px;
    color: #888;
}

/* --- COTIZADOR DE ENVÍO (EN PRODUCTO) --- */
.shipping-calculator-box {
    margin-top: 20px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
}

.shipping-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 14px;
}

.shipping-input-row {
    display: flex;
    gap: 10px;
}

#shipping-zip {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}

#btn-calc-product-ship {
    background-color: #333;
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

#btn-calc-product-ship:hover {
    background-color: #000;
}

.shipping-results-list {
    margin-top: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.ship-option-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 14px;
}

.ship-option-row:last-child {
    border-bottom: none;
}

.ship-option-row input {
    margin-right: 10px;
}

.ship-opt-name {
    flex: 1;
    color: #555;
}

.ship-opt-price {
    font-weight: 700;
    color: #007bff;
}

.shipping-note {
    font-size: 11px;
    color: #888;
    margin-top: 8px;
    font-style: italic;
}

/* --- ESTILOS PARA LA DESCRIPCIÓN CORTA (HTML) --- */
.product-short-description ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.product-short-description p {
    margin-bottom: 10px;
}

/* Ajustar tamaño de fuente de la descripción corta para que no sea gigante */
.product-short-description {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
}


/* ==========================================================================
   ESTILOS PARA TABLAS DE ESPECIFICACIONES (HTML DESC)
   ========================================================================== */

/* 1. Contenedor para Scroll en Móvil (El arreglo del desplazamiento) */
.product-description-html {
    /* Forzamos al contenedor a no exceder el ancho de la pantalla */
    max-width: 100%;
    display: block;
    /* Habilitamos el scroll interno SOLO para la tabla */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* 2. Estilo Base de la Tabla */
.product-description-html table {
    width: 100%;
    /* Un ancho mínimo asegura que la tabla se lea bien y active el scroll si falta espacio */
    min-width: 650px;
    border-collapse: separate;
    border-spacing: 0;
    margin: 30px 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
}

/* ================================================================
   CORRECCIÓN DEFINITIVA DE TABLAS
   ================================================================ */

/* B. SOLO la Primera Fila (Header): Azul y texto blanco */
.product-description-html table.simple-table tr:first-child td,
.product-description-html table.simple-table tr:first-child th {
    background: #007bff !important;
    /* Azul sólido corporativo */
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    /* Gradiente sutil */
    color: #fff !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    border-bottom: none;

    /* CORRECCIÓN VISUAL: Alineación a la izquierda para coincidir con los datos */
    text-align: left !important;
    padding: 12px 15px;
    /* Mismo padding que las celdas de abajo */
}

/* Forzar que los textos del header sean blancos */
.product-description-html table.simple-table tr:first-child * {
    color: #fff !important;
    text-decoration: none !important;
}

/* Ajuste fino para la primera columna (Modelo) */
.product-description-html table.simple-table tr:not(:first-child) td:first-child {
    background-color: #f1f8ff !important;
    /* Un azul muy muy pálido para destacar la columna clave */
    color: #0056b3 !important;
    font-weight: 700;
}

.product-description-html table.simple-table td,
.product-description-html table.simple-table th {
    padding: 12px 15px;
}

/* ================================================================
   ESTILOS ESPECÍFICOS PARA TABLA COMPLEJA (.complex-table)
   (Mantenemos lo que ya funcionaba bien)
   ================================================================ */
.product-description-html table.complex-table tr:nth-child(-n+3) td,
.product-description-html table.complex-table tr:nth-child(-n+3) th {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.product-description-html table.complex-table tr:nth-child(-n+3) * {
    color: #fff !important;
}

.product-description-html table.complex-table td {
    text-align: center;
    vertical-align: middle;
}

/* Columna modelo alineada a la izquierda */
.product-description-html table.complex-table tr:nth-child(n+4) td:first-child {
    text-align: left;
    font-weight: 600;
    color: #007bff !important;
    background-color: #fafafa !important;
}

.product-description-html table.complex-table td,
.product-description-html table.complex-table th {
    padding: 12px 15px;
}


/* ==========================================================================
   ESTILOS PARA BOTONES DE WORDPRESS (Dentro de la descripción)
   ========================================================================== */

/* Botones .wp-block-button__link que vienen en el HTML importado */
.product-description-html .wp-block-button__link {
    display: inline-block;
    background-color: #007bff;
    /* Azul corporativo */
    color: #fff !important;
    /* Texto blanco forzado */
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);

    /* ESPACIO SOLICITADO */
    margin-top: 25px;
    margin-bottom: 25px;
    margin-right: 15px;
    /* Por si hay varios seguidos */
}

.product-description-html .wp-block-button__link:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
    color: #fff !important;
}

/* Contenedor de botones de WP (a veces vienen envueltos en un div) */
.product-description-html .wp-block-button {
    margin-bottom: 15px;
}

/* Pestañas */
.product-tabs-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 30px;
    border: 1px solid #eee;
}

.tabs-header {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #eee;
    padding: 0 10px; /* Reducimos padding lateral en móvil */
    
    /* PERMITIR SCROLL HORIZONTAL */
    overflow-x: auto; 
    white-space: nowrap; 
    -webkit-overflow-scrolling: touch; /* Suavidad en iOS */
    scrollbar-width: none; /* Oculta scrollbar en Firefox */
}

/* Ocultar scrollbar en Chrome/Safari */
.tabs-header::-webkit-scrollbar {
    display: none; 
}

.tab-link {
    flex-shrink: 0; /* EVITA QUE EL BOTÓN SE ACHIQUE */
    background: none;
    border: none;
    padding: 15px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-family: 'Lexend', sans-serif;
}

.tab-link:hover {
    color: #333;
}

.tab-link.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Fichas Técnicas */
.tech-sheets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.tech-sheet-card {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

.tech-sheet-card:hover {
    border-color: #e74c3c;
    background: #fff5f4;
}

.tech-sheet-card .file-icon {
    width: 40px;
    margin-right: 15px;
}

.tech-sheet-card .file-icon img {
    width: 100%;
}

.tech-info .file-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.tech-info .file-action {
    font-size: 0.8rem;
    color: #e74c3c;
}

/* Video Slider con Lite-YouTube */
.video-wrapper {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: #000;
}

.product-videos-slider {
    padding-bottom: 40px;
}

lite-youtube {
    max-width: 100%;
    border: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {

    /* Sombra visual a la derecha para indicar que hay scroll */
    .product-description-html {
        padding-right: 0;
        /* Aprovechar todo el ancho */
    }

    /* Pista visual de scroll */
    .product-description-html::after {
        content: 'Desliza →';
        position: absolute;
        bottom: 5px;
        right: 10px;
        font-size: 10px;
        color: #999;
        background: rgba(255, 255, 255, 0.8);
        padding: 2px 5px;
        border-radius: 4px;
        pointer-events: none;
    }

    .product-description-html table {
        font-size: 13px;
        border: 1px solid #ddd;
    }

    .product-description-html table td {
        padding: 10px 5px;
        white-space: normal;
        /* Permitir que el texto baje de línea si es necesario */
    }

    .advisory-info {
        flex-direction: column;
    }
}


/* --- Responsive Ajustado --- */
@media (max-width: 992px) {
    .product-detail-layout {
        /* Usamos minmax(0, 1fr) para forzar al grid a no exceder el ancho disponible */
        grid-template-columns: minmax(0, 1fr); 
        gap: 30px;
        width: 100%;
    }

    .product-gallery-column, 
    .product-info-column {
        /* Vital para prevenir que el contenido interno "infle" la columna */
        min-width: 0; 
        width: 100%;
    }

    .main-image-card {
        height: auto; /* Cambiamos a auto para que sea flexible */
        aspect-ratio: 1/1; /* Mantiene la forma cuadrada sin desbordar */
        max-height: 400px;
        padding: 30px;
    }

    .product-info-column {
        order: 2;
    }

    .product-gallery-column {
        order: 1;
    }
}

@media (max-width: 600px) {
    .product-detail-layout {
        gap: 20px;
    }

    .main-image-card {
        max-height: 300px;
        padding: 15px;
    }

    .product-title {
        font-size: 22px; /* Reducido un poco para evitar desborde */
        line-height: 1.3;
        word-break: break-word; /* Rompe palabras si son muy largas */
    }

    /* Grid de relacionados en móvil */
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .product-image-wrapper {
        height: 140px;
        padding: 8px;
    }

    .product-info {
        padding: 10px;
    }

    .product-info h3 {
        font-size: 13px;
    }

    /* Ajuste de logística para que no se salga */
    .logistics-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .logistics-card.full-width {
        grid-column: span 1;
    }

    /* Ajuste de botones de acción */
    .actions-row {
        grid-template-columns: 1fr; /* Un botón sobre otro en móviles pequeños */
        gap: 10px;
    }

    .tab-content {
        padding: 20px 15px; /* Reducimos el padding interno del contenido */
    }
}