.diagnostico-header {
    text-align: center;
    padding: 12rem 1.5rem 8rem 1.5rem; /* Aumentamos el padding inferior para dar espacio al divisor */
    color: var(--color-white);
    position: relative; /* Necesario para el divisor de forma */
    margin-bottom: 0; /* Eliminamos el margen que causaba la línea blanca */
     margin-top: calc(-1 * var(--header-height));
    /* Fondo con gradiente de marca y una imagen sutil. 
       Reemplaza la URL por una imagen de fondo de alta calidad y oscura, 
       como una textura de fibra de carbono o un taller limpio y moderno. */
    background: 
        linear-gradient(135deg, rgba(20, 25, 30, 0.85) 0%, rgba(255, 58, 23, 0.7) 100%), 
        url('/assets/images/TRITON-D10-.jpg') center/cover no-repeat;
}

/* Divisor de forma diagonal en la parte inferior */
.diagnostico-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px; /* Altura de la diagonal */
    background: var(--color-bg-light); /* Debe ser el color de la siguiente sección */
    clip-path: polygon(0 100%, 100% 0, 100% 100%); /* Crea la forma diagonal */
}

/* --- Animaciones para el texto del encabezado --- */

/* Definición de la animación: aparecer desde abajo y desvanecerse */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.diagnostico-header h1 {
    font-size: var(--font-size-4xl);
    text-shadow: 2px 2px 10px rgba(0,0,0,0.6);
    margin-bottom: 1rem;
    font-weight: 800;
     color: var(--color-white);
    opacity: 0; /* Inicia invisible */
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.2s; /* Pequeño retraso para que inicie después de cargar */
}

.diagnostico-header p {
    font-size: var(--font-size-lg);
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto;
    
    /* Aplicando la animación con un retraso mayor */
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.4s;
}

/* --- Estructura de Secciones Temáticas --- */
.diagnostico-section {
    padding: 3rem 1.5rem;
    margin-bottom: 2rem;
}

.diagnostico-section:nth-child(even) {
    background-color: #f7f9fc; /* Fondo sutil para secciones pares */
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.diagnostico-section h2 {
    font-size: var(--font-size-2xl);
    color: var(--color-text-dark);
    text-align: center;
    margin-bottom: 0.75rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 1rem;
}

.diagnostico-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
}

.diagnostico-section .section-description {
    text-align: center;
    font-size: var(--font-size-base);
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

/* --- Cuadrícula de Productos --- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* --- Ficha de Producto --- */
.product-card {
    background: var(--color-white);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--color-border);
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

/* --- Mini-Carrusel en la Ficha --- */
.card-carousel {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: var(--color-white);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.carousel-track img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    flex-shrink: 0;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #d1d1d1;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.carousel-dots .dot.active,
.carousel-dots .dot:hover {
    background-color: var(--color-primary);
    transform: scale(1.2);
}

/* --- Contenido de la Ficha --- */
.product-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.product-description {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.btn-details {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--color-primary);
    color: var(--color-white) !important;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 700;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-details:hover {
    background: var(--color-primary-dark);
    transform: scale(1.03);
}

.product-tag {
    position: absolute;
    top: 15px;
    right: 0;
    background: var(--color-primary-dark);
    color: var(--color-white);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
    text-transform: uppercase;
    box-shadow: -3px 3px 8px rgba(0,0,0,0.2);
}

/* --- Tabla Comparativa --- */
.comparison-container {
    margin-top: 4rem;
    padding: 0 1.5rem;
    text-align: center;
}
.comparison-container h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: 2.5rem;
    font-weight: 700;
}
.table-responsive-wrapper {
    overflow-x: auto;
    padding-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}
.comparison-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}
.comparison-table th, .comparison-table td {
    padding: 1.25rem 1rem;
    text-align: center;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.comparison-table th:last-child, .comparison-table td:last-child {
    border-right: none;
}
.comparison-table tr:last-child td {
    border-bottom: none;
}
.comparison-table thead {
    background-color: var(--color-text-dark);
    color: var(--color-white);
}
.comparison-table th {
    font-weight: 600;
}
.comparison-table tbody tr:nth-child(even) {
    background-color: var(--color-bg-light);
}
.comparison-table tbody tr:hover {
    background-color: #e9ecef;
}
.comparison-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--color-text-dark);
}

/* --- Sección Final de Llamada a la Acción (CTA) --- */
.final-cta-section {
    text-align: center;
    padding: 4rem 1.5rem;
}
.final-cta-section h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
}
.final-cta-section .btn-cta {
    margin-top: 1.5rem;
    background: var(--color-primary-dark);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: var(--border-radius-lg);
}

/* --- Responsividad --- */
@media (max-width: 768px) {
    .diagnostico-header h1 { font-size: var(--font-size-3xl); }
    .diagnostico-header p { font-size: var(--font-size-base); }
    .diagnostico-section h2 { font-size: var(--font-size-xl); }
}
@media (max-width: 480px) {
    .product-grid { grid-template-columns: 1fr; }
    .diagnostico-container { padding: 0; }
    .diagnostico-header { padding: 3rem 1rem; margin-bottom: 2rem; }
    .diagnostico-section { padding: 2rem 1rem; }
}