/* Body class when popup is open */
body.popup-open {
    overflow: hidden;
}

/* ============================================
   Currency Popup Styles
   ============================================ */

/* Popup Overlay - specific to currency popup */
.currency-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
}

.currency-popup-overlay .popup-window {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

.currency-popup-overlay .popup-titlebar {
    background-color: white;
    border-bottom: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.currency-popup-overlay .popup-title {
    font-size: 1.25rem;
    font-weight: 500;
    flex: 1;
    padding: 0 0 0 20px;
}

.currency-popup-overlay .popup-close-button {
    position: relative;
    margin: 12px 0;
    top: 8px;
    left: -15px;
    background: none;
    border: none;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.currency-popup-overlay .popup-close-button:hover {
    background-color: #f5f5f5;
    color: #333;
}

.currency-popup-overlay .popup-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Mobile Responsive for currency popup */
@media (max-width: 768px) {
    .currency-popup-overlay .popup-window {
        width: 100% !important;
        height: 100% !important;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .currency-popup-overlay .popup-titlebar {
        padding: 0;
        margin: 24px 18px 8px 24px;
    }

    .currency-popup-overlay .popup-title {
        font-size: 1.1rem;
    }

    .currency-popup-overlay .popup-content {
        padding: 15px;
    }

    .currency-popup-overlay .popup-close-button {
        margin: 0;
        top: 4px;
        left: -12px;
    }
}

/* ============================================
   Currency Selector Styles
   ============================================ */

/* Currency Selector Container */
.currency-selector-container {
    display: flex;
    align-items: center;
}

.currency-selector-container.compact {
    /* Compact mode for checkout header */
}

/* Currency Selector Styles */
.currency-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.currency-selector:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.currency-icon {
    font-size: 1rem;
}

.currency-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dragonroads-black-text);
}

/* Compact mode adjustments */
.compact .currency-selector {
    padding: 0.25rem 0.5rem;
}

.compact .currency-text {
    font-size: 0.85rem;
}

/* Compact mode - new design with label and change button */
.currency-selector-compact {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.currency-selector-compact:hover {
}

.currency-label {
    font-size: 0.85rem;
    color: var(--dragonroads-black-text);
}

.currency-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dragonroads-black-text);
}

.currency-change-btn {
    margin-left: 0px;
    padding-left: 0px !important;
    text-decoration: underline !important;
    background: none;
    border: none;
    color: var(--dragonroads-tertiary);
    cursor: pointer;
    font-size: 0.85rem;
}

.currency-change-btn:hover {
    color: var(--dragonroads-primary);
}


/* Transparent nav currency selector */
.transparent-nav .currency-selector {
}

.transparent-nav .currency-selector:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.transparent-nav .currency-text {
    color: white;
}

/* Currency Popup Content Styles */
.currency-popup-content {
    padding: 1rem;
    max-height: 70vh;
    overflow-y: auto;
}

.currency-popup-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.currency-section {
    margin-bottom: 2rem;
}

.currency-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dragonroads-black-text);
    margin-bottom: 1rem;
}

.currency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.currency-option {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.currency-option:hover {
    border-color: var(--dragonroads-primary);
    background-color: rgba(188, 1, 76, 0.02);
}

.currency-option.selected {
    border-color: var(--dragonroads-primary);
    background-color: rgba(188, 1, 76, 0.05);
    position: relative;
}

.currency-option.selected::after {
    content: '\2713';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    color: var(--dragonroads-primary);
    font-weight: bold;
    font-size: 1rem;
}

.currency-name {
    font-size: 0.9rem;
    color: var(--dragonroads-black-text);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.currency-code {
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
}

@media (max-width: 768px) {
    .currency-popup-content {
        max-height: none;
    }
}


/* Mobile currency item */
.currency-mobile-item {
    cursor: pointer;
}

.currency-mobile-link {
    cursor: pointer;
}

.transparent-nav .currency-mobile-item .nav-link {
    color: white;
}

.transparent-nav .currency-mobile-item .nav-link:hover {
    color: white;
}

@media (max-width: 768px) {

    .currency-popup-content {
        max-height: none;
    }
    
    /* Compact mode mobile adjustments */
    .currency-selector-compact {
        padding: 0.4rem 0.6rem;
        gap: 0.35rem;
    }
    
    .currency-label {
        font-size: 0.75rem;
    }
    
    .currency-value {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    /* Very small screens - hide label, show only currency and button */
    .currency-label {
        display: none;
    }
}

/* Scrolled state for transparent nav */
.transparent-nav.scrolled .currency-text {
    color: var(--dragonroads-black-text);
}

.transparent-nav.scrolled .currency-selector:hover {
    background-color: rgba(21, 85, 154, 0.1);
}

.transparent-nav.scrolled .currency-mobile-item .nav-link {
    color: var(--dragonroads-black-text);
}

.transparent-nav.scrolled .currency-mobile-item .nav-link:hover {
    color: var(--dragonroads-black-text);
}
