/* ═══════════════════════════════════════════════════════════════════════════════
   ESTILOS CUSTOM - AUTOMOTOR
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────────
   GALERÍA DE VEHÍCULOS - Dropzone customizado
   ───────────────────────────────────────────────────────────────────────────────── */
#dropzoneVehiculo {
    min-height: 150px;
    border: 2px dashed #adb5bd;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

#dropzoneVehiculo:hover,
#dropzoneVehiculo.dz-drag-hover {
    border-color: #556ee6;
    background: #f0f3ff;
}

#dropzoneVehiculo .dz-message {
    text-align: center;
    padding: 30px 20px;
    margin: 0;
}

#dropzoneVehiculo .dz-message i {
    color: #adb5bd;
    transition: color 0.3s ease;
}

#dropzoneVehiculo:hover .dz-message i {
    color: #556ee6;
}

/* Preview de imágenes en Dropzone */
#dropzoneVehiculo .dz-preview {
    margin: 10px;
}

#dropzoneVehiculo .dz-preview .dz-image {
    border-radius: 8px;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   GALERÍA - Grid de imágenes (5 por fila)
   ───────────────────────────────────────────────────────────────────────────────── */
#galeriaVehiculo {
    min-height: 100px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.galeria-item {
    position: relative;
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex: 0 0 calc(20% - 10px);
    max-width: calc(20% - 10px);
}

.galeria-item:active {
    cursor: grabbing;
}

.galeria-item.sortable-ghost {
    opacity: 0.4;
}

.galeria-item.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.galeria-item-inner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.galeria-item-inner:hover {
    border-color: #556ee6;
}

.galeria-item-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.galeria-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.galeria-item-inner:hover .galeria-item-overlay {
    opacity: 1;
}

.galeria-item-overlay .btn {
    padding: 6px 10px;
    font-size: 14px;
}

/* Badge de imagen principal */
.galeria-item-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
}

.galeria-item-badge .badge {
    font-size: 11px;
    padding: 4px 8px;
}

/* Indicador de orden */
.galeria-item-orden {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 10;
}

/* Nombre de archivo */
.galeria-item-nombre {
    padding: 8px;
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    background: #fff;
}

/* Estado vacío */
.galeria-vacia {
    padding: 40px 20px;
    width: 100%;
    flex: 0 0 100%;
}

.galeria-vacia i {
    color: #dee2e6;
}

/* ─────────────────────────────────────────────────────────────────────────────────
   GALERÍA - Modal ver detalle (solo lectura)
   ───────────────────────────────────────────────────────────────────────────────── */
.galeria-ver-item {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

.galeria-ver-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.galeria-ver-item img:hover {
    transform: scale(1.03);
}

/* ─────────────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .galeria-item {
        flex: 0 0 calc(25% - 9px);
        max-width: calc(25% - 9px);
    }
}

@media (max-width: 768px) {
    .galeria-item {
        flex: 0 0 calc(33.333% - 8px);
        max-width: calc(33.333% - 8px);
    }
}

@media (max-width: 576px) {
    .galeria-item {
        flex: 0 0 calc(50% - 6px);
        max-width: calc(50% - 6px);
    }
    
    .galeria-item-img {
        height: 120px;
    }
    
    #dropzoneVehiculo .dz-message {
        padding: 20px 15px;
    }
    
    #dropzoneVehiculo .dz-message h5 {
        font-size: 14px;
    }
}

/* ─────────────────────────────────────────────────────────────────────────────────
   LIGHTBOX - SweetAlert2 para ver imágenes
   ───────────────────────────────────────────────────────────────────────────────── */
.swal-imagen-galeria {
    max-width: 90vw !important;
    max-height: 80vh !important;
    object-fit: contain;
    border-radius: 8px;
}

.swal2-popup.swal2-modal {
    max-width: 95vw;
}

.swal2-image {
    margin: 1rem auto !important;
}

/* Asegurar que SweetAlert2 aparezca sobre modales de Bootstrap */
.swal2-container {
    z-index: 99999 !important;
}

.swal2-popup {
    z-index: 100000 !important;
}

/* Backdrop de SweetAlert2 sobre Bootstrap modal */
.swal2-container.swal2-backdrop-show {
    background: rgba(0,0,0,0.4) !important;
}

/* Input de SweetAlert2 editable - forzar interactividad */
.swal2-input,
.swal2-textarea,
.swal2-select {
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}

/* Asegurar que el popup capture los eventos */
.swal2-popup * {
    pointer-events: auto;
}
