/* ============================================================
   BOTONES CON EFECTO GLOW (BARRIDO DE LUZ) - RESPONSIVE
   ============================================================ */
.btn {
    /* Padding fluido que se adapta al viewport */
    padding: clamp(0.625rem, 2vw, 0.875rem) clamp(1rem, 3vw, 1.5rem);
    /* Tamaño de fuente responsivo */
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(0.375rem, 1.5vw, 0.5rem);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
    /* Botón primario - rojo con texto blanco (funciona en ambos temas) */
    background: var(--btn-primary);
    color: white;
    border-radius: 0 var(--radius);
    text-decoration: none;
    min-width: fit-content;
    white-space: nowrap;
}

/* Pseudo-elemento para el efecto de brillo (Glow) */
.btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: all 0.6s ease;
    z-index: 1;
}

/* Hover - Solo en dispositivos con cursor preciso */
@media (hover: hover) and (pointer: fine) {
    .btn:hover:not(:disabled)::before {
        left: 150%;
    }
    
    .btn:hover:not(:disabled) {
        box-shadow: 0 4px 12px rgba(232, 0, 40, 0.25);
        filter: brightness(1.05);
    }
    
    .btn-secondary:hover:not(:disabled) {
        filter: brightness(0.95);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
}

/* Estado Activo (Click/Touch) */
.btn:active:not(:disabled) {
    filter: brightness(0.95);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: scale(0.98);
}

/* Estados deshabilitados */
.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--panel-2);
    color: var(--muted);
    filter: none;
}

.btn:disabled::before {
    display: none;
}

/* Z-index para contenido */
.btn span,
.btn i,
.btn strong {
    position: relative;
    z-index: 2;
}

/* --- Botón secundario --- */
.btn-secondary {
    /* Light theme: fondo negro (#131313) con texto blanco */
    /* Dark theme: fondo blanco (#f9f9f9) con texto negro */
    background: var(--btn-secondary);
    color: var(--txt-2);
}

.btn-secondary::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.25),
        transparent
    );
}

.btn-secondary:active:not(:disabled) {
    transform: scale(0.98);
}

/* Focus visible para accesibilidad */
.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--accent);
}

/* ============================================================
   MEDIA QUERIES PARA DIFERENTES BREAKPOINTS
   ============================================================ */

/* Pantallas muy pequeñas (móviles en vertical) */
@media (max-width: 480px) {
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        gap: 0.375rem;
        white-space: normal;
        text-align: center;
    }
    
    /* Reducir intensidad del glow en móviles para mejor rendimiento */
    .btn::before {
        transition: all 0.4s ease;
    }
}

/* Tablets y móviles en horizontal */
@media (min-width: 481px) and (max-width: 768px) {
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Tablets grandes y laptops pequeñas */
@media (min-width: 769px) and (max-width: 1024px) {
    .btn {
        padding: 0.8rem 1.375rem;
        font-size: 0.925rem;
    }
}

/* Pantallas grandes */
@media (min-width: 1025px) {
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Touch devices - Área táctil mínima de 44x44px (WCAG) */
@media (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
        touch-action: manipulation;
    }
}

/* Reducir movimiento para accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .btn {
        transition: opacity 0.2s ease;
    }
    
    .btn::before {
        display: none;
    }
    
    .btn:hover:not(:disabled),
    .btn:active:not(:disabled) {
        transform: none;
    }
}

/* Modo landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Alto contraste para accesibilidad */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .btn::before {
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.6),
            transparent
        );
    }
}