/* ==========================================================================
   MÓDULO EXCLUSIVO DEL DASHBOARD PRINCIPAL Y KYC WIZARD
   ========================================================================== */

/* --- OVERLAY DE CARGA DE ARCHIVOS KYC --- */
.upload-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(255,255,255,0.9); z-index: 999999; display: none; flex-direction: column; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.upload-icon-anim { font-size: 4rem; margin-bottom: 20px; animation: popBounce 1s infinite alternate; }
.upload-title { color: var(--brand-black, #111); margin: 0 0 10px 0; }
.upload-progress-text { color: var(--brand-blue, #00AEEF); font-weight: 800; font-size: 1.2rem; margin-bottom: 15px; }
.upload-progress-track { width: 80%; max-width: 300px; height: 12px; background: #e2e8f0; border-radius: 10px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); margin: 0 auto; }
.upload-progress-fill { width: 0%; height: 100%; background: var(--status-success, #10b981); transition: width 0.2s linear; }
.upload-hint { font-size: 0.85rem; color: #64748b; margin-top: 20px; max-width: 300px; text-align: center; font-weight: 600; }

@keyframes popBounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-15px) scale(1.1); }
}

/* --- DASHBOARD GENERAL --- */
.dash-content { padding: 20px; } /* FIX: Esto soluciona los elementos pegados a los bordes */
.dash-greeting { font-size: 1.2rem; margin-bottom: 5px; color: var(--brand-black, #111); }
.dash-subtitle { color: #64748b; font-size: 0.95rem; margin-bottom: 20px; }

.dash-alert-error { background: #fee2e2; border: 1px solid #fecaca; padding: 15px; border-radius: 12px; margin-bottom: 20px; }
.dash-alert-title { color: #991b1b; margin-top: 0; font-size: 1.1rem; }
.dash-alert-text { color: #991b1b; font-size: 0.9rem; margin-bottom: 0; }

/* KPIs del Dashboard */
.dash-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.dash-kpi-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.dash-kpi-label { font-size: 0.75rem; color: #64748b; font-weight: bold; text-transform: uppercase; margin-bottom: 5px; }
.dash-kpi-val { font-size: 1.3rem; font-weight: 900; color: var(--brand-black, #111); }
.dash-kpi-val.success { color: #10b981; }
.dash-kpi-currency { font-size: 0.8rem; color: #94a3b8; }

/* Banner de Acción Rápida */
.dash-banner { background: linear-gradient(135deg, #004bfe 0%, #1e40af 100%); border-radius: 16px; padding: 25px 20px; text-align: center; box-shadow: 0 10px 20px rgba(0,75,254,0.2); margin-bottom: 25px; position: relative; overflow: hidden; }
.dash-banner-bg-icon { position: absolute; top: -20px; right: -20px; font-size: 6rem; opacity: 0.1; }
.dash-banner-title { margin: 0 0 8px 0; color: #ffffff; position: relative; z-index: 1; font-size: 1.3rem; }
.dash-banner-text { font-size: 0.85rem; color: #bfdbfe; margin-bottom: 20px; position: relative; z-index: 1; }
.dash-banner-btn { background: #ffffff; color: #004bfe; text-decoration: none; height: 50px; border-radius: 12px; font-weight: 900; font-size: 1.1rem; border: none; position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; padding: 0 20px; width: 100%; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }

/* Órdenes Recientes */
.dash-section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 15px; border-bottom: 2px solid #e2e8f0; padding-bottom: 10px; }
.dash-section-title { font-size: 1.1rem; color: var(--brand-black, #111); margin: 0; font-weight: bold; }
.dash-section-link { font-size: 0.8rem; font-weight: bold; color: var(--brand-blue, #00AEEF); text-decoration: none; }

.recent-tx-list { display: flex; flex-direction: column; gap: 12px; }
.recent-tx-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 15px; display: flex; align-items: center; justify-content: space-between; transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.recent-tx-card:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.recent-tx-left { display: flex; align-items: center; gap: 15px; }
.recent-tx-icon { width: 42px; height: 42px; border-radius: 12px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.recent-tx-type { font-size: 0.7rem; font-weight: bold; color: var(--brand-blue, #00AEEF); text-transform: uppercase; margin-bottom: 2px; }
.recent-tx-name { margin: 0 0 2px 0; color: var(--brand-black, #111); font-size: 0.9rem; font-weight: bold; }
.recent-tx-date { font-size: 0.7rem; color: #94a3b8; }
.recent-tx-right { text-align: right; }
.recent-tx-amount { font-weight: bold; color: var(--brand-black, #111); font-size: 0.9rem; }
.recent-tx-status { display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: 8px; font-size: 0.65rem; font-weight: bold; }

.empty-tx-box { text-align: center; padding: 30px 15px; background: #f8fafc; border-radius: 12px; border: 1px dashed #cbd5e1; }
.empty-tx-icon { font-size: 2.5rem; opacity: 0.5; display: block; margin-bottom: 10px; }
.empty-tx-text { color: #94a3b8; font-size: 0.9rem; margin: 0; font-weight: 500; }

/* --- ASISTENTE KYC --- */
.kyc-review-box { text-align: center; padding: 40px 20px; background: #f8fafc; border-radius: 16px; border: 1px dashed #cbd5e1; margin-top: 20px; }
.kyc-review-icon { font-size: 3rem; display: block; margin-bottom: 10px; }
.kyc-review-title { color: #334155; margin: 0 0 10px 0; }
.kyc-review-text { color: #64748b; font-size: 0.95rem; margin: 0; }

.kyc-wizard-wrap { margin-top: 10px; }
.kyc-intro-center { text-align: center; padding: 10px 0; }
.kyc-intro-icon { font-size: 4rem; margin-bottom: 15px; }
.kyc-intro-title { color: var(--brand-black, #111); margin-bottom: 15px; font-size: 1.4rem; }
.kyc-intro-desc { color: #64748b; line-height: 1.5; margin-bottom: 25px; font-size: 0.95rem; }

.kyc-req-box { background: #f8fafc; border-radius: 16px; padding: 20px; text-align: left; margin-bottom: 30px; border: 1px solid #e2e8f0; }
.kyc-req-title { margin: 0 0 15px 0; color: var(--brand-blue, #00AEEF); font-size: 1.1rem; }
.kyc-req-list { list-style: none; padding: 0; color: #475569; font-size: 0.9rem; margin: 0; }
.kyc-req-list li { margin-bottom: 12px; }
.kyc-req-list li:last-child { margin-bottom: 0; }

.kyc-progress-wrap { display: none; margin: 10px 0 25px 0; }
.kyc-progress-labels { display: flex; justify-content: space-between; margin-bottom: 8px; }
.kyc-progress-step-txt { font-size: 0.75rem; font-weight: 800; color: var(--brand-blue, #00AEEF); text-transform: uppercase; }
.kyc-progress-pct { font-size: 0.75rem; font-weight: bold; color: #94a3b8; }
.kyc-progress-track { width: 100%; height: 6px; background: #e2e8f0; border-radius: 10px; overflow: hidden; }
.kyc-progress-fill { height: 100%; background: var(--brand-blue, #00AEEF); transition: width 0.4s ease; }

.kyc-step-title { margin: 0 0 20px 0; color: var(--brand-black, #111); font-size: 1.2rem; }
.kyc-step-subtitle { font-size: 0.85rem; color: #64748b; margin-bottom: 20px; }

/* Controladores de Inputs KYC Extras */
.kyc-input-clean { width: 100%; border: none; background: transparent; padding: 0; font-weight: bold; outline: none; font-family: inherit; font-size: 1rem; color: var(--brand-black, #111); }
.kyc-input-file { font-size: 0.85rem; width: 100%; color: var(--text-muted); }
.kyc-textarea { width: 100%; border: none; padding: 0; outline: none; font-family: inherit; resize: vertical; font-weight: 600; color: var(--brand-black, #111); font-size: 1rem; }
.kyc-video-hint { font-size: 0.8rem; font-style: italic; margin-bottom: 10px; color: var(--brand-blue, #00AEEF); background: #eff6ff; padding: 10px; border-radius: 8px; }

.btn-submit-kyc { background: var(--status-success, #10b981) !important; border-color: var(--status-success, #10b981) !important; box-shadow: 0 4px 0 #059669 !important; }
.btn-submit-kyc:active { box-shadow: none !important; transform: translateY(4px); }

/* Animación de Pasos KYC - El !important asegura que override a la clase general .kyc-step */
.kyc-step { display: none !important; opacity: 0; }
.kyc-step.active { display: block !important; animation: fadeSlideUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes fadeSlideUp { 
    from { opacity: 0; transform: translateY(15px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* ==========================================================================
   MÓDULO: TIENDA DIGITAL Y CARRITO DE COMPRAS (store.php)
   ========================================================================== */

/* BÚSQUEDA */
.store-search-wrap { padding: 15px; margin-top: 5px; }
.store-search-bar { width: 100%; padding: 12px 15px; border-radius: 12px; border: 1px solid #cbd5e1; outline: none; font-family: inherit; font-size: 1rem; background: #f8fafc; transition: 0.2s; }
.store-search-bar:focus { border-color: var(--brand-blue); background: #fff; box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.1); }

/* GRID DE PRODUCTOS */
.product-list { display: flex; flex-direction: column; gap: 15px; padding: 0 15px 15px 15px; }
.product-card { background: #fff; border-radius: 16px; border: 1px solid #e2e8f0; display: flex; padding: 12px; gap: 12px; transition: 0.2s; position: relative; }
.product-card:active { transform: scale(0.98); }
.product-img-wrap { width: 85px; height: 85px; border-radius: 10px; background: #f8fafc; flex-shrink: 0; padding: 5px; cursor: pointer; border: 1px solid #f1f5f9; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: contain; }

.product-info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.product-title { font-size: 0.9rem; font-weight: 700; margin: 0 0 4px 0; line-height: 1.2; color: var(--brand-black); cursor: pointer; }
.product-cat { font-size: 0.65rem; color: #10b981; font-weight: 600; display: inline-block; margin-bottom: 4px; background: #dcfce7; padding: 2px 6px; border-radius: 4px; align-self: flex-start; }

.product-bottom { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; }
.product-price { font-size: 1.15rem; font-weight: 900; color: var(--brand-blue); }

/* BOTONES DE CANTIDAD */
.btn-add-initial { background: var(--brand-blue); color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 5px rgba(0,174,239,0.3); position: relative; z-index: 10;}
.catalog-qty-controls { display: none; align-items: center; background: #f1f5f9; border-radius: 20px; border: 1px solid #cbd5e1; overflow: hidden; height: 32px; }
.catalog-qty-controls button { background: none; border: none; padding: 0 10px; font-weight: bold; color: var(--brand-blue); font-size: 1rem; cursor: pointer; height: 100%; }
.catalog-qty-controls input { width: 25px; text-align: center; border: none; background: transparent; font-weight: bold; font-size: 0.9rem; padding: 0; color: var(--brand-black); }

/* BOTTOM BAR (CARRITO FLOTANTE) */
.bottom-cart-bar { 
    position: absolute; /* FIX: Restringe el carrito a la caja de la app */
    bottom: -100px; 
    left: 0; 
    width: 100%; 
    background: var(--brand-blue); 
    color: #fff; 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    cursor: pointer; 
    z-index: 15; /* Justo debajo del footer */
    border-radius: 16px 16px 0 0; 
    transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15); 
}

/* FIX: Flota el carrito EXACTAMENTE encima del menú de iconos (que mide aprox 70px) */
.bottom-cart-bar.active { 
    bottom: 70px; 
}

.cart-qty-badge { background: #fff; color: var(--brand-blue); font-weight: 900; padding: 2px 10px; border-radius: 12px; font-size: 0.9rem; }
.cart-total-text { font-size: 1.1rem; font-weight: 900; }

/* MODALES NATIVOS CENTRADOS DENTRO DEL APP SHELL */
.store-modal-overlay { 
    position: absolute; /* FIX: Confinado al App Shell */
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15,23,42,0.7); 
    z-index: 99999; 
    display: none; 
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(2px); 
    padding: 20px; 
}
.store-modal-sheet { 
    background: #fff; 
    width: 100%; 
    max-width: 420px; 
    border-radius: 24px; 
    padding: 25px; 
    animation: popInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
    max-height: 85vh; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
@keyframes popInModal { 
    from { opacity: 0; transform: scale(0.95); } 
    to { opacity: 1; transform: scale(1); } 
}

.store-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-shrink: 0; }
.store-modal-header h2 { margin: 0; font-size: 1.1rem; color: var(--brand-black); line-height: 1.3; padding-right: 15px; }
.store-btn-close { background: #f1f5f9; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; color: #64748b; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: 0.2s; }
.store-btn-close:active { background: #e2e8f0; transform: scale(0.9); }

.store-modal-scroll { overflow-y: auto; flex: 1; padding-bottom: 15px; margin-bottom: 10px; }
.store-modal-scroll::-webkit-scrollbar { display: none; }

/* GALERÍA DE PRODUCTO */
.main-img-container { width: 100%; aspect-ratio: 4/3; background: #f8fafc; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; border: 1px solid #f1f5f9; padding: 10px; }
.main-img-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.thumbnails-container { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; }
.thumbnails-container::-webkit-scrollbar { display: none; }
.thumb-img { width: 60px; height: 60px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; object-fit: cover; background: #f8fafc; padding: 2px; }
.thumb-img.active { border-color: var(--brand-blue); }

.prod-meta-info { display: flex; justify-content: space-between; background: #f8fafc; padding: 10px; border-radius: 8px; margin: 15px 0; font-size: 0.8rem; color: #64748b; border: 1px solid #e2e8f0; }
.prod-meta-info strong { color: var(--brand-blue); }

/* ELEMENTOS DEL CARRITO */
.store-cart-item { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px dashed #e2e8f0; }
.store-cart-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 5px; color: var(--brand-black); line-height: 1.2; }
.btn-delete-item { background: #fee2e2; border: none; color: #ef4444; border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; cursor: pointer; transition: 0.2s; }
.btn-delete-item:active { transform: scale(0.9); }

.store-select { width: 100%; padding: 14px; border-radius: 12px; border: 1px solid #cbd5e1; font-size: 1rem; margin-bottom: 15px; background: #fff; font-family: inherit; font-weight: 600; color: var(--brand-black); }

/* BOTONES INFERIORES FIJOS EN MODAL */
.btn-checkout { background: #10b981; color: #fff; width: 100%; padding: 16px; border: none; border-radius: 14px; font-size: 1.1rem; font-weight: 900; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 5px; box-shadow: 0 4px 15px rgba(16,185,129,0.3); transition: 0.2s; }
.btn-checkout:active { transform: translateY(2px); box-shadow: none; }
.btn-checkout:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }

/* Animación Fly to Cart */
.flying-img { position: fixed; z-index: 99999; object-fit: contain; border-radius: 12px; pointer-events: none; transition: all 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* ==========================================================================
   MÓDULO EXCLUSIVO: GANAR / REFERIDOS (earn.php)
   ========================================================================== */

.dash-greeting-earn { font-size: 1.2rem; margin-bottom: 20px; color: var(--brand-black, #111); }

/* Promoción para validar KYC */
.earn-promo-box { text-align: center; padding: 40px 20px; background: #fff1f2; border-radius: 20px; border: 2px dashed #fecaca; }
.earn-promo-icon { font-size: 3rem; display: block; margin-bottom: 10px; }
.earn-promo-title { color: #991b1b; margin-top: 0; }
.earn-promo-text { font-size: 0.95rem; color: #7f1d1d; margin: 0; line-height: 1.5; }

/* Enlace Mágico de Referidos */
.earn-link-title { margin-top: 0; color: var(--brand-black); font-size: 1.1rem; margin-bottom: 5px; }
.earn-link-desc { font-size: 0.85rem; color: #64748b; margin-bottom: 15px; }
.earn-ref-input { flex: 1; border: none; outline: none; font-family: monospace; background: transparent; font-size: 0.85rem; color: var(--brand-black); width: 100%; }

.btn-copy { background: var(--brand-black, #111); color: #fff; border: none; padding: 8px 15px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 0.8rem; flex-shrink: 0; }
.btn-copy:active { transform: scale(0.95); }

/* Estado sin billeteras */
.withdraw-empty-box { background: #fee2e2; border: 1px solid #fecaca; padding: 15px; border-radius: 12px; text-align: center; color: #991b1b; }
.withdraw-empty-text { margin: 0; font-weight: bold; font-size: 0.9rem; }
.earn-manage-link { color: var(--brand-blue); font-weight: bold; font-size: 0.9rem; text-decoration: none; display: inline-block; }

/* Modal de Cobro (Absoluto al App Shell) */
.earn-modal-overlay {
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15,23,42,0.7);
    z-index: 99999;
    display: none; 
    justify-content: center; align-items: center;
    backdrop-filter: blur(2px); padding: 20px;
}

.earn-modal-sheet {
    background: #fff; width: 100%; max-width: 420px; border-radius: 24px; padding: 25px;
    animation: popInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    position: relative;
}

.earn-btn-close {
    position: absolute; right: 20px; top: 20px; background: #f1f5f9; border: none;
    width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.2rem;
    color: #475569; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.earn-btn-close:active { background: #e2e8f0; transform: scale(0.9); }

.earn-modal-title { margin-top: 0; color: var(--brand-black); font-size: 1.3rem; margin-bottom: 5px; }
.earn-modal-desc { font-size: 0.85rem; color: #64748b; margin-bottom: 20px; line-height: 1.4; }

.earn-modal-label { font-size: 0.85rem; font-weight: bold; color: #64748b; margin-bottom: 5px; display: block; text-transform: uppercase; }
.earn-select-wrapper { background: #f8fafc; border: 2px solid #e2e8f0; border-radius: 12px; padding: 0 15px; }
.earn-select { width: 100%; border: none; background: transparent; padding: 15px 0; font-weight: bold; outline: none; font-family: inherit; color: var(--brand-black); font-size: 0.95rem; }

/* ==========================================================================
   MÓDULO: MIS BILLETERAS (wallets.php)
   ========================================================================== */

/* Cabecera y Alertas */
.wallet-page-header { text-align: center; margin-bottom: 25px; }
.wallet-page-icon { font-size: 3rem; margin-bottom: 10px; }
.wallet-page-title { margin: 0; color: var(--brand-black); }
.wallet-page-desc { font-size: 0.9rem; color: #64748b; margin-top: 5px; }

.wallet-alert { padding: 12px; border-radius: 8px; margin-bottom: 20px; font-weight: bold; font-size: 0.9rem; text-align: center; }
.wallet-alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.wallet-alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* Lista de Billeteras y Tarjetas */
.wallet-list { display: flex; flex-direction: column; gap: 15px; }
.wallet-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.wallet-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }

.wallet-alias-badge { display: inline-block; background: #eff6ff; color: var(--brand-blue); padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 800; margin-bottom: 8px; text-transform: uppercase; }
.wallet-bank-name { margin: 0 0 5px 0; color: var(--brand-black); font-size: 1.05rem; }
.wallet-bank-name span { color: #64748b; font-size: 0.9rem; }

/* Botones de acción en la tarjeta */
.wallet-actions { display: flex; gap: 5px; }
.wallet-actions button { width: 35px; height: 35px; border-radius: 10px; cursor: pointer; border: none; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.wallet-actions button:active { transform: scale(0.9); }
.btn-wallet-history { background: #fef9c3; color: #d97706; }
.btn-wallet-edit { background: #e0e7ff; color: #004bfe; }
.btn-wallet-delete { background: #fee2e2; color: #ef4444; }

.wallet-details { margin: 0; font-family: monospace; font-size: 0.95rem; color: #475569; font-weight: bold; word-wrap: break-word; }

.wallet-btn-add { margin-top: 20px; border-style: dashed !important; }

/* Estado Vacío */
.wallet-empty-state { text-align: center; padding: 40px 20px; background: #f8fafc; border-radius: 16px; border: 2px dashed #cbd5e1; }
.wallet-empty-icon { font-size: 2.5rem; opacity: 0.5; }
.wallet-empty-title { color: #475569; margin: 10px 0; }

/* Selector de Países Personalizado */
.custom-select-container { position: relative; width: 100%; background: var(--bg-input); border: 2px solid var(--border-color); border-radius: 12px; }
.custom-select-trigger { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 12px 15px; }
.wallet-country-select-content { display: flex; align-items: center; gap: 10px; color: #94a3b8; }
.wallet-select-arrow { color: #64748b; font-size: 1.2rem; padding-right: 5px; }
.custom-select-options { position: absolute; top: calc(100% + 5px); left: 0; right: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; max-height: 250px; overflow-y: auto; z-index: 999; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.custom-option { display: flex; align-items: center; padding: 12px 15px; cursor: pointer; gap: 10px; border-bottom: 1px solid #f1f5f9; }
.custom-option:hover { background: #f8fafc; }
.wallet-opt-flag { width: 24px; border-radius: 50%; }

/* Inputs dentro del modal */
.wallet-input-wrapper { background: var(--bg-input); border: 2px solid var(--border-color); border-radius: 12px; padding: 0 15px; display: flex; }
.wallet-clean-input { width: 100%; border: none; background: transparent; padding: 12px 0; font-weight: bold; outline: none; font-size: 1rem; color: var(--brand-black); font-family: inherit;}
.wallet-dynamic-container { margin-top: 15px; }
.wallet-btn-save { margin-top: 25px; background: var(--status-success); border-color: var(--status-success); box-shadow: 0 6px 0 #059669; }

/* Modales de la Billetera (Confinados al App Shell) */
.wallet-modal-overlay {
    position: absolute; /* FIX MÁGICO: Esto confina el modal a la caja .mobile-app-wrapper */
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 9999;
    display: none; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box; backdrop-filter: blur(2px);
}
.wallet-modal-sheet {
    width: 100%; max-width: 400px; background: #fff; border-radius: 24px;
    padding: 25px; position: relative; box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column;
}
.wallet-btn-close { position: absolute; right: 20px; top: 20px; background: #f1f5f9; border: none; width: 35px; height: 35px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; color: #475569; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.wallet-btn-close:active { transform: scale(0.9); }
.wallet-modal-title { margin-top: 0; color: var(--brand-black); }
.wallet-modal-subtitle { font-size: 0.85rem; color: #64748b; margin-bottom: 20px; }

/* Historial de la Billetera */
.wallet-hist-close { background: #fef9c3; color: #d97706; }
.wallet-hist-header { text-align: center; margin-bottom: 20px; }
.wallet-hist-header span { font-size: 2rem; }
.wallet-hist-header h3 { margin-top: 10px; color: var(--brand-black); }
.wallet-hist-scroll { max-height: 400px; overflow-y: auto; }
.wallet-history-item { background: #f8fafc; border-left: 3px solid #f59e0b; padding: 10px; margin-bottom: 10px; border-radius: 0 8px 8px 0; text-align: left; }
.wallet-hist-date { font-size: 0.7rem; color: #94a3b8; font-weight: bold; }
.wallet-hist-old { font-size: 0.8rem; color: #ef4444; }
.wallet-hist-old strong { color: #64748b; }
.wallet-hist-new { font-size: 0.8rem; color: #10b981; }
.wallet-hist-new strong { color: #64748b; }

/* ==========================================================================
   MÓDULO: HISTORIAL DE TRANSACCIONES (history.php)
   ========================================================================== */

/* Filtros Superiores Scrollables */
.hist-filter-wrap { margin-bottom: 25px; }
.hist-filter-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.hist-filter-scroll::-webkit-scrollbar { display: none; }

.filter-btn { background: #f1f5f9; color: #475569; border: none; padding: 10px 18px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; cursor: pointer; white-space: nowrap; transition: 0.2s; }
.filter-btn:hover { background: #e2e8f0; }
.filter-btn.active { background: var(--brand-blue); color: #fff; box-shadow: 0 4px 6px rgba(0,174,239,0.2); }

/* Filas del Carrito de Tienda en el historial */
.store-item-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #e2e8f0; padding: 8px 0; font-size: 0.85rem; }
.store-item-row:last-child { border-bottom: none; }
.store-item-name { color: var(--brand-black); font-weight: 600; flex: 1; padding-right: 10px; }
.store-item-price { color: var(--brand-blue); font-weight: bold; white-space: nowrap; }

/* Modal de Detalles de Transacción (Confinado a App Shell) */
.hist-modal-overlay {
    position: absolute; /* FIX MÁGICO: Encierra el modal en el App Shell */
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 99999;
    display: none; align-items: center; justify-content: center;
    padding: 20px; box-sizing: border-box; backdrop-filter: blur(2px);
}

.hist-modal-sheet {
    width: 100%; max-width: 400px; background: #fff; border-radius: 24px;
    padding: 0; position: relative; box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-height: 85vh; overflow-y: auto; display: flex; flex-direction: column;
}

.hist-btn-close {
    position: absolute; right: 15px; top: 15px;
    background: rgba(255,255,255,0.2); border: none;
    width: 35px; height: 35px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer; color: #fff;
    display: flex; align-items: center; justify-content: center;
    z-index: 10; backdrop-filter: blur(5px); transition: 0.2s;
}
.hist-btn-close:active { transform: scale(0.9); }

/* Cabecera Azul del Modal */
.hist-modal-header-bg {
    background: var(--brand-blue); padding: 30px 20px; text-align: center; color: #fff;
}
.hist-mdl-icon { font-size: 2.5rem; margin-bottom: 10px; }
.hist-mdl-amount { margin: 0 0 5px 0; font-size: 2rem; }
.hist-mdl-title { margin: 0; font-size: 0.95rem; opacity: 0.9; font-weight: bold; letter-spacing: 0.5px; }
.hist-mdl-status { display: inline-block; margin-top: 15px; background: rgba(255,255,255,0.2); padding: 5px 12px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; text-transform: uppercase; }

/* Cuerpo Dinámico del Modal */
.hist-modal-body { padding: 25px 20px; }
.hist-row { display: flex; justify-content: space-between; border-bottom: 1px dashed #e2e8f0; padding-bottom: 10px; align-items: flex-start; }
.hist-label { color: #64748b; }
.hist-value { color: var(--brand-black); font-weight: bold; text-align: right; }