/* POPUP — compact modal panels (replaces fullscreen bottomsheets) */

/* Backdrop overlay */
.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.popup-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Popup panel */
.popup-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 151;
    background: var(--background-color-dark-1);
    border-radius: 20px 20px 0 0;
    padding: 2rem 1.5rem;
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

.popup-panel.active {
    transform: translateY(0);
}

/* Drag handle */
.popup-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto 1.5rem;
}

/* Close button */
.popup-close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.2s ease;
    z-index: 2;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.popup-close svg {
    width: 14px;
    height: 14px;
}

.popup-close svg line {
    stroke: var(--text-color-light-2);
}

/* Typography */
.popup-title {
    font-family: 'Cormorant', serif;
    font-size: 28px;
    line-height: 120%;
    color: var(--text-color-light-1);
    margin-bottom: 0.5rem;
}

.popup-subtitle {
    font-size: 10px;
    line-height: 150%;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-color-light-2);
    margin-bottom: 1.5rem;
}

.popup-text {
    color: var(--text-color-light-2);
    line-height: 160%;
    font-size: 13px;
    margin-bottom: 1.5rem;
}

/* ========================================
   ADDRESS POPUP — navigator buttons
   ======================================== */

.popup-address-value {
    font-family: 'Cormorant', serif;
    font-size: 22px;
    color: var(--text-color-light-1);
    line-height: 130%;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1rem;
}

.popup-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--text-color-light-1);
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
    background: transparent;
}

.popup-nav-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color-light-1);
    text-decoration: none;
}

.popup-nav-btn img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}

.popup-copy-hint {
    font-size: 11px;
    color: var(--text-color-light-2);
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

/* ========================================
   TAXI POPUP
   ======================================== */

.popup-taxi-widget {
    margin: 1.5rem 0;
}

.popup-taxi-widget .ya-taxi-widget_size_s {
    width: 100% !important;
}

/* Geolocation status */
.popup-geo-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 1rem 0 0.5rem;
    font-size: 13px;
    color: var(--text-color-light-2);
}

.popup-geo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f5a623;
    display: inline-block;
    flex-shrink: 0;
    animation: geoPulse 1.2s ease-in-out infinite;
}

.popup-geo-dot.success {
    background: #4cd964;
    animation: none;
}

.popup-geo-dot.error {
    background: #ff3b30;
    animation: none;
}

@keyframes geoPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Taxi CTA button */
.popup-taxi-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin: 1rem 0;
    background: #f5c623;
    color: #000;
    border-radius: 12px;
    font-family: 'Cormorant', serif;
    font-size: 20px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.popup-taxi-btn:hover {
    background: #e5b813;
    color: #000;
    text-decoration: none;
}

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

.popup-taxi-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ========================================
   DELIVERY POPUP
   ======================================== */

/* Yandex Eat badge (inline with app badges) */
.popup-yandex-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 10px;
    background: #fce45e;
    color: #1a1a1a;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

.popup-yandex-badge:hover {
    background: #f5d847;
    color: #1a1a1a;
    text-decoration: none;
}

.popup-yandex-badge:active {
    transform: scale(0.98);
}

.popup-yandex-badge-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.popup-yandex-badge-text {
    line-height: 1;
}

.popup-delivery-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1rem;
}

.popup-delivery-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-color-light-1);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.popup-delivery-link:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color-light-1);
    text-decoration: none;
}

.popup-delivery-link svg {
    width: 16px;
    height: 16px;
    color: var(--text-color-light-2);
    flex-shrink: 0;
}

.popup-app-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 1.5rem;
}

.popup-app-badges img {
    height: 34px;
    border-radius: 5px;
}

/* Desktop — center popup */
@media (min-width: 576px) {
    .popup-panel {
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        width: 400px;
        max-height: 80vh;
        border-radius: 16px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .popup-panel.active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .popup-handle {
        display: none;
    }
}
