/* ========================================================== */
/* == 🎨 ESTILOS PARA PÁGINA DE PRODUCTO COMPARTIDO (SIN BORDES) 🎨 == */
/* ========================================================== */

/* --- CONTENEDOR PRINCIPAL (SIN BORDES) --- */
.producto-compartido-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.producto-compartido-header {
    background-color: transparent; /* ✅ Sin fondo */
    border: none; /* ✅ Sin borde */
    border-radius: 0; /* ✅ Sin border-radius */
    overflow: visible; /* ✅ Sin ocultar contenido */
    box-shadow: none; /* ✅ Sin sombra */
}

/* --- HEADER CON BREADCRUMB Y BOTÓN COMPARTIR (SIN BORDES) --- */
.compartido-navigation-header {
    padding: 1rem 0; /* ✅ Elimina padding horizontal */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none; /* ✅ Sin borde inferior */
    gap: 1rem;
}

.compartido-navigation-header nav {
    flex: 1;
    min-width: 0;
}

.compartido-navigation-header .breadcrumb {
    margin-bottom: 0;
    padding-left: 0;
    background-color: transparent;
    flex-wrap: wrap;
}

.compartido-navigation-header .breadcrumb-item {
    font-size: 0.9rem;
}

.compartido-navigation-header .breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.compartido-navigation-header .breadcrumb-item a:hover {
    text-decoration: underline;
}

.compartido-navigation-header .breadcrumb-item.active {
    color: var(--color-texto-secundario);
}

/* Botón compartir en header */
.compartido-navigation-header .btn-share {
    background-color: #e6f7ed;
    color: #28a745;
    border: none;
    border-radius: 20px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compartido-navigation-header .btn-share:hover {
    background-color: #d4f4dd;
    transform: translateY(-1px);
}

.compartido-navigation-header .btn-share i {
    font-size: 0.9rem;
}

/* --- CUERPO DEL PRODUCTO (SIN PADDING EXTRA) --- */
.compartido-body {
    padding: 0; /* ✅ Sin padding */
}

/* --- GALERÍA DE IMÁGENES (COMO EL MODAL) --- */
.producto-compartido-container .image-gallery-wrapper {
    background-color: var(--color-sutil);
    padding: 2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    height: 500px;
    position: relative;
    overflow: hidden;
}

.producto-compartido-container .modal-thumbnails-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-shrink: 0;
    padding-top: 0.5rem;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 8px;
    position: relative;
    z-index: 2;
}

.producto-compartido-container .modal-thumbnails-vertical img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid var(--color-borde-claro);
    border-radius: 8px;
    cursor: pointer;
    background-color: var(--color-tarjeta-fondo);
    transition: transform 0.2s ease-in-out;
}

.producto-compartido-container .modal-thumbnails-vertical img:hover {
    border-color: var(--color-borde);
    transform: scale(1.08);
}

.producto-compartido-container .modal-thumbnails-vertical img.active {
    border-color: var(--color-borde);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.producto-compartido-container .main-image-container-modal {
    position: relative;
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: var(--color-tarjeta-fondo);
    border-radius: 8px;
}

.producto-compartido-container #mainImage {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease, object-fit 0.1s step-end;
    transform-origin: center center;
}

.producto-compartido-container .main-image-container-modal.zoomed #mainImage {
    transform: scale(4);
}

.producto-compartido-container .image-gallery-wrapper.gallery-zoomed .main-image-container-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Scrollbar de thumbnails */
.producto-compartido-container .modal-thumbnails-vertical::-webkit-scrollbar {
    width: 6px;
}

.producto-compartido-container .modal-thumbnails-vertical::-webkit-scrollbar-track {
    background: transparent;
}

.producto-compartido-container .modal-thumbnails-vertical::-webkit-scrollbar-thumb {
    background-color: var(--color-borde);
    border-radius: 10px;
}

/* --- DIRECCIÓN DE ORIGEN CLICKEABLE --- */
#modalProductOriginLink {
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#modalProductOriginLink:hover {
    background-color: rgba(13, 110, 253, 0.1);
    transform: translateX(3px);
}

#modalProductOriginLink:hover .fa-map-marker-alt {
    animation: bounce 0.6s ease-in-out infinite;
    color: #0d6efd;
}

#modalProductOriginLink:hover .fa-external-link-alt {
    opacity: 1 !important;
    transform: translateX(2px);
}

#modalProductOriginLink:active {
    transform: translateX(1px);
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ========================================================== */
/* == 💰 ESTILOS PARA PRECIOS REFERENCIALES EN PÁGINA COMPARTIDA 💰 == */
/* ========================================================== */

/* --- CONTENEDOR DE PRECIOS REFERENCIALES --- */
.precios-referenciales-container-compartido {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    min-height: 85px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.precios-referenciales-container-compartido h6 {
    margin-bottom: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
}

.precios-ref-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 1rem;
}

.precio-ref-item-compartido {
    text-align: center;
    flex: 1;
    padding: 0.5rem;
    border-right: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.precio-ref-item-compartido:last-child {
    border-right: none;
}

.precio-ref-item-compartido:hover {
    transform: translateY(-2px);
}

.precio-ref-item-compartido .precio-valor {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #007bff;
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.precio-ref-item-compartido .precio-cantidad {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.2;
}

/* --- PLACEHOLDER PARA "PRECIO A CONSULTAR" --- */
.precio-consultar-placeholder {
    background-color: #e7f3ff;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #b3d9ff;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- PRODUCTOS RELACIONADOS (VISIBLES Y FUNCIONALES) --- */
.producto-compartido-container .related-products {
    margin-top: 3rem;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

.producto-compartido-container .related-products h4 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--color-texto);
}

.producto-compartido-container .related-products * {
    visibility: visible !important;
}

.producto-compartido-container .related-products-carousel-outer-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.producto-compartido-container .related-products-carousel-container {
    display: block !important;
    visibility: visible !important;
    position: relative;
}

.producto-compartido-container .carousel-track-wrapper {
    display: block !important;
    visibility: visible !important;
    overflow: hidden;
}

.producto-compartido-container .carousel-track {
    display: flex !important;
    visibility: visible !important;
    flex-wrap: nowrap;
    gap: 1rem;
    transition: transform 0.4s ease-in-out;
}

.producto-compartido-container .carousel-track > .col {
    flex: 0 0 calc(20% - 0.8rem);
    width: calc(20% - 0.8rem);
    padding: 0;
    display: block !important;
    visibility: visible !important;
}

.producto-compartido-container .carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    display: flex !important;
    visibility: visible !important;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.producto-compartido-container .carousel-control.prev {
    left: -20px;
}

.producto-compartido-container .carousel-control.next {
    right: -20px;
}

.producto-compartido-container .carousel-control:hover {
    background-color: #e9ecef;
}

.producto-compartido-container .carousel-control:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ✅ GRID DE CERTIFICACIONES CORREGIDO (IMÁGENES PEQUEÑAS) */
.certificaciones-grid-compartido {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.certificacion-item-compartido {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.certificacion-item-compartido .cert-img-link {
    display: block;
    width: 80px;
    height: 80px;
    margin-bottom: 0.5rem;
}

.certificacion-item-compartido .cert-img-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: 1px solid var(--color-borde-claro);
    border-radius: 4px;
    background-color: var(--color-tarjeta-fondo);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.certificacion-item-compartido .cert-img-link:hover img {
    transform: scale(1.05);
    box-shadow: 0 2px 8px var(--color-sombra);
}

.certificacion-item-compartido .cert-titulo-link {
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    color: var(--color-texto-secundario);
    word-wrap: break-word;
}

.certificacion-item-compartido .cert-titulo-link:hover {
    color: var(--color-texto);
}

/* --- RESPONSIVE --- */
@media (max-width: 991.98px) {
    .compartido-body {
        padding: 0; /* ✅ Sin padding en tablet */
    }
    
    .producto-compartido-container .image-gallery-wrapper {
        height: 400px;
    }
    
    .precios-referenciales-container-compartido {
        padding: 0.75rem;
        min-height: 75px;
    }
    
    .precios-ref-grid {
        gap: 0.75rem;
    }
    
    .precio-ref-item-compartido {
        padding: 0.4rem;
    }
    
    .precio-ref-item-compartido .precio-valor {
        font-size: 1.05rem;
    }
    
    .precio-ref-item-compartido .precio-cantidad {
        font-size: 0.75rem;
    }
    
    .certificaciones-grid-compartido {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 1rem;
    }
    
    .certificacion-item-compartido .cert-img-link {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 767.98px) {
    .producto-compartido-container {
        margin: 1rem auto;
    }
    
    .compartido-navigation-header {
        padding: 0.75rem 0; /* ✅ Sin padding horizontal */
    }
    
    .compartido-body {
        padding: 0; /* ✅ Sin padding en móvil */
    }
    
    .producto-compartido-container .image-gallery-wrapper {
        height: 350px;
        padding: 1rem;
    }
    
    .producto-compartido-container .modal-thumbnails-vertical img {
        width: 55px;
        height: 55px;
    }
    
    .product-info-column {
        padding: 1.5rem;
    }
    
    .producto-compartido-container h2 {
        font-size: 1.15rem;
    }
    
    #modalProductOriginLink {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
    }
    
    #modalProductOriginLink .fa-map-marker-alt {
        font-size: 1rem;
    }
    
    #modalProductOriginLink .fa-external-link-alt {
        font-size: 0.7rem;
    }
    
    .precios-referenciales-container-compartido {
        padding: 0.6rem;
        min-height: 68px;
    }
    
    .precios-referenciales-container-compartido h6 {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .precios-ref-grid {
        gap: 0.5rem;
    }
    
    .precio-ref-item-compartido {
        padding: 0.35rem;
    }
    
    .precio-ref-item-compartido .precio-valor {
        font-size: 0.95rem;
    }
    
    .precio-ref-item-compartido .precio-cantidad {
        font-size: 0.68rem;
    }
    
    .certificaciones-grid-compartido {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .certificacion-item-compartido .cert-img-link {
        width: 60px;
        height: 60px;
    }
    
    .certificacion-item-compartido .cert-titulo-link {
        font-size: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .compartido-navigation-header .breadcrumb {
        font-size: 0.8rem;
    }
    
    .compartido-navigation-header .btn-share .share-text {
        display: none;
    }
    
    .compartido-navigation-header .btn-share {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    
    .precios-referenciales-container-compartido {
        min-height: 60px;
        padding: 0.5rem;
    }
    
    .precios-referenciales-container-compartido h6 {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
    
    .precios-ref-grid {
        gap: 0.4rem;
    }
    
    .precio-ref-item-compartido {
        padding: 0.25rem;
    }
    
    .precio-ref-item-compartido .precio-valor {
        font-size: 0.85rem;
    }
    
    .precio-ref-item-compartido .precio-cantidad {
        font-size: 0.62rem;
    }
    
    .precio-consultar-placeholder {
        min-height: 50px;
        padding: 0.75rem;
    }
    
    .producto-compartido-container .related-products-carousel-outer-wrapper {
        padding: 1rem 0;
    }
    
    .producto-compartido-container .carousel-track > .col {
        flex: 0 0 calc(45%); 
        width: calc(45%);
    }
    
    .producto-compartido-container .carousel-control {
        width: 35px;
        height: 35px;
    }
    
    .producto-compartido-container .carousel-control.prev { 
        left: 5px; 
    }
    
    .producto-compartido-container .carousel-control.next { 
        right: 5px; 
    }
}

@media (max-width: 400px) {
    .precios-referenciales-container-compartido {
        min-height: 56px;
    }
    
    .precio-ref-item-compartido .precio-valor {
        font-size: 0.78rem;
    }
    
    .precio-ref-item-compartido .precio-cantidad {
        font-size: 0.58rem;
    }
}

@media (max-width: 360px) {
    .precios-referenciales-container-compartido {
        min-height: 52px;
    }
    
    .precio-ref-item-compartido .precio-valor {
        font-size: 0.72rem;
    }
    
    .precio-ref-item-compartido .precio-cantidad {
        font-size: 0.55rem;
    }
}