/**
 * Componente: Selector de Plantillas - Estilos
 * Widget flotante para cambiar entre plantillas del sitio
 */

/* ========================================
   BOTÓN FLOTANTE
   ======================================== */

.selector-plantillas-widget {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 9998;
}

.selector-plantillas-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e3a4f 100%);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 0.5rem;
}

.selector-plantillas-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.selector-plantillas-btn i {
    font-size: 1.5rem;
}

.selector-plantillas-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   PANEL DESPLEGABLE
   ======================================== */

.selector-plantillas-panel {
    position: absolute;
    top: 0;
    right: 80px;
    width: 320px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.selector-plantillas-panel.activo {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Header del Panel */
.selector-plantillas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e3a4f 100%);
    color: #ffffff;
}

.selector-plantillas-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selector-plantillas-cerrar {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.selector-plantillas-cerrar:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Contenido del Panel */
.selector-plantillas-contenido {
    padding: 1.5rem;
}

.selector-plantillas-descripcion {
    color: #666;
    font-size: 0.9rem;
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

/* ========================================
   OPCIONES DE PLANTILLAS
   ======================================== */

.selector-plantillas-opciones {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.plantilla-opcion {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.plantilla-opcion:hover {
    background: #e9ecef;
    border-color: var(--color-primary);
    transform: translateX(5px);
}

.plantilla-opcion.activa {
    background: #e3f2fd;
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(44, 74, 107, 0.15);
}

.plantilla-opcion-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #ffffff;
    border-radius: 10px;
    color: var(--color-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.plantilla-opcion.activa .plantilla-opcion-icono {
    background: var(--color-primary);
    color: #ffffff;
}

.plantilla-opcion-info {
    flex: 1;
}

.plantilla-opcion-nombre {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.25rem 0;
}

.plantilla-opcion-descripcion {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.plantilla-opcion-check {
    color: var(--color-primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* ========================================
   NOTA INFORMATIVA
   ======================================== */

.selector-plantillas-nota {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #856404;
}

.selector-plantillas-nota i {
    font-size: 1rem;
    flex-shrink: 0;
}

/* ========================================
   ESTADOS DE CARGA
   ======================================== */

.plantilla-opcion.cargando {
    pointer-events: none;
    opacity: 0.6;
}

.plantilla-opcion.cargando::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .selector-plantillas-widget {
        top: auto;
        bottom: 90px;
        right: 15px;
    }

    .selector-plantillas-btn {
        width: 60px;
        height: 60px;
    }

    .selector-plantillas-btn i {
        font-size: 1.3rem;
    }

    .selector-plantillas-badge {
        font-size: 0.6rem;
    }

    .selector-plantillas-panel {
        position: fixed;
        top: auto;
        bottom: 160px;
        right: 15px;
        left: 15px;
        width: auto;
        max-width: 400px;
        margin: 0 auto;
    }

    .selector-plantillas-panel.activo {
        transform: translateY(0);
    }

    .selector-plantillas-panel:not(.activo) {
        transform: translateY(20px);
    }
}

@media (max-width: 480px) {
    .selector-plantillas-header {
        padding: 1rem;
    }

    .selector-plantillas-titulo {
        font-size: 1rem;
    }

    .selector-plantillas-contenido {
        padding: 1rem;
    }

    .plantilla-opcion {
        padding: 0.75rem;
    }

    .plantilla-opcion-icono {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .plantilla-opcion-nombre {
        font-size: 0.95rem;
    }

    .plantilla-opcion-descripcion {
        font-size: 0.75rem;
    }
}

/* ========================================
   ANIMACIONES
   ======================================== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.selector-plantillas-panel.activo {
    animation: slideInRight 0.3s ease;
}
