/**
 * Responsive Global Styles - WowStore
 * 
 * Estilos responsive premium para todo el sistema.
 * Mobile-first approach con breakpoints optimizados.
 * 
 * Breakpoints:
 * - xs: < 576px (móvil pequeño)
 * - sm: 576px - 767px (móvil grande)
 * - md: 768px - 991px (tablet)
 * - lg: 992px - 1199px (desktop)
 * - xl: >= 1200px (desktop grande)
 */

/* ===== VARIABLES RESPONSIVE ===== */
:root {
    --mobile-spacing: 1rem;
    --mobile-radius: 16px;
    --mobile-font-base: 0.9rem;
}

/* ============================================
   GLOBAL RESPONSIVE UTILITIES
   ============================================ */

/* Contenedor principal responsive */
@media (max-width: 991.98px) {
    .main-container {
        padding: 0.75rem !important;
        margin-top: 0 !important;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Títulos más pequeños en móvil */
    h1, .h1 { font-size: 1.75rem !important; }
    h2, .h2 { font-size: 1.5rem !important; }
    h3, .h3 { font-size: 1.25rem !important; }
    h4, .h4 { font-size: 1.1rem !important; }
    
    /* Cards ajustadas */
    .card {
        border-radius: var(--mobile-radius) !important;
    }
    
    .card-body {
        padding: 1rem !important;
    }
    
    /* Botones responsive */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    /* Tablas scroll horizontal */
    .table-responsive-custom {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   LOGIN & REGISTRO RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    /* Login Page */
    .login-hero {
        padding: 1.5rem !important;
        border-radius: 0 !important;
        min-height: auto !important;
    }
    
    .login-content {
        flex-direction: column !important;
        gap: 1.5rem !important;
    }
    
    .login-branding {
        display: none !important;
    }
    
    .login-form-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .login-card {
        padding: 1.5rem !important;
        border-radius: var(--mobile-radius) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    }
    
    .login-card .login-header h2 {
        font-size: 1.5rem !important;
    }
    
    .login-card .form-control {
        padding: 0.85rem 1rem 0.85rem 2.75rem !important;
        font-size: 1rem !important;
    }
    
    .login-card .btn-login {
        padding: 0.9rem !important;
        font-size: 1rem !important;
    }
    
    /* Features tags ocultos en móvil */
    .feature-tags {
        display: none !important;
    }
    
    /* Ajustar main container para login */
    body.login-page .main-container,
    .login-hero + .main-container {
        padding: 0 !important;
    }
}

@media (max-width: 575.98px) {
    .login-hero {
        padding: 1rem !important;
    }
    
    .login-card {
        padding: 1.25rem !important;
    }
    
    .login-card .avatar-circle {
        width: 60px !important;
        height: 60px !important;
    }
    
    .login-card .avatar-circle i {
        font-size: 1.5rem !important;
    }
}

/* ============================================
   CATÁLOGO RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    /* Hero Section */
    .catalog-hero,
    .hero-section {
        padding: 2rem 1rem !important;
        border-radius: var(--mobile-radius) !important;
        margin-bottom: 1.5rem !important;
    }
    
    .catalog-hero h1,
    .hero-section h1 {
        font-size: 1.5rem !important;
    }
    
    .catalog-hero p,
    .hero-section p {
        font-size: 0.9rem !important;
    }
    
    /* Filtros */
    .catalog-filters,
    .filters-section {
        padding: 1rem !important;
        border-radius: var(--mobile-radius) !important;
        margin-bottom: 1rem !important;
    }
    
    .catalog-filters .row {
        gap: 0.75rem;
    }
    
    .catalog-filters .col-md-3,
    .catalog-filters .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* Grid de productos */
    .products-grid,
    .catalog-grid {
        gap: 1rem !important;
    }
    
    /* Product Cards */
    .product-card,
    .platform-card {
        border-radius: var(--mobile-radius) !important;
    }
    
    .product-card .card-header,
    .platform-card .card-header {
        padding: 1.25rem 1rem !important;
    }
    
    .product-card .card-body,
    .platform-card .card-body {
        padding: 1rem !important;
    }
    
    .product-card .product-icon,
    .platform-card .platform-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.25rem !important;
    }
    
    .product-card .product-name,
    .platform-card .platform-name {
        font-size: 1rem !important;
    }
    
    .product-card .product-price,
    .platform-card .platform-price {
        font-size: 1.25rem !important;
    }
    
    /* Botones de producto */
    .product-card .btn-group,
    .platform-card .btn-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .product-card .btn,
    .platform-card .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    /* 2 columnas en tablet pequeña */
    .products-grid,
    .catalog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 575.98px) {
    /* 1 columna en móvil */
    .products-grid,
    .catalog-grid {
        grid-template-columns: 1fr !important;
    }
    
    .product-card .card-header,
    .platform-card .card-header {
        padding: 1rem 0.875rem !important;
    }
    
    .product-card .card-body,
    .platform-card .card-body {
        padding: 0.875rem !important;
    }
}

/* ============================================
   CARRITO RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .cart-container {
        flex-direction: column !important;
    }
    
    .cart-items,
    .cart-summary {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .cart-summary {
        position: relative !important;
        top: auto !important;
        margin-top: 1rem;
    }
    
    .cart-item {
        padding: 1rem !important;
        border-radius: var(--mobile-radius) !important;
    }
    
    .cart-item-info {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .cart-item-image {
        width: 60px !important;
        height: 60px !important;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between !important;
        margin-top: 0.5rem;
    }
    
    .cart-summary-card {
        padding: 1.25rem !important;
        border-radius: var(--mobile-radius) !important;
    }
    
    /* Botón checkout fijo en móvil */
    .cart-checkout-btn {
        position: fixed;
        bottom: 85px;
        left: 1rem;
        right: 1rem;
        z-index: 1000;
        border-radius: 14px !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 575.98px) {
    .cart-item {
        padding: 0.875rem !important;
    }
    
    .cart-item-name {
        font-size: 0.95rem !important;
    }
    
    .cart-item-price {
        font-size: 1rem !important;
    }
}

/* ============================================
   PEDIDOS / ORDERS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .orders-container {
        padding: 0 !important;
    }
    
    .order-card {
        border-radius: var(--mobile-radius) !important;
        margin-bottom: 1rem !important;
    }
    
    .order-card-header {
        padding: 1rem !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .order-card-body {
        padding: 1rem !important;
    }
    
    .order-id {
        font-size: 0.85rem !important;
    }
    
    .order-date {
        font-size: 0.8rem !important;
    }
    
    .order-status-badge {
        align-self: flex-start;
    }
    
    .order-items-list {
        gap: 0.75rem !important;
    }
    
    .order-item {
        padding: 0.75rem !important;
        border-radius: 12px !important;
    }
    
    .order-item-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
    
    .order-total {
        font-size: 1.1rem !important;
    }
    
    /* Order Detail */
    .order-detail-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .order-detail-actions {
        width: 100%;
    }
    
    .order-detail-actions .btn {
        width: 100%;
    }
}

/* ============================================
   MIS CUENTAS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .accounts-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .account-card {
        border-radius: var(--mobile-radius) !important;
    }
    
    .account-card-header {
        padding: 1rem !important;
    }
    
    .account-card-body {
        padding: 1rem !important;
    }
    
    .account-platform-icon {
        width: 45px !important;
        height: 45px !important;
    }
    
    .account-credentials {
        font-size: 0.85rem !important;
    }
    
    .credential-field {
        padding: 0.75rem !important;
        border-radius: 10px !important;
    }
    
    .credential-value {
        font-size: 0.9rem !important;
    }
    
    .account-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .account-actions .btn {
        width: 100%;
    }
}

/* ============================================
   WALLET RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .wallet-container {
        flex-direction: column !important;
    }
    
    .wallet-sidebar,
    .wallet-main {
        width: 100% !important;
    }
    
    .wallet-balance-card {
        padding: 1.5rem !important;
        border-radius: var(--mobile-radius) !important;
    }
    
    .wallet-balance-amount {
        font-size: 2rem !important;
    }
    
    .wallet-actions-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .wallet-action-btn {
        padding: 1rem !important;
        border-radius: 14px !important;
    }
    
    .wallet-action-btn i {
        font-size: 1.25rem !important;
    }
    
    .wallet-action-btn span {
        font-size: 0.8rem !important;
    }
    
    .transaction-item {
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    .transaction-icon {
        width: 40px !important;
        height: 40px !important;
    }
    
    .transaction-amount {
        font-size: 1rem !important;
    }
}

@media (max-width: 575.98px) {
    .wallet-balance-card {
        padding: 1.25rem !important;
    }
    
    .wallet-balance-amount {
        font-size: 1.75rem !important;
    }
    
    .wallet-actions-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ============================================
   MODALES RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .modal-dialog {
        margin: 0.5rem !important;
        max-width: calc(100% - 1rem) !important;
    }
    
    .modal-content {
        border-radius: var(--mobile-radius) !important;
    }
    
    .modal-header {
        padding: 1rem 1.25rem !important;
    }
    
    .modal-header .modal-title {
        font-size: 1.1rem !important;
    }
    
    .modal-body {
        padding: 1.25rem !important;
    }
    
    .modal-footer {
        padding: 1rem 1.25rem !important;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Modal full screen en móvil */
    .modal-fullscreen-mobile .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        height: 100%;
    }
    
    .modal-fullscreen-mobile .modal-content {
        border-radius: 0 !important;
        height: 100%;
    }
}

@media (max-width: 575.98px) {
    .modal-header {
        padding: 0.875rem 1rem !important;
    }
    
    .modal-body {
        padding: 1rem !important;
    }
    
    .modal-footer {
        padding: 0.875rem 1rem !important;
    }
}

/* ============================================
   FORMULARIOS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .form-control,
    .form-select {
        padding: 0.75rem 1rem !important;
        font-size: 1rem !important;
        border-radius: 12px !important;
    }
    
    .form-label {
        font-size: 0.875rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .form-group,
    .mb-3 {
        margin-bottom: 1rem !important;
    }
    
    .input-group .form-control {
        border-radius: 12px 0 0 12px !important;
    }
    
    .input-group .btn,
    .input-group .input-group-text {
        border-radius: 0 12px 12px 0 !important;
    }
    
    /* Inputs con iconos */
    .input-with-icon {
        position: relative;
    }
    
    .input-with-icon .form-control {
        padding-left: 2.75rem !important;
    }
    
    .input-with-icon .input-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: #94a3b8;
    }
}

/* ============================================
   BADGES & ALERTS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .badge {
        font-size: 0.7rem !important;
        padding: 0.35rem 0.6rem !important;
    }
    
    .alert {
        padding: 0.875rem 1rem !important;
        border-radius: 12px !important;
        font-size: 0.875rem !important;
    }
    
    .alert-icon {
        font-size: 1rem !important;
    }
}

/* ============================================
   STAT CARDS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .stat-cards-row {
        gap: 0.75rem !important;
    }
    
    .stat-card {
        padding: 1rem !important;
        border-radius: var(--mobile-radius) !important;
    }
    
    .stat-card-icon {
        width: 45px !important;
        height: 45px !important;
        font-size: 1.1rem !important;
    }
    
    .stat-card-value {
        font-size: 1.5rem !important;
    }
    
    .stat-card-label {
        font-size: 0.75rem !important;
    }
}

@media (max-width: 575.98px) {
    .stat-cards-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .stat-card {
        padding: 0.875rem !important;
    }
    
    .stat-card-value {
        font-size: 1.25rem !important;
    }
}

/* ============================================
   EMPTY STATES RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .empty-state {
        padding: 2rem 1rem !important;
    }
    
    .empty-state-icon {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
    }
    
    .empty-state-title {
        font-size: 1.25rem !important;
    }
    
    .empty-state-text {
        font-size: 0.9rem !important;
    }
}

/* ============================================
   TOAST NOTIFICATIONS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .premium-toast-container {
        top: 80px !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
    }
    
    .premium-toast {
        min-width: auto !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ============================================
   FLOATING ACTION BUTTONS
   ============================================ */
@media (max-width: 991.98px) {
    .fab-container {
        bottom: 100px !important;
        right: 1rem !important;
    }
    
    .fab-main {
        width: 52px !important;
        height: 52px !important;
    }
}

/* ============================================
   LOADING STATES RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .loading-overlay {
        border-radius: var(--mobile-radius) !important;
    }
    
    .loading-spinner {
        width: 40px !important;
        height: 40px !important;
    }
    
    .skeleton-card {
        border-radius: var(--mobile-radius) !important;
    }
}

/* ============================================
   PROFILE MODAL RESPONSIVE - Premium
   ============================================ */
@media (max-width: 991.98px) {
    #profileModal .modal-dialog {
        max-width: calc(100% - 1.5rem) !important;
        margin: 1.5rem auto !important;
    }
    
    #profileModal .modal-content {
        border-radius: 20px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    }
    
    #profileModal .modal-header,
    #profileModal .profile-modal-header {
        padding: 1rem 1.15rem !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f64f59 100%) !important;
        color: white !important;
        border: none !important;
    }
    
    #profileModal .modal-header .modal-title,
    #profileModal .profile-modal-header .modal-title,
    #profileModal #profileModalLabel {
        color: white !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
    }
    
    #profileModal .modal-title i,
    #profileModal #profileModalLabel i {
        padding: 0.4rem !important;
        font-size: 0.95rem !important;
    }
    
    #profileModal .modal-header .btn-close,
    #profileModal .profile-modal-header .btn-close {
        filter: brightness(0) invert(1) !important;
    }
    
    #profileModal .modal-body {
        padding: 0 !important;
        background: #f8fafc !important;
    }
    
    #profileModal .profile-section {
        padding: 1rem 1.15rem !important;
    }
    
    #profileModal .section-label {
        font-size: 0.65rem !important;
        margin-bottom: 0.7rem !important;
    }
    
    #profileModal .form-label-sm {
        font-size: 0.7rem !important;
    }
    
    #profileModal .form-control {
        padding: 0.55rem 0.8rem !important;
        font-size: 0.8rem !important;
        border-radius: 10px !important;
    }
    
    #profileModal .password-toggle-header {
        padding: 0.9rem 1.15rem !important;
    }
    
    #profileModal .password-toggle-header span {
        font-size: 0.85rem !important;
    }
    
    #profileModal .password-fields {
        padding: 0 1.15rem 1rem !important;
    }
    
    #profileModal .modal-footer,
    #profileModal .profile-modal-footer {
        padding: 0.9rem 1.15rem !important;
        background: #ffffff !important;
        border-top: 1px solid #e2e8f0 !important;
        gap: 0.6rem !important;
    }
    
    #profileModal .modal-footer .btn,
    #profileModal .profile-modal-footer .btn {
        flex: 1 !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.8rem !important;
        border-radius: 11px !important;
    }
    
    #profileModal .toggle-label {
        width: 40px !important;
        height: 22px !important;
    }
    
    #profileModal .toggle-label::after {
        width: 16px !important;
        height: 16px !important;
    }
    
    #profileModal .toggle-input:checked + .toggle-label::after {
        transform: translateX(18px) !important;
    }
    
    .profile-section {
        padding: 1rem 1.15rem !important;
    }
    
    .profile-section .form-control {
        font-size: 0.8rem !important;
        padding: 0.55rem 0.8rem !important;
        border-radius: 10px !important;
    }
    
    .password-toggle-header {
        padding: 0.9rem 1.15rem !important;
    }
    
    .password-fields {
        padding: 0 1.15rem 1rem !important;
    }
}

@media (max-width: 575.98px) {
    #profileModal .modal-dialog {
        max-width: calc(100% - 1rem) !important;
        margin: 1rem auto !important;
    }
    
    #profileModal .modal-content {
        border-radius: 18px !important;
        max-height: 88vh !important;
    }
    
    #profileModal .modal-header,
    #profileModal .profile-modal-header {
        padding: 1rem 1.1rem !important;
    }
    
    #profileModal .modal-title,
    #profileModal #profileModalLabel {
        font-size: 0.98rem !important;
    }
    
    #profileModal .modal-title i,
    #profileModal #profileModalLabel i {
        padding: 0.4rem !important;
        font-size: 0.9rem !important;
    }
    
    #profileModal .profile-section {
        padding: 1rem 1.1rem !important;
    }
    
    #profileModal .section-label {
        font-size: 0.65rem !important;
        margin-bottom: 0.7rem !important;
    }
    
    #profileModal .form-control {
        padding: 0.55rem 0.75rem !important;
        font-size: 0.8rem !important;
        border-radius: 10px !important;
    }
    
    #profileModal .password-toggle-header {
        padding: 0.9rem 1.1rem !important;
    }
    
    #profileModal .password-toggle-header span {
        font-size: 0.82rem !important;
    }
    
    #profileModal .password-fields {
        padding: 0 1.1rem 1rem !important;
    }
    
    #profileModal .modal-footer,
    #profileModal .profile-modal-footer {
        padding: 0.9rem 1.1rem !important;
        gap: 0.55rem !important;
    }
    
    #profileModal .modal-footer .btn {
        padding: 0.65rem 0.9rem !important;
        font-size: 0.8rem !important;
        border-radius: 11px !important;
    }
    
    #profileModal .toggle-label {
        width: 40px !important;
        height: 22px !important;
    }
    
    #profileModal .toggle-label::after {
        width: 16px !important;
        height: 16px !important;
    }
    
    #profileModal .toggle-input:checked + .toggle-label::after {
        transform: translateX(18px) !important;
    }
    
    .profile-section {
        padding: 1rem 1.1rem !important;
    }
    
    .profile-section .row.g-2 > .col-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ============================================
   PAYMENT MODALS RESPONSIVE
   ============================================ */
@media (max-width: 991.98px) {
    .payment-modal .modal-body {
        padding: 1.25rem !important;
    }
    
    .payment-method-card {
        padding: 1rem !important;
        border-radius: 14px !important;
    }
    
    .payment-amount {
        font-size: 1.75rem !important;
    }
    
    .qr-code-container {
        padding: 1rem !important;
    }
    
    .qr-code-container img {
        max-width: 180px !important;
    }
    
    .crypto-address {
        font-size: 0.75rem !important;
        word-break: break-all;
    }
}

/* ============================================
   HIDE/SHOW UTILITIES FOR MOBILE
   ============================================ */
@media (max-width: 991.98px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .hide-desktop {
        display: none !important;
    }
    
    .show-mobile-only {
        display: none !important;
    }
}

/* ============================================
   TOUCH OPTIMIZATIONS
   ============================================ */
@media (max-width: 991.98px) {
    /* Hacer elementos touch-friendly */
    .btn, 
    .nav-link, 
    .dropdown-item,
    .list-group-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Mejor scrolling */
    .scroll-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* Disable hover en touch */
    @media (hover: none) {
        .btn:hover {
            transform: none;
        }
    }
}

/* ============================================
   SAFE AREA INSETS (NOTCH DEVICES)
   ============================================ */
@supports (padding: max(0px)) {
    @media (max-width: 991.98px) {
        body {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }
        
        .main-container {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
    }
}

/* ============================================
   LANDSCAPE MODE ADJUSTMENTS
   ============================================ */
@media (max-width: 991.98px) and (orientation: landscape) {
    .mobile-header {
        padding: 0.5rem 1rem !important;
    }
    
    .mobile-bottom-nav {
        padding: 0.35rem 0.5rem !important;
    }
    
    .mobile-nav-item .nav-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .mobile-nav-item .nav-label {
        font-size: 0.6rem !important;
    }
    
    .mobile-nav-item.nav-main {
        margin-top: -15px;
    }
    
    .mobile-nav-item.nav-main .nav-icon {
        width: 44px !important;
        height: 44px !important;
    }
    
    body {
        padding-top: 55px !important;
        padding-bottom: 70px !important;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .mobile-header,
    .mobile-bottom-nav,
    .mobile-menu-overlay,
    .navbar {
        display: none !important;
    }
    
    body {
        padding: 0 !important;
    }
}
