/* ================================================== */
/* CUSTOM-FIXES.CSS v1.0.4 - Completamente Corregido */
/* Versión unificada y compatible con shortcuts.js */
/* ================================================== */

/* 🎯 CURSORES UNIFICADOS - SIN CONFLICTOS */

/* Estado normal - Manito con dedo arriba */
.shortcut-item:not(.add-btn) {
    cursor: pointer !important;
}

/* Elementos arrastrables - Manito ABIERTA */
.shortcut-item[draggable="true"] {
    cursor: grab !important;
    cursor: -webkit-grab !important;
    cursor: -moz-grab !important;
}

/* Hover en elementos arrastrables - Mantener manito abierta */
.shortcut-item[draggable="true"]:hover {
    cursor: grab !important;
    cursor: -webkit-grab !important;
    cursor: -moz-grab !important;
}

/* Al hacer clic sostenido - Manito ABIERTA lista */
.shortcut-item.drag-ready {
    cursor: grab !important;
    cursor: -webkit-grab !important;
    cursor: -moz-grab !important;
}

/* Durante arrastre - Manito CERRADA agarrando */
.shortcut-item.dragging {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
    cursor: -moz-grabbing !important;
    opacity: 0.7 !important;
    transform: scale(0.95) !important;
}

/* Botón añadir - Pointer normal */
.shortcut-item.add-btn {
    cursor: pointer !important;
}

/* Tres puntos - Pointer normal */
.shortcut-options {
    cursor: pointer !important;
}

/* 🎯 CUANDO EL BODY TIENE CLASE DRAGGING (forzar cursor cerrado) */
body.dragging-active .shortcut-item[draggable="true"] {
    cursor: grabbing !important;
    cursor: -webkit-grabbing !important;
    cursor: -moz-grabbing !important;
}

/* 🎯 ANULAR CURSORES EN ELEMENTOS INTERNOS */
.shortcut-item[draggable="true"] * {
    cursor: inherit !important;
    pointer-events: none !important;
}

/* ================================================== */
/* ESTADOS VISUALES DRAG & DROP v1.0.1 */
/* ================================================== */

.shortcut-item.drag-over {
    border: 2px dashed #3366cc !important;
    background: rgba(51, 102, 204, 0.15) !important;
    transform: scale(1.05) !important;
    transition: all 0.2s ease !important;
}

.shortcuts-container.drag-over {
    background: rgba(51, 102, 204, 0.05) !important;
    border: 2px dashed rgba(51, 102, 204, 0.3) !important;
    border-radius: 12px !important;
}

.shortcut-item.add-btn.drag-over {
    border-color: #2ecc71 !important;
    background: rgba(46, 204, 113, 0.1) !important;
}

/* Indicador visual de que es arrastrable */
.shortcut-item[draggable="true"]::after {
    content: "⋯" !important;
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.7) !important;
    opacity: 0 !important;
    transition: opacity 0.3s !important;
    pointer-events: none !important;
}

.shortcut-item[draggable="true"]:hover::after {
    opacity: 1 !important;
}

/* Mejoras de rendimiento */
.shortcuts-container {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
}

.shortcut-item[draggable="true"] {
    -webkit-user-drag: element !important;
}

.shortcut-item.dragging {
    z-index: 1000 !important;
    position: relative !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3) !important;
}

.shortcut-item {
    transition: all 0.2s ease !important;
}

/* ================================================== */
/* ESTRUCTURA DE SHORTCUTS CORREGIDA v1.0.5 */
/* ================================================== */

.shortcut-item {
    position: relative !important;
    min-height: 80px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important; /* ✅ OCUPAR ANCHO COMPLETO */
    aspect-ratio: 1 / 1 !important; /* ✅ MANTENER PROPORCIÓN CUADRADA */
    max-width: 100% !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--border-radius) !important;
    padding: 10px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.shortcut-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    width: 100% !important;
    z-index: 1 !important;
    position: relative !important;
    padding: 5px !important;
}

.shortcut-icon {
    width: 35px !important;
    height: 35px !important;
    margin-bottom: 8px !important;
    border-radius: 6px !important;
    object-fit: cover !important;
    z-index: 1 !important;
    flex-shrink: 0 !important;
}

.shortcut-name {
    font-size: 0.75rem !important;
    word-break: break-word !important;
    max-width: 100% !important;
    color: var(--text-light) !important;
    text-align: center !important;
    line-height: 1.2 !important;
    z-index: 1 !important;
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

/* ================================================== */
/* TRES PUNTOS VERTICALES Y MENÚ CONTEXTUAL v1.0.6 */
/* ================================================== */

/* TRES PUNTOS VERTICALES - POSICIÓN CORRECTA */
.shortcut-options {
    position: absolute !important;
    top: 6px !important;
    right: 6px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 4px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    visibility: visible !important;
    transition: all 0.2s ease !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(10px) !important;
    font-size: 16px !important;
    font-weight: bold !important;
    color: white !important;
    z-index: 100 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 1px !important;
    line-height: 1 !important;
}

/* Puntos verticales */
.shortcut-options::before {
    content: "⋯" !important;
    display: block !important;
    transform: rotate(90deg) !important;
    letter-spacing: 2px !important;
    line-height: 1 !important;
}

.shortcut-item:hover .shortcut-options {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.9) !important;
    transform: scale(1.05) !important;
}

/* MENÚ CONTEXTUAL - POSICIÓN Y VISIBILIDAD CORRECTA */
.options-menu {
    display: block !important; /* ✅ CAMBIADO de none a block */
    position: absolute !important;
    top: 30px !important;
    right: 6px !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.2s ease !important;
    min-width: 120px !important;
    border: 1px solid #e0e0e0 !important;
    pointer-events: none !important;
}

.options-menu.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important; /* ✅ HABILITAR clicks cuando está visible */
}

/* ITEMS DEL MENÚ */
.menu-item {
    padding: 10px 15px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #f0f0f0 !important;
    color: #333 !important;
    font-size: 13px !important;
    transition: background 0.2s ease !important;
    text-align: left !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
}

.menu-item:last-child {
    border-bottom: none !important;
}

.menu-item:hover {
    background: #f8f9fa !important;
}

.menu-item.delete {
    color: #e74c3c !important;
    font-weight: 500 !important;
}

.menu-item.delete:hover {
    background: #fee !important;
}
/* ================================================== */
/* BOTÓN "+" CENTRADO CORREGIDO v1.0.5 */
/* ================================================== */

.shortcuts-container {
    display: grid !important;
    grid-template-columns: repeat(8, 1fr) !important;
    gap: 15px !important;
    justify-items: center !important;
    align-items: center !important;
    width: 100% !important;
}

.shortcut-item.add-btn {
    grid-column: span 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 2px dashed rgba(255, 255, 255, 0.3) !important;
    border-radius: var(--border-radius) !important;
}

.shortcut-item.add-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.05) !important;
}

/* ================================================== */
/* EFECTOS HOVER MEJORADOS v1.0.5 */
/* ================================================== */

/* Efecto de elevación al hover */
.shortcut-item:not(.add-btn):not(.dragging):hover {
    transform: translateY(-2px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.shortcut-item.add-btn:hover {
    transform: scale(1.05) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

/* ================================================== */
/* RESPONSIVE MEJORADO v1.0.5 */
/* ================================================== */

@media (max-width: 1400px) {
    .shortcuts-container {
        grid-template-columns: repeat(7, 1fr) !important;
    }
}

@media (max-width: 1200px) {
    .shortcuts-container {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .shortcuts-container {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 12px !important;
    }
    
    .shortcut-item {
        min-height: 70px !important;
    }
    
    .shortcut-icon {
        width: 30px !important;
        height: 30px !important;
    }
    
    .shortcut-name {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 768px) {
    .shortcuts-container {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
    }
    
    .shortcut-item {
        min-height: 65px !important;
        padding: 8px !important;
    }
    
    .shortcut-options {
        width: 20px !important;
        height: 20px !important;
        top: 4px !important;
        right: 4px !important;
        font-size: 11px !important;
        opacity: 1 !important;
    }
    
    .options-menu {
        min-width: 100px !important;
        right: 4px !important;
    }
    
    .menu-item {
        padding: 10px 12px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 576px) {
    .shortcuts-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .shortcut-item {
        min-height: 60px !important;
    }
    
    .shortcut-icon {
        width: 25px !important;
        height: 25px !important;
        margin-bottom: 5px !important;
    }
    
    .shortcut-name {
        font-size: 0.65rem !important;
    }
}

@media (max-width: 480px) {
    .shortcuts-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
/* ================================================== */
/* ANIMACIONES Y TRANSICIONES MEJORADAS v1.0.1 */
/* ================================================== */

.shortcut-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.shortcut-item.dragging {
    transition: transform 0.2s ease, opacity 0.2s ease !important;
}

.options-menu {
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease !important;
}

/* Efecto de elevación al hover */
.shortcut-item:not(.add-btn):not(.dragging):hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Efecto de pulsación para el botón añadir */
.shortcut-item.add-btn:hover {
    transform: scale(1.05) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

/* ================================================== */
/* COMPATIBILIDAD Y FALLBACKS v1.0.1 */
/* ================================================== */

/* Fallback para navegadores que no soportan grid */
@supports not (display: grid) {
    .shortcuts-container {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .shortcut-item {
        width: 100px !important;
        margin: 10px !important;
    }
}

/* Mejora de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .shortcut-item,
    .options-menu,
    .shortcut-options {
        transition: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .shortcut-item.drag-over {
        border: 3px dashed #000 !important;
        background: rgba(0, 0, 0, 0.1) !important;
    }
    
    .options-menu {
        border: 2px solid #000 !important;
    }
}