.gallery-column {
    min-height: 20rem;
}

@media (min-width: 768px) {
    .product-area-row {
        min-height: 30rem;
    }

    .gallery-column {
        height: 30rem;
    }
}

#gallery {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.gallery-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    z-index: 1;
    visibility: hidden;
    transform: scale(1.02);
    transition: opacity 420ms ease, transform 420ms ease, visibility 420ms;
    pointer-events: none;
    will-change: opacity, transform;
}

.gallery-item.active {
    opacity: 1;
    z-index: 10;
    visibility: visible;
    transform: scale(1);
    pointer-events: auto;
}

.gallery-item.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.imageprod,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 100%;
}

.gallery-item .video-js {
    margin: 0 auto;       /* Centrado horizontal */
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

.vjs-tech {
    object-fit: contain;
}

.overlay-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 40;
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background .15s ease, opacity .15s ease;
    z-index: 45;
}

.nav-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

.nav-button:disabled {
    opacity: 0.35;
    cursor: default;
}

.prev-button {
    left: 12px;
}

.next-button {
    right: 12px;
}

.thumbs-row {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 46;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    pointer-events: auto;
    max-width: calc(100% - 32px);
}

.thumb {
    width: 76px;
    height: 56px;
    flex: 0 0 auto;
    border-radius: 6px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eee;
    cursor: pointer;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.thumb img,
.thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb.active {
    border-color: #0d6efd;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.18);
}

@media (max-width: 576px) {
    .thumb {
        width: 62px;
        height: 46px;
    }

    .nav-button {
        padding: 0.35rem 0.65rem;
        font-size: 0.95rem;
    }
}

.gallery-column {
    position: relative;
}

.btn-delete-item {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-delete-item:hover { transform: scale(1.1); background: #dc3545; }

#drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 110, 253, 0.7);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    border: 4px dashed #fff;
    border-radius: 0.5rem;
}

.add-thumb {
    background: #f0f2f5;
    border: 2px dashed #0d6efd !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.gallery-item .video-js {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
}

#gallery.is-video-active .thumbs-row {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#gallery.is-video-active .nav-button {
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

#gallery.is-video-active:hover .nav-button {
    opacity: 0.3 !important; 
    visibility: visible !important;
    pointer-events: auto !important;
}

.video-js {
    z-index: 1 !important;
}