/* ========================================
   CURRENCY SELECTOR STYLES
   ======================================== */
.currency-selector {
    position: relative;
    z-index: 1001;
}

.currency-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-light);
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.currency-btn:hover {
    background: var(--white);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.currency-btn:active {
    transform: scale(0.96);
}

.currency-btn i:first-child {
    font-size: 0.875rem;
}

.currency-btn i:last-child {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.currency-btn.active i:last-child {
    transform: rotate(180deg);
}

#currentCurrency {
    font-weight: 700;
    min-width: 35px;
    text-align: center;
}

.currency-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
    overflow: hidden;
}

.currency-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.currency-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

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

.currency-option:hover {
    background: var(--bg-light);
}

.currency-option:active {
    background: var(--bg-hover);
    transform: scale(0.98);
}

.currency-option.active {
    background: linear-gradient(135deg, #FFF5F5, #FFE8E8);
    color: var(--primary-color);
    font-weight: 600;
}

.currency-option.active i {
    color: var(--primary-color);
}

.currency-option i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.currency-option span {
    flex: 1;
}

/* Mostrar versión completa por defecto, ocultar corta */
.currency-name-short {
    display: none;
}

.currency-name-full {
    display: inline;
}

/* ========================================
   TABLET OPTIMIZATIONS (968px - 769px)
   ======================================== */
@media (max-width: 968px) {
    .currency-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
        border-radius: 18px;
        gap: 0.3rem;
    }
    
    .currency-btn i:first-child {
        font-size: 0.75rem;
    }
    
    .currency-btn i:last-child {
        font-size: 0.6rem;
    }
    
    #currentCurrency {
        font-size: 0.7rem;
        min-width: 28px;
    }
    
    .currency-dropdown {
        min-width: 180px;
        right: 0;
        top: calc(100% + 0.6rem);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
    
    .currency-option {
        padding: 0.75rem 0.9rem;
        font-size: 0.8rem;
        gap: 0.6rem;
    }
    
    .currency-option i {
        font-size: 0.85rem;
    }
}

/* ========================================
   MOBILE OPTIMIZATIONS (768px - 481px)
   ======================================== */
@media (max-width: 768px) {
    .currency-selector {
        position: relative;
    }
    
    .currency-btn {
        padding: 0.4rem 0.55rem;
        font-size: 0.75rem;
        border-radius: 16px;
        gap: 0.25rem;
        background: transparent;
        border: 1.5px solid var(--border-color);
        min-height: 34px;
    }
    
    .currency-btn:hover {
        background: var(--bg-light);
        border-color: var(--primary-color);
    }
    
    .currency-btn:active {
        background: var(--bg-hover);
        transform: scale(0.95);
    }
    
    .currency-btn i:first-child {
        font-size: 0.75rem;
    }
    
    .currency-btn i:last-child {
        font-size: 0.6rem;
    }
    
    #currentCurrency {
        font-size: 0.7rem;
        min-width: 26px;
        font-weight: 800;
    }
    
    .currency-dropdown {
        min-width: 140px;
        max-width: 170px;
        right: 0;
        top: calc(100% + 0.5rem);
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    }
    
    .currency-option {
        padding: 0.7rem 0.8rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    .currency-option i {
        font-size: 0.85rem;
        width: 15px;
    }
    
    .currency-option span {
        font-size: 0.8rem;
    }
    
    /* Mostrar solo versión corta en móviles */
    .currency-name-full {
        display: none;
    }
    
    .currency-name-short {
        display: inline;
        font-weight: 700;
        font-size: 0.8rem;
    }
}

/* ========================================
   SMALL MOBILE (480px and below)
   ======================================== */
@media (max-width: 480px) {
    .currency-selector {
        position: relative;
    }
    
    .currency-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
        border-radius: 14px;
        gap: 0.2rem;
        background: transparent;
        border: 1.5px solid var(--border-color);
        min-height: 32px;
    }
    
    .currency-btn i:first-child {
        font-size: 0.7rem;
    }
    
    .currency-btn i:last-child {
        font-size: 0.55rem;
    }
    
    #currentCurrency {
        font-size: 0.65rem;
        min-width: 24px;
        font-weight: 800;
    }
    
    .currency-dropdown {
        min-width: 125px;
        max-width: 145px;
        right: 0;
        top: calc(100% + 0.5rem);
        border-radius: 10px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }
    
    .currency-option {
        padding: 0.65rem 0.75rem;
        font-size: 0.75rem;
        gap: 0.45rem;
        min-height: 42px;
    }
    
    .currency-option i {
        font-size: 0.8rem;
        width: 14px;
    }
    
    /* Mostrar solo versión corta en móviles */
    .currency-name-full {
        display: none;
    }
    
    .currency-name-short {
        display: inline;
        font-weight: 700;
        font-size: 0.75rem;
    }
}

/* ========================================
   EXTRA SMALL MOBILE (360px and below)
   ======================================== */
@media (max-width: 360px) {
    .currency-btn {
        padding: 0.3rem 0.45rem;
        font-size: 0.65rem;
        border-radius: 12px;
        gap: 0.18rem;
        min-height: 30px;
    }
    
    .currency-btn i:first-child {
        font-size: 0.65rem;
    }
    
    .currency-btn i:last-child {
        font-size: 0.5rem;
    }
    
    #currentCurrency {
        font-size: 0.6rem;
        min-width: 22px;
    }
    
    .currency-dropdown {
        min-width: 115px;
        max-width: 135px;
        right: 0;
        top: calc(100% + 0.4rem);
        border-radius: 10px;
    }
    
    .currency-option {
        padding: 0.6rem 0.7rem;
        font-size: 0.7rem;
        gap: 0.4rem;
        min-height: 40px;
    }
    
    .currency-option i {
        font-size: 0.75rem;
        width: 13px;
    }
    
    .currency-option span {
        font-size: 0.7rem;
    }
}

/* ========================================
   TOUCH OPTIMIZATIONS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
    /* Optimizado para dispositivos táctiles */
    .currency-btn {
        min-height: 44px; /* Área táctil mínima recomendada */
        -webkit-tap-highlight-color: rgba(255, 107, 107, 0.1);
    }
    
    .currency-option {
        min-height: 48px; /* Área táctil cómoda */
        -webkit-tap-highlight-color: rgba(255, 107, 107, 0.1);
    }
    
    .currency-btn:hover {
        background: transparent;
        border-color: var(--border-color);
    }
    
    .currency-btn:active {
        background: var(--bg-light);
        border-color: var(--primary-color);
    }
}

/* ========================================
   LANDSCAPE MOBILE
   ======================================== */
@media (max-height: 600px) and (orientation: landscape) {
    .currency-dropdown {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .currency-option {
        padding: 0.65rem 0.9rem;
        min-height: 42px;
    }
}
