/* Estilos específicos de producto.html */

.hero-product {
    background-image: url('https://images.unsplash.com/photo-1503387762-592deb58ef4e?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80');
    padding-top: 80px;
    padding-bottom: 80px;
}

.hero-title {
    font-size: 2.5rem; /* Ajusta este valor si tu H2 global era más grande o pequeño */
    font-weight: 700;
    color: #ffffff; /* Asumiendo que el texto sobre la imagen de fondo es blanco */
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.product-title {
    color: var(--secondary);
    margin-bottom: 24px;
}

.img-fluid {
    max-width: 100%;
    height: auto;
}

.rounded {
    border-radius: var(--radius-DEFAULT);
}

.btn-quote-large {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 30px;
    padding: 16px;
}

.icon-wsp {
    width: 38px;
    height: 38px;
}

.breadcrumb {
    color: #fff;
    margin-top: 16px;
    font-size: 16px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.breadcrumb a {
    color: var(--primary);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.product-detail-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

.product-info {
    flex: 1.5;
}

.product-visuals {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 100px;
}

.product-image {
    width: 100%;
    border-radius: var(--radius-lg);
    border: 1px solid var(--light-grey);
    background-color: var(--surface-container-lowest);
    padding: 16px;
}

/* Hybrid Tabs/Accordion styles */
.specs-wrapper {
    margin-top: 48px;
}

/* Tabs Header (Desktop) */
.tabs-header {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--light-grey);
    margin-bottom: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    color: var(--on-surface-variant);
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

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

/* Container and Items */
.specs-container {
    border: 1px solid var(--light-grey);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background-color: var(--surface-container-lowest);
    overflow: hidden;
}

/* Accordion Header (Hidden on Desktop) */
.accordion-header {
    display: none;
    /* Oculto en escritorio */
    width: 100%;
    padding: 16px 24px;
    background: none;
    border: none;
    justify-content: space-between;
    align-items: center;
    color: var(--secondary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
}

.accordion-header::after {
    content: '+';
    font-size: 24px;
    color: var(--primary);
}

/* Content Panel */
.spec-content {
    display: none;
    /* Oculto por defecto en escritorio */
    padding: 32px;
    animation: fadeIn 0.5s ease;
}

.spec-item.active .spec-content {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 992px) {
    .product-detail-layout {
        flex-direction: column-reverse;
        gap: 32px;
    }

    .product-visuals {
        position: static;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-product {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .hero-content .hero-title {
        font-size: 4.2rem;
        margin-bottom: 0px;
    }

    .breadcrumb {
        font-size: 1.2rem;
    }

    .product-title {
        font-size: 28px;
        margin-bottom: 16px;
    }

    /* Hybrid Switch to Accordion */
    .tabs-header {
        display: none;
    }

    .specs-wrapper {
        margin-top: 32px;
    }

    .specs-container {
        border-top: 1px solid var(--light-grey);
        border-radius: var(--radius-lg);
    }

    .spec-item {
        border-bottom: 1px solid var(--light-grey);
    }

    .spec-item:last-child {
        border-bottom: none;
    }

    .accordion-header {
        display: flex;
        font-size: 16px;
    }

    .spec-content {
        max-height: 0;
        padding: 0 24px;
        overflow: hidden;
        transition: all 0.4s ease;
        display: block !important;
        animation: none;
    }

    .spec-item.active .spec-content {
        max-height: 2000px;
        padding: 24px;
        border-top: 1px solid var(--light-grey);
    }

    .spec-item.active .accordion-header {
        color: var(--primary);
        background-color: var(--surface-container-low);
    }

    .spec-item.active .accordion-header::after {
        content: '−';
    }

    .btn-quote-large {
        font-size: 20px;
        padding: 12px;
    }

    .icon-wsp {
        width: 28px;
        height: 28px;
    }

    /* Fix for tables on mobile */
    .spec-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 24px;
    }

    .accordion-header {
        font-size: 15px;
    }

    .btn-quote-large {
        font-size: 18px;
    }
}

/* --- Estilos de Zoom e Imagen --- */
.spec-content img {
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.spec-content img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Modal (background) */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

/* Modal Content (Image) */
.modal-content {
    margin: auto;
    display: block;
    width: auto;
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius-lg);
    animation-name: zoom;
    animation-duration: 0.4s;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

@keyframes zoom {
    from {transform:scale(0.7); opacity: 0;} 
    to {transform:scale(1); opacity: 1;}
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 60px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--primary);
    text-decoration: none;
}

/* Caption */
#modal-caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 20px 0;
    font-size: 18px;
    font-weight: 500;
}

@media only screen and (max-width: 700px){
    .modal-content {
        width: 95%;
    }
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 50px;
    }
}

/* --- Productos Relacionados Carousel --- */
.related-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 5px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scroll-snap-type: x mandatory;
}

.related-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.carousel-nav {
    background: var(--surface-container-lowest);
    border: 1px solid var(--light-grey);
    color: var(--secondary);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.carousel-nav:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: scale(1.1);
}

.related-card {
    flex: 0 0 calc(25% - 18px);
    background: var(--surface-container-lowest);
    border: 1px solid var(--light-grey);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 250px;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.related-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
}

.related-card h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--secondary);
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.related-card .btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
}

@media (max-width: 1200px) {
    .related-card {
        flex: 0 0 calc(33.333% - 16px);
    }
}

@media (max-width: 768px) {
    .related-card {
        flex: 0 0 calc(50% - 12px);
    }
    .carousel-nav {
        display: none; /* En móvil mejor solo scroll táctil */
    }
}

@media (max-width: 480px) {
    .related-card {
        flex: 0 0 85%;
    }
}