:root {
    --bg-primary: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --border: #2a2a2a;
    --border-light: #333333;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --gold: #f5c542;
    --gold-dark: #c9a227;
    --green: #00d4aa;
    --green-dim: #00a080;
    --red: #ff4d6a;
    --red-dim: #cc3d55;
    --blue: #3b82f6;
    --shadow: 0 4px 20px rgba(0,0,0,0.5);
    --shadow-elegant: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
    --shadow-glow-gold: 0 0 20px rgba(245, 197, 66, 0.15);
    --shadow-glow-green: 0 0 15px rgba(0, 212, 170, 0.2);
    --shadow-glow-red: 0 0 15px rgba(255, 77, 106, 0.2);
    --radius: 20px;
    --radius-sm: 12px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* Side Menu Styles */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100dvh;
    background: var(--bg-card);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.side-menu.active {
    left: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-primary) 100%);
}

.menu-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.menu-logo img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.menu-logo h3 {
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 1px;
}

.menu-logo span {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.menu-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.menu-close svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.menu-items {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.menu-section {
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.menu-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    display: block;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.menu-item:hover,
.menu-item:active {
    background: var(--bg-card-hover);
}

.menu-icon {
    font-size: 1.25rem;
    width: 28px;
    text-align: center;
}

.menu-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.menu-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background: var(--gold);
    color: #000;
}

.menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.menu-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.menu-btn svg {
    width: 22px;
    height: 22px;
    color: var(--gold);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-top: 60px; /* Espacio para el banner de AdMob */
    padding-bottom: calc(80px + var(--safe-bottom));
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overscroll-behavior: none;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header {
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(26,26,26,0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: calc(1rem + var(--safe-top)) 1rem 1rem;
    position: sticky;
    top: 60px; /* Ajustado para que el banner no lo cubra */
    z-index: 50;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,197,66,0.3), transparent);
}

.header-content {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: center;
    margin: 0 0.5rem;
}

.logo-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-glow-gold);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(245, 197, 66, 0.3);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.refresh-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.refresh-btn:hover {
    background: var(--gold);
    color: var(--bg-primary);
    transform: scale(1.05);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn svg {
    width: 22px;
    height: 22px;
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

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

.header-subtitle {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.main-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-elegant);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-elegant), var(--shadow-glow-gold);
}

.bccr-card {
    background: linear-gradient(145deg, #1e1e1e 0%, #121212 100%);
    border: 1px solid rgba(245,197,66,0.1);
    position: relative;
    overflow: hidden;
}

.bccr-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
}

.bccr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.bccr-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-icon {
    width: 14px;
    height: 14px;
}

.card-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rate-display {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 1.5rem 1rem;
}

.rate-item {
    text-align: center;
    position: relative;
}

.rate-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.rate-label .label-highlight {
    color: var(--gold);
    font-weight: 700;
}

.rate-value {
    font-size: 2.2rem;
    font-weight: 700;
    display: block;
    line-height: 1;
    transition: transform 0.2s ease;
}

.rate-item:hover .rate-value {
    transform: scale(1.05);
}

.rate-value.compra {
    color: var(--green);
    text-shadow: var(--shadow-glow-green);
}

.rate-value.venta {
    color: var(--red);
    text-shadow: var(--shadow-glow-red);
}

.rate-divider {
    width: 1px;
    height: 50px;
    background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.rate-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.65rem;
    color: var(--text-muted);
}

.calendar-icon {
    width: 12px;
    height: 12px;
}

.best-rates-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.best-rates-card {
    padding: 0;
    overflow: hidden;
    position: relative;
}

.best-rates-card:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green), transparent);
}

.best-rates-card:last-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red));
}

.best-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.best-icon {
    width: 16px;
    height: 16px;
}

.best-icon.up {
    color: var(--green);
    filter: drop-shadow(0 0 4px var(--green));
}

.best-icon.down {
    color: var(--red);
    filter: drop-shadow(0 0 4px var(--red));
}

.best-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.best-title .best-label {
    color: var(--gold);
    font-weight: 700;
}

.best-title .best-action {
    color: var(--gold);
    font-weight: 700;
}

.best-rates-list {
    display: flex;
    flex-direction: column;
}

.best-rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
}

.best-rate-item:hover {
    background: rgba(255,255,255,0.02);
}

.best-rate-item:last-child {
    border-bottom: none;
}

.best-rate-name {
    font-size: 0.7rem;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0.5rem;
}

.best-rate-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.calculator-card {
    padding: 0;
    position: relative;
}

.calculator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.calc-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.calc-icon {
    width: 18px;
    height: 18px;
    color: var(--gold);
}

.calc-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex: 1;
}

.help-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-btn:hover {
    background: var(--gold);
    color: var(--bg-primary);
}

.help-content {
    padding: 1rem 0;
}

.help-step {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.help-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--bg-primary);
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-small .modal-content {
    max-width: 300px;
}

.selected-bank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.bank-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.bank-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    display: none;
}

/* Custom Dropdown Styles */
.custom-dropdown {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.dropdown-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: #1a1a1a;
    color: #ffffff;
    cursor: pointer;
    transition: border-color 0.2s;
    min-height: 44px;
}

.dropdown-selected:hover {
    border-color: var(--gold);
}

.dropdown-selected span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    color: #888;
    transition: transform 0.2s;
}

.dropdown-options {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0 0 8px 8px;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
}

.dropdown-options.active {
    display: block;
}

.dropdown-close-btn {
    position: fixed;
    top: 10px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-category {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #F59E0B;
    background: #252525;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
}
}

.dropdown-option {
    padding: 0.75rem 0.8rem;
    font-size: 0.85rem;
    color: #ffffff;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.dropdown-option:hover {
    background: #333333;
}

.dropdown-option:last-child {
    border-bottom: none;
}

/* Scrollbar for dropdown */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Category labels in dropdown */
.bank-dropdown optgroup {
    background: #1a1a1a;
    color: #F59E0B;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.5rem;
    letter-spacing: 0.5px;
}

.bank-dropdown optgroup option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    margin-left: 0;
    font-weight: 500;
}

.bank-dropdown optgroup:last-child option {
    border-bottom: none;
}

/* Highlight for missing bank selection */
.selected-bank.no-bank-selected {
    border: 1px solid var(--green);
    border-radius: 8px;
    margin: 0.25rem;
    background: var(--bg-primary);
}

@keyframes noBankPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 200, 83, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 200, 83, 0.6); }
}

.selected-bank.flash-warning {
    animation: noBankPulse 0.5s ease-in-out 3;
}

.operation-selector {
    display: flex;
    justify-content: center;
    padding: 0.75rem 1.25rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.operation-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.operation-btn:first-child {
    border-radius: 8px 0 0 8px;
}

.operation-btn:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.operation-btn.active {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.operation-btn#btn-compra.active {
    background: var(--green);
    border-color: var(--green);
}

.operation-btn#btn-venta.active {
    background: var(--red);
    border-color: var(--red);
}

.toggle-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.toggle-label:first-of-type {
    color: var(--green);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-slider::before {
    position: absolute;
    content: '';
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background: var(--gold);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.toggle-switch input:checked + .toggle-slider {
    border-color: var(--gold);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(26px);
}

.toggle-switch input:checked ~ .toggle-label:last-of-type {
    color: var(--red);
}

.toggle-switch input:not(:checked) ~ .toggle-label:first-of-type {
    color: var(--green);
}

.exchange-rate-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin: 0 1.25rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.exchange-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.exchange-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gold);
}

.input-group {
    padding: 0 1.25rem;
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    z-index: 1;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.75rem;
    font-size: 1.25rem;
    font-family: inherit;
    font-weight: 600;
    color: #ffffff;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--green);
}

.input-wrapper input:disabled {
    cursor: not-allowed;
    background: #2a2a2a;
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.result-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    margin: 0 1.25rem 1rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-glow-gold);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.result-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.result-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
}

/* Input highlight for go-to-calculator */
.input-wrapper.input-highlight {
    animation: inputPulse 1.5s ease-in-out;
}

@keyframes inputPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.5); }
}

.share-container {
    padding: 0 1.25rem;
    margin-bottom: 1rem;
}

.share-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dim) 100%);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.4);
}

.share-btn:active {
    transform: scale(0.98);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0 1.25rem 1.25rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-btn span,
.action-btn svg {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.action-btn:active {
    transform: scale(0.98);
    border-color: var(--gold);
}

.action-btn:active::before {
    opacity: 1;
}

.action-btn:active span,
.action-btn:active svg {
    color: #000;
}

.action-btn svg {
    width: 18px;
    height: 18px;
    color: var(--gold);
}

.search-card {
    padding: 0;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-header input {
    flex: 1;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    border: none;
}

.search-header input:focus {
    outline: none;
}

.search-header input::placeholder {
    color: var(--text-muted);
}

.institutions-list {
    max-height: none;
    overflow: visible;
}

.institution-type-header {
    padding: 0.75rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.institution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    touch-action: manipulation;
    position: relative;
}

.institution-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--green), var(--gold), var(--red));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.institution-item:hover {
    background: rgba(255,255,255,0.02);
    padding-left: 1.5rem;
}

.institution-item:hover::before {
    opacity: 1;
}

.institution-type-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease;
}

.institution-type-header:hover {
    background: var(--bg-card-hover);
}

.institution-type-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.institution-type-count {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.institution-type-toggle {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.institution-type-header.collapsed .institution-type-toggle {
    transform: rotate(-90deg);
}

.institution-type-content {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.institution-type-content.collapsed {
    max-height: 0;
}

.institution-item:last-child {
    border-bottom: none;
}

.institution-info {
    flex: 1;
    min-width: 0;
}

.institution-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.institution-type {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.institution-rates {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.institution-rates span {
    font-size: 0.75rem;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.institution-item:hover .institution-rates span {
    transform: scale(1.05);
}

.institution-rates .compra {
    color: var(--green);
}

.institution-rates .venta {
    color: var(--red);
}

.info-card {
    background: var(--bg-card);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.info-icon {
    width: 16px;
    height: 16px;
    color: var(--gold);
}

.info-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-grid {
    padding: 0.75rem 1.25rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.info-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.info-item strong {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-badge {
    background: var(--green);
    color: #000;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
}

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.footer .copyright {
    margin-top: 0.25rem;
    font-size: 0.55rem;
}

.modal-billetera-content {
    max-width: 100%;
    max-height: 90vh;
    margin: 0;
    border-radius: var(--radius) var(--radius) 0 0;
}

.billetera-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.billetes-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    max-height: calc(85vh - 120px);
    padding-bottom: 1rem;
}

.billete-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.billete-front,
.billete-back {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.billete-front img,
.billete-back img {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.billete-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
}

.scanner-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scanner-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: #000;
}

#scanner-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-rectangle {
    width: 80%;
    height: 60px;
    border: 3px solid #ff4d6a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.scanner-rectangle.detected {
    border-color: #00d4aa;
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.5);
}

.scanner-status {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#scanner-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

.scanner-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--text-secondary);
}

.scanner-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

.scanner-results {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px solid var(--border);
}

.scanner-text {
    margin-bottom: 1rem;
}

.scanner-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scanner-text p {
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--text-primary);
    word-break: break-all;
}

.scanner-conversion {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.conversion-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.conversion-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.conversion-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
}

.scanner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.scanner-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scanner-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-glow-gold);
}

.scanner-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.scanner-btn svg {
    width: 20px;
    height: 20px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: linear-gradient(180deg, rgba(26,26,26,0.95) 0%, var(--bg-card) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 0.6rem 0;
    padding-bottom: calc(0.6rem + var(--safe-bottom));
    z-index: 100;
}

.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245,197,66,0.3), transparent);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    touch-action: manipulation;
    min-width: 60px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    width: 30px;
    height: 3px;
    background: var(--gold);
    border-radius: 3px;
    transition: transform 0.3s ease;
}

.nav-btn:active {
    color: var(--gold);
}

.nav-btn:active::before {
    transform: translateX(-50%) scale(1);
}

.nav-btn svg {
    width: 22px;
    height: 22px;
    color: var(--gold);
    transition: transform 0.3s ease;
}

.nav-btn:active svg {
    transform: scale(1.1);
}

.nav-btn:hover svg {
    filter: drop-shadow(0 0 8px rgba(245, 197, 66, 0.6));
}

.nav-btn .flag-emoji {
    font-size: 1.3rem;
    line-height: 1;
}

#nav-pais .flag-emoji {
    font-size: 1.5rem;
}

.nav-btn span {
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gold);
}

.flag-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.flag-icon {
    width: 22px;
    height: 16px;
    border-radius: 2px;
    display: inline-block;
}

.flag.cr {
    background: linear-gradient(to bottom, #CE1126 25%, #fff 25%, #fff 50%, #0038A8 50%, #0038A8 75%, #CE1126 75%);
}

.lang-dropdown-container {
    position: relative;
}

.lang-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 140px;
    box-shadow: var(--shadow-elegant);
    z-index: 150;
    animation: dropdownFadeIn 0.2s ease;
}

.lang-dropdown.active {
    display: flex;
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.lang-option:hover {
    background: rgba(245, 197, 66, 0.1);
}

.lang-option.selected {
    background: rgba(245, 197, 66, 0.15);
    color: var(--gold);
}

.lang-option .flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
}

#current-lang-flag {
    width: 22px;
    height: 16px;
    border-radius: 2px;
}

.location-dropdown-container {
    position: relative;
}

.location-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    min-width: 180px;
    box-shadow: var(--shadow-elegant);
    z-index: 150;
    animation: dropdownFadeIn 0.2s ease;
}

.location-dropdown.active {
    display: flex;
}

.location-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.location-option:hover {
    background: rgba(245, 197, 66, 0.1);
}

.location-option svg {
    width: 18px;
    height: 18px;
    color: var(--gold);
    flex-shrink: 0;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
    align-items: flex-end;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-elegant);
}

.modal-content.modal-centered {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(245,197,66,0.05) 0%, transparent 100%);
}

.modal-header h3 {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
    color: var(--gold);
    transform: rotate(90deg);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 1.25rem;
    max-height: calc(90vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.detail-row:hover {
    border-color: var(--border-light);
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 700;
    transition: transform 0.2s ease;
}

.detail-row:hover .detail-value {
    transform: scale(1.05);
}

.detail-value.compra {
    color: var(--green);
    text-shadow: var(--shadow-glow-green);
}

.detail-value.venta {
    color: var(--red);
    text-shadow: var(--shadow-glow-red);
}

.detail-row.diferencial {
    background: linear-gradient(135deg, rgba(245, 197, 66, 0.15) 0%, rgba(201, 162, 39, 0.1) 100%);
    border-color: var(--gold);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glow-gold);
}

.detail-row.diferencial .detail-label,
.detail-row.diferencial .detail-value {
    color: var(--gold);
}

.modal-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-btn:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-glow-gold);
}

.modal-btn:active::before {
    opacity: 1;
}

.maps-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.map-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: calc(50% - 0.4rem);
    padding: 1rem 0.5rem;
    margin: 0;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    flex-direction: column;
}

.map-buttons-container {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-top: 10px;
}

.map-btn:active {
    border-color: var(--gold);
    background: var(--bg-card);
}

.map-btn svg {
    width: 24px;
    height: 24px;
}

.map-icon-img {
    width: 140px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 8px;
}

.map-btn span {
    font-size: 0.8rem;
}

.map-btn.waze {
    background: #33CCFF;
    border-color: #33CCFF;
    color: #000;
}

.map-btn.waze .map-icon-img {
    width: 120px;
    height: 36px;
}

.map-btn.waze:active {
    background: #22BBEE;
}

.modal-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    z-index: 300;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

.modal-fullscreen.active {
    display: flex;
}

.modal-header-lang {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(245,197,66,0.05) 0%, transparent 100%);
}

.modal-header-lang h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-header-large {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(26,26,26,0.95) 100%);
    backdrop-filter: blur(10px);
}

.modal-header-large h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.modal-close:hover {
    opacity: 1;
    color: var(--gold);
}

.modal-close svg {
    width: 24px;
    height: 24px;
}

.lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
    padding-bottom: calc(1.5rem + 70px + var(--safe-bottom));
    overflow-y: auto;
    height: calc(100vh - var(--safe-top));
}

.lang-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    min-height: 100px;
}

.lang-btn:hover, .lang-btn:active {
    border-color: var(--gold);
    background: rgba(245, 197, 66, 0.1);
}

.lang-btn.selected {
    border-color: var(--gold);
    background: rgba(245, 197, 66, 0.15);
    box-shadow: var(--shadow-glow-gold);
}

.lang-btn .flag {
    width: 48px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

.flag-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.flag-svg {
    width: 70px;
    height: 90px;
}

.lang-btn .flag-svg {
    transition: transform 0.3s ease;
}

.lang-btn:hover .flag-svg {
    transform: scale(1.1);
}

.lang-btn.selected .flag-svg {
    transform: scale(1.1);
}

    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

.flag {
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.flag-es { background: linear-gradient(to bottom, #AA151B 25%, #F1BF00 25%, #F1BF00 75%, #AA151B 75%); }
.flag-en { background: linear-gradient(to bottom, #B22234 14.28%, #fff 14.28%, #fff 28.56%, #B22234 28.56%, #B22234 42.84%, #fff 42.84%, #fff 57.12%, #B22234 57.12%, #B22234 71.4%, #fff 71.4%, #fff 85.68%, #B22234 85.68%); position: relative; }
.flag-en::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 40%; background: #3C3B6E; }
.flag-fr { background: linear-gradient(to right, #002395 33.33%, #fff 33.33%, #fff 66.66%, #ED2939 66.66%); }
.flag-de { background: linear-gradient(to bottom, #000 33.33%, #DD0000 33.33%, #DD0000 66.66%, #FFCC00 66.66%); }
.flag-pt { background: #009b3a; position: relative; }
.flag-pt::before { content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 45%; background: #fedf00; }
.flag-pt::after { content: ''; position: absolute; top: 15%; left: 15%; width: 40%; height: 70%; background: #002776; border-radius: 50%; }
.flag-zh { background: #DE2910; position: relative; }
.flag-zh::before { content: ''; position: absolute; top: 12%; left: 12%; width: 28%; height: 28%; background: #FFDE00; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }

.ubicaciones-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    padding-top: calc(1.5rem + var(--safe-top));
    padding-bottom: calc(1.5rem + 70px + var(--safe-bottom));
    overflow-y: auto;
    height: calc(100vh - var(--safe-top));
}

.ubicacion-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
    min-height: 100px;
}

.ubicacion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ubicacion-btn:hover {
    border-color: var(--gold);
    background: linear-gradient(145deg, rgba(245, 197, 66, 0.1) 0%, var(--bg-primary) 100%);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), var(--shadow-glow-gold);
}

.ubicacion-btn:hover::before {
    opacity: 1;
}

.ubicacion-btn:active {
    transform: translateY(-2px) scale(1);
}

.ubicacion-btn svg {
    width: 28px;
    height: 28px;
    color: var(--gold);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.ubicacion-btn:hover svg {
    transform: scale(1.2);
}

.ubicacion-btn span {
    text-align: center;
}

.ubicacion-btn.emergencia {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-dim) 100%);
    border-color: var(--red);
    color: #fff;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-glow-red);
}

.ubicacion-btn.emergencia svg {
    color: #fff;
}

.ubicacion-btn.emergencia:hover {
    transform: translateX(5px) scale(1.02);
}

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 1px;
}

.ubicacion-btn:active {
    border-color: var(--gold);
    background: var(--bg-card);
}

.ubicacion-btn svg {
    width: 24px;
    height: 24px;
    color: var(--gold);
    flex-shrink: 0;
}

.ubicacion-btn span {
    flex: 1;
    text-align: left;
}

.ubicacion-btn.emergencia {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
    margin-top: 0.5rem;
}

.ubicacion-btn.emergencia svg {
    color: #fff;
}

@media (max-width: 400px) {
    .best-rates-row {
        grid-template-columns: 1fr;
    }

    .header-title {
        font-size: 1.1rem;
    }

    .rate-value {
        font-size: 1.8rem;
    }
}

@media (max-height: 600px) {
    .institutions-list {
        max-height: 35vh;
    }
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

body.country-mx {
    --bg-primary: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --border: #2a2a2a;
    --border-light: #333333;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --gold: #006847;
    --gold-dark: #004d33;
    --green: #CE1126;
    --green-dim: #a10d1e;
    --red: #CE1126;
    --red-dim: #a10d1e;
    --shadow-glow-gold: 0 0 20px rgba(0, 104, 71, 0.15);
    --shadow-glow-green: 0 0 15px rgba(206, 17, 38, 0.2);
    --shadow-glow-red: 0 0 15px rgba(206, 17, 38, 0.2);
}

.modal-tutorial-content {
    max-width: 90%;
    max-height: 90vh;
}

.tutorial-steps {
    padding: 2rem 0;
}

.tutorial-step {
    text-align: center;
}

.tutorial-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.tutorial-step h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tutorial-step p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tutorial-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-dot.active {
    background: var(--gold);
    transform: scale(1.2);
}

.tutorial-buttons {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
}

.tutorial-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.tutorial-btn.secondary:hover {
    background: var(--bg-card-hover);
}

.tutorial-btn.primary {
    background: var(--gold);
    color: #000;
}

.tutorial-btn.primary:hover {
    background: var(--gold-dark);
}

.institution-type-header {
    padding: 0.75rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

/* Travel Calculator Styles */
.travel-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.travel-tab {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.travel-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.travel-tab-content {
    display: none;
    padding: 1rem 1.25rem;
}

.travel-tab-content.active {
    display: block;
}

.categoria-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.categoria-item {
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.categoria-item.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}

.pago-selector {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pago-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pago-btn.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}

.propina-botones {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
}

.propina-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.propina-btn.active {
    background: var(--gold);
    color: #000;
    border-color: var(--gold);
}

.resumen-card {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

/* Bank Alerts Styles */
.bank-alerts-list {
    max-height: 300px;
    overflow-y: auto;
}

.no-alerts {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

.no-alerts p {
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.add-alert-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--gold);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

.add-alert-btn svg {
    width: 16px;
    height: 16px;
}

.bank-alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    gap: 0.5rem;
}

.bank-alert-item:last-child {
    border-bottom: none;
}

.alert-info {
    flex: 1;
    min-width: 0;
}

.alert-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.alert-banks {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.delete-alert-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-alert-btn svg {
    width: 16px;
    height: 16px;
}

.delete-alert-btn:hover {
    color: #EF4444;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch.small {
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch.small .toggle-slider:before {
    height: 14px;
    width: 14px;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--gold);
    border-color: var(--gold);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background-color: #000;
}

.toggle-switch.small input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Alert Config Modal */
.alert-config-modal {
    max-width: 90%;
    max-height: 85vh;
    margin: auto;
    width: 90%;
    display: flex;
    flex-direction: column;
}

.alert-config-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.alert-config-modal .modal-header h3 {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.alert-config-modal .modal-body {
    padding: 0.75rem 1rem;
    max-height: 55vh;
    overflow-y: auto;
    flex-shrink: 1;
}

.alert-config-modal .modal-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.banks-select-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    background: var(--bg-primary);
}

.bank-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bank-checkbox input {
    accent-color: var(--gold);
}

.btn-secondary {
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    padding: 0.75rem 1.25rem;
    background: var(--gold);
    border: none;
    border-radius: var(--radius-sm);
    color: #000;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--bg-card);
}

.btn-primary:hover {
    background: #D4AF37;
}

/* Menu item content */
.menu-item-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.menu-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* App version */
.app-version {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 0.25rem;
}

.app-copyright {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Floating search button */
.floating-search-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: transform 0.2s, box-shadow 0.2s;
}

.floating-search-btn svg {
    width: 24px;
    height: 24px;
    color: white;
}

.floating-search-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}