/* --- DISEÑO PREMIUM DETALLE DE PRODUCTO --- */

:root {
    --accent-color: #000;
    --text-muted: #666;
    --bg-light: #f8f9fa;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.8);
}

body {
    background-color: #fff;
    color: #1a1a1a;
}

/* Breadcrumbs Styling */
.breadcrumb-container-buscar {
    grid-column: 1 / span 3;
    padding: 10px 0 20px 5px;
    /* 5px left for alignment with thumbnails */
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb-container-buscar a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-container-buscar a:hover {
    color: var(--accent-color);
}

.breadcrumb-separator {
    margin: 0 10px;
    opacity: 0.5;
}

/* Main Layout */
.product-detail-wrapper-buscar {
    max-width: 80%;
    width: 95%;
    margin: 110px auto 0;
    /* Separación fija para librar el header */
    padding: 0 20px 80px;
}

/* Contenedor principal de detalle */
.product-detail-container-buscar {
    display: grid;
    grid-template-columns: 100px 1.2fr 0.8fr;
    gap: 40px;
    align-items: start;
    overflow: visible !important;
    /* Crítico para que funcione sticky */
}

/* Sticky sections for images and column */
.product-image-column-buscar {
    grid-column: 1 / span 2;
    /* Abarca las columnas de miniaturas e imagen principal */
    position: -webkit-sticky;
    position: sticky;
    top: 110px;
    align-self: start;
    height: fit-content;
    z-index: 10;
}

.thumbnail-gallery-buscar,
.main-image-container-buscar {
    position: -webkit-sticky;
    position: sticky;
    top: 110px;
    z-index: 10;
    align-self: start;
}

/* Desactivar sticky en móviles */
@media (max-width: 1024px) {

    .product-image-column-buscar,
    .thumbnail-gallery-buscar,
    .main-image-container-buscar {
        position: relative !important;
        top: 0 !important;
    }
}

.main-image-container-buscar {
    background: var(--bg-light);
    border-radius: 8px !important;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1/1;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.main-image-container-buscar img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.4s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* --- ZOOM STYLES --- */
.zoom-lens {
    position: absolute;
    width: 150px;
    height: 150px;
    border: 1px solid #d4d4d4;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: crosshair;
    display: none;
    z-index: 10;
    pointer-events: none;
    /* No intefiere con el mousemove del contenedor */
}

.zoom-result {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-repeat: no-repeat;
    display: none;
    z-index: 20;
    background-color: #fff;
    pointer-events: none;
    border-radius: inherit;
}

/* --- ICONO DE EXPANSIÓN (LUPITA) --- */
.open-gallery-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.open-gallery-btn i {
    font-size: 1.2rem;
    color: #000;
}

.open-gallery-btn:hover {
    background: #000;
    transform: scale(1.1);
}

.open-gallery-btn:hover i {
    color: #fff;
}

/* --- ICONO DE EXPANSIÓN (LUPITA) --- */
.open-gallery-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 30;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.open-gallery-btn i {
    font-size: 1.2rem;
    color: #000;
}

.open-gallery-btn:hover {
    background: #000;
    transform: scale(1.1);
}

.open-gallery-btn:hover i {
    color: #fff;
}

/* Reducción de lente para mayor precisión en el zoom interno */
.zoom-lens {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 1px solid #d4d4d4;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: crosshair;
    display: none;
    z-index: 10;
    pointer-events: none;
}

.thumbnail-gallery-buscar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100px;
    flex-shrink: 0;
    padding: 5px;
    /* Evita que las sombras se corten */
    box-sizing: border-box;
}

.product-thumbnail-buscar {
    width: 100%;
    aspect-ratio: 1/1;
    height: auto;
    border-radius: 8px !important;
    object-fit: contain;
    background: var(--bg-light);
    padding: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-thumbnail-buscar:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-thumbnail-buscar.active-thumb-buscar {
    border-color: var(--accent-color);
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Info Column */
.product-info-column-buscar {
    padding-top: 20px;
}

.product-sku {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 10px;
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: "Montserrat", sans-serif !important;
}

.product-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1.1;
    margin-bottom: 30px;
    color: #000;
    word-break: break-word;
    overflow-wrap: break-word;
}

.btn-export-pdf-buscar {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 14px 28px;
    border-radius: 8px;
    /* Diseño más industrial/profesional */
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    margin-top: 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-export-pdf-buscar:hover {
    background: transparent;
    color: #000;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.btn-export-pdf-buscar i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-export-pdf-buscar:hover i {
    transform: scale(1.1);
}

/* Specifications */
.specs-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.unparsed-list-buscar {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    /* Seguridad extra */
}

.unparsed-list-buscar li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-word;
    /* Para URLs o palabras largas */
    overflow-wrap: break-word;
}

.unparsed-list-buscar li:last-child {
    border-bottom: none;
}

/* Video Section */
.video-section-buscar {
    margin-top: 80px;
    border-top: 1px solid #eee;
    padding-top: 60px;
}

.video-title-buscar {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
}

#videoListContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.video-container-buscar {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.video-container-buscar iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Responsive */
@media (max-width: 1024px) {
    .product-detail-container-buscar {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .breadcrumb-container-buscar {
        grid-column: 1;
        order: 0;
        padding: 15px 0 25px 0;
        /* Mayor separación en tablets */
    }

    .thumbnail-gallery-buscar,
    .main-image-container-buscar {
        position: relative;
        top: 0;
    }

    .thumbnail-gallery-buscar {
        order: 2;
        flex-direction: row;
        width: 100%;
        justify-content: center;
        margin-top: 20px;
    }

    .product-thumbnail-buscar {
        width: 80px;
    }

    .main-image-container-buscar {
        order: 1;
    }

    .product-info-column-buscar {
        order: 3;
    }

    #videoListContainer {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .product-detail-wrapper-buscar {
        margin-top: 90px;
        width: 100%;
        max-width: 90%;
        padding: 45px 0;
    }

    .breadcrumb-container-buscar {
        padding: 20px 0 30px 0;
        /* Aún más separación en móviles */
    }

    .product-sku {
        font-size: 1.2rem;
    }

    .product-title {
        font-size: 1.3rem !important;
    }

    .main-image-container-buscar {
        padding: 20px;
    }

    .zoom-result {
        width: 160px;
        /* Tamaño de la lupa circular */
        height: 160px;
        position: absolute;
        border-radius: 50% !important;
        border: 2px solid #fff;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        z-index: 2000;
        pointer-events: none;
        display: none;
        background-color: #fff;
        /* El 'left' y 'top' se manejarán dinámicamente en JS */
    }

    .zoom-lens {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 10;
    }
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.lightbox-modal.show {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.close-lightbox {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: 0.3s;
    z-index: 100001;
}

.close-lightbox:hover {
    color: #ccc;
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 110%;
    left: -5%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
}

.nav-btn {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Responsive adjust */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 100%;
        left: 0;
        top: auto;
        bottom: -80px;
        justify-content: center;
        gap: 40px;
        transform: none;
    }

    .close-lightbox {
        right: 20px;
        top: 20px;
    }
}

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

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

.product-info-column-buscar>* {
    animation: fadeIn 0.6s ease forwards;
}