/* =====================================================
   SolarisKit NA Geolocation Popup
   Uses root CSS variables from style.css
   ===================================================== */

/* Overlay */
.na-geo-popup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Backdrop */
.na-geo-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Entrance animation */
@keyframes naPopupIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal card */
.na-geo-popup__modal {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 40px 36px 36px;
    box-shadow:
        0 24px 64px rgba(0, 54, 52, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.08);
    animation: naPopupIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
    font-family: var(--primary-font);
    border-top: 4px solid var(--primary-400);
    overflow: hidden;
}

/* Subtle brand accent strip */
.na-geo-popup__modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-700) 0%, var(--primary-400) 60%, var(--primary-300) 100%);
}

/* Close button */
.na-geo-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-50);
    border: 1px solid var(--gray-100);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.na-geo-popup__close:hover {
    background: var(--gray-100);
    color: var(--black);
    transform: rotate(90deg);
}

/* Flags row */
.na-geo-popup__flags {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.na-geo-popup__flag {
    width: 52px;
    height: 34px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.na-geo-popup__flag svg {
    width: 100%;
    height: 100%;
    display: block;
}

.na-geo-popup__flag-divider {
    font-size: var(--fs-h5);
    font-weight: var(--fw-bold);
    color: var(--gray-300);
    line-height: 1;
    user-select: none;
}

/* Content */
.na-geo-popup__content {
    margin-bottom: 28px;
    text-align: center;
}

.na-geo-popup__headline {
    font-family: var(--primary-font);
    font-size: var(--fs-h4);
    font-weight: var(--fw-bold);
    color: var(--primary-950);
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.na-geo-popup__body {
    font-size: var(--fs-caption);
    color: var(--gray-600);
    line-height: 1.65;
    margin: 0;
}

.na-geo-popup__body strong {
    color: var(--primary-800);
    font-weight: var(--fw-semi-bold);
    word-break: keep-all;
    white-space: nowrap;
}

/* Actions */
.na-geo-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}

/* Primary CTA — matches .comBtn but full-width */
.na-geo-popup__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    font-family: var(--primary-font);
    font-size: var(--fs-body);
    font-weight: var(--fw-semi-bold);
    letter-spacing: 0.005em;
    color: var(--primary-950);
    background: var(--primary-400);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.25s ease;
    line-height: 1;
}

.na-geo-popup__cta:hover {
    background: var(--primary-300);
    box-shadow: rgba(50, 50, 93, 0.2) 0px 6px 16px -2px, rgba(0, 0, 0, 0.2) 0px 3px 8px -3px;
    transform: translateY(-1px);
    color: var(--primary-950);
}

.na-geo-popup__cta:active {
    transform: translateY(0);
}

.na-geo-popup__cta svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.na-geo-popup__cta:hover svg {
    transform: translateX(3px);
}

/* Dismiss button — matches .comBtnHollow style */
.na-geo-popup__dismiss {
    display: block;
    width: 100%;
    padding: 12px 20px;
    font-family: var(--primary-font);
    font-size: var(--fs-caption);
    font-weight: var(--fw-medium);
    color: var(--gray-500);
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.na-geo-popup__dismiss:hover {
    background: var(--gray-50);
    color: var(--gray-800);
    border-color: var(--gray-300);
}

/* =====================================================
   RTL Support
   ===================================================== */
.rtl-dir .na-geo-popup__modal {
    direction: rtl;
    text-align: right;
}

.rtl-dir .na-geo-popup__close {
    right: auto;
    left: 16px;
}

/* =====================================================
   Responsive — Tablet
   ===================================================== */
@media (max-width: 768px) {
    .na-geo-popup {
        align-items: flex-end;
        padding: 0;
    }

    .na-geo-popup__modal {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
        padding: 32px 24px 28px;
        animation-name: naPopupInMobile;
        border-top: none;
        border-bottom: none;
    }

    @keyframes naPopupInMobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .na-geo-popup__modal::before {
        /* Move accent to top on mobile sheet */
        top: 0;
    }

    /* Drag handle indicator */
    .na-geo-popup__modal::after {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: var(--gray-200);
    }
}

/* =====================================================
   Mobile — Small screens
   ===================================================== */
@media (max-width: 480px) {
    .na-geo-popup__headline {
        font-size: var(--fs-h5);
    }

    .na-geo-popup__modal {
        padding: 28px 20px 24px;
    }
}
