﻿/* Reset básico y estilos generales de la página */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Línea roja divisoria */
.linea-roja {
    background-color: #e74c3c; /* Rojo vibrante */
    height: 5px;
    width: 100%;
}

/* Breadcrumb */
.breadcrumb-container {
    padding: 15px 20px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
    border-radius: 0 0 8px 8px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    padding: 0;
    margin: 0;
    font-size: 0.95em;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '\203A';
    margin: 0 8px;
    color: #999;
    font-weight: bold;
}

.breadcrumb li a {
    text-decoration: none;
    color: #555;
    transition: color 0.3s ease;
}

.breadcrumb li a:hover {
    color: #e74c3c;
}

.breadcrumb li:last-child {
    color: #2c3e50;
    font-weight: 600;
}

/* Main Product Detail Section */
.product-detail-main {
    padding: 40px 0;
}

.product-header {
    text-align: center;
    margin-bottom: 40px;
}

.product-title {
    font-size: 3em;
    color: #2c3e50;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
}

.product-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: #e74c3c; /* Rojo vibrante */
    margin: 10px auto 0;
    border-radius: 2px;
}

.product-description {
    font-size: 1.1em;
    color: #555;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Nuevo contenedor para la sección superior: imagen y detalles */
.product-info-top {
    display: flex;
    flex-wrap: wrap; /* Permite que se apile en pantallas pequeñas */
    gap: 30px;
    margin-bottom: 50px; /* Espacio antes de la tabla */
    align-items: flex-start; /* Alinea los elementos al inicio (arriba) */
}

.image-gallery {
    flex: 0 0 400px; /* No crece, no se encoge, ancho base 400px */
    max-width: 100%; /* Asegura que no se desborde en móviles */
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05); /* Sombra más ligera */
    overflow: hidden;
    position: relative;
    display: flex; /* Para centrar la imagen dentro si es más pequeña */
    align-items: center;
    justify-content: center;
    min-height: 300px; /* Altura mínima para la galería */
    padding: 10px; /* Espacio interior para que la imagen no toque los bordes */
}

.carousel {
    position: relative;
    width: 100%;
    margin: auto;
    overflow: hidden;
    border-radius: 8px; /* Un poco menos de redondeo que el contenedor */
}

.carousel-images {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-image {
    width: 100%;
    height: auto;
    display: none;
    object-fit: contain; /* Usar 'contain' para que la imagen se vea completa dentro de su contenedor */
    border-radius: 8px;
}

.carousel-image.active {
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5em;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active, .dot:hover {
    background-color: #e74c3c; /* Rojo vibrante */
}

/* Nuevo contenedor para los detalles de la derecha */
.product-details-content {
    flex: 1; /* Ocupa el espacio restante */
    min-width: 300px; /* Ancho mínimo para que no se colapse */
    display: flex;
    flex-direction: column;
    gap: 20px; /* Espacio entre los bloques de contenido (dimension-selector y product-actions si estuvieran aquí) */
}

.content-block {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.05); /* Sombra más ligera para consistencia */
    padding: 30px;
}

.content-block h2 {
    color: #2c3e50;
    font-size: 2em;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.content-block h2::after,
.content-block h3::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: #e74c3c;
    margin-top: 10px;
    border-radius: 2px;
}

.content-block h3 {
    color: #2c3e50;
    font-size: 1.7em;
    margin-top: 0;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.product-data p {
    font-size: 1.05em;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.7;
}

/* Dimension Selector for Vigas */
.dimension-selector {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 0; /* No margin-bottom ya que el gap del padre lo controla si estaba dentro del flex */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.selector-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.selector-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.selector-group select:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
    outline: none;
}

.selector-group select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

.result-display {
    padding: 15px;
    background-color: #eef7f4;
    border: 1px solid #d4edda;
    border-left: 5px solid #27ae60;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 1.1em;
    color: #225c3d;
    font-weight: 500;
}

.result-display strong {
    color: #1a422a;
}

/* Product Actions - Ahora es una sección de ancho completo */
.product-actions {
    margin-top: 50px; /* Espacio después de la tabla */
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    padding: 30px; /* Asegura el mismo padding que otros content-block */
    /* Ya tiene content-block, así que heredará su estilo de caja */
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    font-size: 1.1em;
    font-weight: bold;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.btn-primary {
    background-color: #27ae60;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

.btn-primary:hover {
    background-color: #229a56;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(39, 174, 96, 0.4);
}

.btn-secondary {
    background-color: #3498db;
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-secondary:hover {
    background-color: #2184c6;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

.btn-secondary i {
    margin-right: 8px;
}

/* Table Section - Now full width */
.product-table {
    margin-top: 50px; /* Espacio considerable antes de la tabla */
    margin-bottom: 50px; /* Espacio después de la tabla y antes de los botones */
    padding-bottom: 0; /* Ya no es necesario si el margin-bottom controla el espacio */
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    margin-bottom: 20px; /* Reducir margen inferior */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Sombra más ligera */
}

table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed; /* Ayuda a que los anchos de columna se mantengan */
    min-width: 500px; /* Mínimo para asegurar el scroll si es necesario */
}

table thead {
    background-color: #2c3e50;
    color: #ffffff;
}

table th,
table td {
    padding: 8px 6px; /* Reducir padding aún más */
    text-align: center; /* Centrar texto para los encabezados verticales */
    border: 1px solid #e0e0e0; /* Bordes más finos */
    font-size: 0.85em; /* Tamaño de fuente por defecto para celdas */
    line-height: 1.2; /* Ajustar line-height para encabezados de dos líneas */
}

table th {
    font-weight: 600;
    font-size: 0.8em; /* Encabezado más pequeño */
    letter-spacing: 0.2px;
    text-transform: uppercase;
    vertical-align: middle; /* Centrar verticalmente el texto del encabezado */
    white-space: normal; /* Permitir que el texto del encabezado se divida en varias líneas */
    word-break: break-word; /* Para asegurar que palabras largas se rompan si es necesario */
}

/* Ajustes de ancho para las columnas de la tabla */
table th:nth-child(1) { width: 18%; } /* Canto */
table th:nth-child(2) { width: 18%; } /* Ancho */
table th:nth-child(3) { width: 25%; } /* Espesor Alma */
table th:nth-child(4) { width: 23%; } /* Espesor Ala */
table th:nth-child(5) { width: 16%; } /* Peso */

table tbody tr:nth-child(even) {
    background-color: #f6f6f6;
}

table tbody tr:hover {
    background-color: #eef7f4;
    transition: background-color 0.2s ease;
}

table td {
    color: #444;
}


/* Related Products Section */
.related-products {
    text-align: center;
    margin-top: 50px; /* Espacio después de la sección de botones */
}

.related-products h2 {
    font-size: 2.2em;
    color: #2c3e50;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.related-products h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: #e74c3c;
    margin: 10px auto 0;
    border-radius: 2px;
}

.product-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    justify-content: center;
    padding: 0 20px;
}

.product-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.product-card h3 {
    font-size: 1.5em;
    color: #2c3e50;
    margin: 15px 15px 10px;
    flex-grow: 1;
}

.product-card p {
    font-size: 1em;
    color: #666;
    padding: 0 15px 15px;
}

.btn-product-card {
    background-color: #e74c3c;
    color: #ffffff;
    border: none;
    box-shadow: 0 3px 6px rgba(231, 76, 60, 0.3);
    margin: 0 15px 20px;
    padding: 10px 20px;
    font-size: 1em;
}

.btn-product-card:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(231, 76, 60, 0.4);
}

/* Footer (reutilizado) */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0;
    text-align: center;
    font-size: 0.9em;
    margin-top: 50px;
}

footer .container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

footer p {
    margin: 0;
}

footer .social-links a {
    color: #ecf0f1;
    font-size: 1.5em;
    margin: 0 10px;
    transition: color 0.3s ease;
}

footer .social-links a:hover {
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .product-info-top {
        flex-direction: column;
        align-items: center;
    }

    .image-gallery {
        flex: 0 0 auto;
        width: 100%;
        max-width: 500px;
        min-height: 250px;
    }

    .carousel-image {
        object-fit: contain;
    }

    .product-details-content {
        flex: 1;
        width: 100%;
        max-width: 500px;
    }

    .product-title {
        font-size: 2.5em;
    }

    .content-block {
        padding: 25px;
    }
}

@media (max-width: 768px) {
    .product-title {
        font-size: 2em;
    }

    .product-description {
        font-size: 1em;
    }

    .content-block h2 {
        font-size: 1.8em;
    }

    .content-block h3 {
        font-size: 1.5em;
    }

    .product-data p {
        font-size: 0.95em;
    }

    .product-actions .btn {
        padding: 10px 20px;
        font-size: 1em;
        max-width: 280px;
    }

    .carousel-btn {
        padding: 8px 12px;
        font-size: 1.2em;
    }

    .dot {
        width: 10px;
        height: 10px;
    }

    .related-products .product-cards-container {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .product-card {
        max-width: 300px;
        margin: 0 auto;
    }

    /* Table adjustments for smaller screens */
    .product-table .content-block {
        padding: 20px;
    }
    .table-container {
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
        border-radius: 0;
        box-shadow: none;
    }

    table {
        min-width: 450px;
    }

    table th,
    table td {
        font-size: 0.78em;
        padding: 6px 5px;
    }
    table th {
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 1.7em;
    }

    .content-block h2 {
        font-size: 1.5em;
    }

    .content-block h3 {
        font-size: 1.3em;
    }

    .dimension-selector {
        padding: 15px;
    }

    .selector-group label {
        font-size: 0.9em;
    }

    .selector-group select {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .result-display {
        font-size: 1em;
        padding: 12px;
    }

    table {
        min-width: 380px;
    }
    table th,
    table td {
        font-size: 0.7em;
        padding: 5px 4px;
    }
    table th {
        font-size: 0.65em;
    }
}
/* Product Actions - Ahora es una sección de ancho completo */
.product-actions-full-width {
    margin-top: 50px; /* Espacio después de la tabla */
    /* Asegúrate de que esta sección herede o tenga el estilo de content-block si lo necesita */
}

/* 🎯 CLASE A MODIFICAR PARA CENTRAR LOS BOTONES */
.product-actions-buttons {
    display: flex; /* Habilitar flexbox */
    justify-content: center; /* Centrar los elementos horizontalmente */
    gap: 20px; /* Espacio entre los botones */
    margin-top: 20px; /* Añadir algo de espacio superior si es necesario */
    flex-wrap: wrap; /* Permitir que los botones salten de línea en pantallas pequeñas */
}

.product-actions-full-width h2 {
    text-align: center; /* Centrar el título de la sección */
}

/* Estilos de botones (asegúrate de que los estilos 'btn' no impidan el centrado) */
.btn {
    /* ... otros estilos ... */
    max-width: 300px; /* Mantener un ancho máximo para que no se extiendan demasiado */
    width: 100%; /* Asegurar que el ancho máximo funcione correctamente */
}

/* Modificación para la media query 768px */
@media (max-width: 768px) {
    /* Si los botones se apilan, también deben estar centrados.
       La configuración de .product-actions-buttons anterior ya hace esto,
       pero si tuvieras una regla específica que lo impidiera, la corregirías aquí. */
    .product-actions-buttons {
        flex-direction: column; /* Apilar botones */
        align-items: center; /* Centrar los botones apilados */
    }

    .product-actions .btn, .product-actions-buttons .btn {
        max-width: 280px; /* Mantener un ancho razonable para el apilamiento */
    }
}