/* ============================================================
   Country Currency Switcher – Popup Styles
   ============================================================ */

/* Overlay */
.ccs-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ccs-overlay.ccs-visible {
    opacity: 1;
}
.ccs-overlay.ccs-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Popup card */
.ccs-popup {
    background: var(--ccs-bg, #ffffff);
    color: var(--ccs-text, #111827);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ccs-overlay.ccs-visible .ccs-popup {
    transform: translateY(0) scale(1);
}

/* Close button */
.ccs-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(0,0,0,0.07);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    color: var(--ccs-text, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    line-height: 1;
}
.ccs-close:hover { background: rgba(0,0,0,0.14); }

/* Header */
.ccs-popup__header {
    text-align: center;
    padding: 36px 28px 16px;
    background: linear-gradient(135deg, var(--ccs-accent, #2563eb) 0%, color-mix(in srgb, var(--ccs-accent, #2563eb) 70%, #000) 100%);
    color: #fff;
}
.ccs-popup__globe {
    font-size: 42px;
    margin-bottom: 10px;
    display: block;
    animation: ccs-spin 6s linear infinite;
}
@keyframes ccs-spin {
    0%   { transform: rotate(0deg);   }
    25%  { transform: rotate(5deg);   }
    75%  { transform: rotate(-5deg);  }
    100% { transform: rotate(0deg);   }
}
.ccs-popup__title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}
.ccs-popup__subtitle {
    margin: 0;
    font-size: 14px;
    color: rgba(255,255,255,0.85);
}

/* Search */
.ccs-popup__search-wrap {
    position: relative;
    padding: 14px 16px 8px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.ccs-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-30%);
    font-size: 15px;
    pointer-events: none;
    opacity: 0.5;
}
.ccs-popup__search {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: var(--ccs-text, #111827);
    background: #f9fafb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.ccs-popup__search:focus {
    border-color: var(--ccs-accent, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ccs-accent, #2563eb) 15%, transparent);
    background: #fff;
}

/* Country list */
.ccs-popup__list {
    overflow-y: auto;
    flex: 1;
    padding: 6px 8px;
    max-height: 320px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}
.ccs-popup__list::-webkit-scrollbar { width: 5px; }
.ccs-popup__list::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

/* Country item */
.ccs-country-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid transparent;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--ccs-text, #111827);
    text-align: left;
    transition: background 0.15s, border-color 0.15s;
    margin-bottom: 2px;
}
.ccs-country-item:hover {
    background: color-mix(in srgb, var(--ccs-accent, #2563eb) 8%, transparent);
}
.ccs-country-item.ccs-selected {
    background: color-mix(in srgb, var(--ccs-accent, #2563eb) 12%, transparent);
    border-color: var(--ccs-accent, #2563eb);
}
.ccs-flag { font-size: 22px; flex-shrink: 0; line-height: 1; }
.ccs-country-name { flex: 1; font-weight: 500; }
.ccs-currency-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--ccs-accent, #2563eb);
    background: color-mix(in srgb, var(--ccs-accent, #2563eb) 10%, transparent);
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* No results */
.ccs-no-results {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: 14px;
}

/* Footer */
.ccs-popup__footer {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid rgba(0,0,0,0.06);
}
.ccs-btn-primary {
    width: 100%;
    padding: 13px;
    background: var(--ccs-accent, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}
.ccs-btn-primary:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }
.ccs-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.ccs-btn-skip {
    width: 100%;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.ccs-btn-skip:hover { color: #6b7280; }

/* Loader */
.ccs-popup__loader {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
    border-radius: 20px;
}
.ccs-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ccs-accent, #2563eb);
    border-radius: 50%;
    animation: ccs-rotate 0.7s linear infinite;
}
@keyframes ccs-rotate {
    to { transform: rotate(360deg); }
}

/* ── Floating widget ──────────────────────────────────────── */
.ccs-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 50px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: 99998;
    transition: box-shadow 0.2s, transform 0.2s;
    user-select: none;
}
.ccs-widget:hover {
    box-shadow: 0 6px 28px rgba(0,0,0,0.18);
    transform: translateY(-2px);
}

/* ── Toast notification ───────────────────────────────────── */
.ccs-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: #111827;
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 999999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.ccs-toast.ccs-toast-show {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 520px) {
    .ccs-popup { max-height: 98vh; border-radius: 16px; }
    .ccs-popup__header { padding: 28px 20px 14px; }
    .ccs-popup__globe { font-size: 34px; }
    .ccs-popup__title { font-size: 18px; }
    .ccs-widget { bottom: 14px; right: 14px; }
}
