/**
 * Estilos específicos para móviles
 * Optimizaciones de UX y rendimiento
 */

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--accent-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pull to refresh indicator */
.pull-to-refresh {
    text-align: center;
    padding: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Swipe gestures hint */
.swipe-hint {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 24px;
    font-size: 0.875rem;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mejoras de scroll en móviles */
@media (max-width: 768px) {
    html {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    body {
        overflow-x: hidden;
    }
    
    /* Mejor contraste en móviles */
    .moneda-info h3,
    .subasta-info h3 {
        font-weight: 600;
    }
    
    /* Espaciado táctil mejorado */
    .btn-primary,
    .btn-secondary,
    .btn-buy,
    .btn-bid {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Header Actions en móviles */
    .header-actions {
        gap: 0.5rem;
    }
    
    .account-btn {
        padding: 0.625rem 0.75rem;
    }
    
    .account-name {
        display: none;
    }
    
    .account-dropdown {
        right: 0;
        left: auto;
        min-width: 180px;
        max-width: calc(100vw - 2rem);
    }
    
    .cart-link {
        padding: 0.625rem;
    }
    
    /* Mejoras en formularios móviles */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="search"],
    textarea,
    select {
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
    }
    
    /* Mejor feedback visual en botones */
    button:active,
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.98);
    }
    
    /* Optimización de imágenes */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Mejor scroll en listas */
    .monedas-grid,
    .subastas-grid {
        padding-bottom: 2rem;
    }
    
    /* Sticky header mejorado */
    .main-header {
        position: -webkit-sticky;
        position: sticky;
    }
    
    /* Mejoras en modales/overlays */
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1rem;
    }
    
    /* Toast notifications */
    .toast {
        position: fixed;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        background: var(--secondary-color);
        color: white;
        padding: 1rem 1.5rem;
        border-radius: 8px;
        box-shadow: var(--shadow-lg);
        z-index: 10000;
        animation: slideUp 0.3s ease;
        max-width: 90%;
        text-align: center;
    }
    
    .toast.success {
        background: var(--success-color);
    }
    
    .toast.error {
        background: var(--accent-color);
    }
}

/* Optimizaciones para pantallas muy pequeñas */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-section h2 {
        font-size: 1.25rem;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .moneda-info h3,
    .subasta-info h3 {
        font-size: 1rem;
    }
}

/* Landscape móvil */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .header-content {
        padding: 0.75rem 0;
    }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
    /* Mantener el diseño claro pero con mejor contraste */
    body {
        background: var(--bg-color);
        color: var(--text-color);
    }
}
