/* ── Helikon Bookstores Popup ── */

.hb-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 16px;
}

.hb-popup-overlay.hb-visible {
    opacity: 1;
}

.hb-popup-container {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.hb-popup-overlay.hb-visible .hb-popup-container {
    transform: translateY(0) scale(1);
}

/* ── Close button ── */
.hb-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f3f5;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    transition: all 0.15s ease;
    z-index: 10;
}

.hb-popup-close:hover {
    background: #e9ecef;
    color: #212529;
}

/* ── Header ── */
.hb-popup-header {
    padding: 24px 24px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hb-popup-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2e7d32;
    flex-shrink: 0;
}

.hb-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

/* ── Breadcrumb ── */
.hb-popup-breadcrumb {
    padding: 12px 24px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.hb-breadcrumb-link {
    background: none;
    border: none;
    color: #1976d2;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: none;
    font-weight: 500;
}

.hb-breadcrumb-link:hover {
    text-decoration: underline;
}

.hb-breadcrumb-sep {
    color: #adb5bd;
}

.hb-breadcrumb-current {
    color: #495057;
    font-weight: 600;
}

/* ── Search ── */
.hb-popup-search {
    margin: 16px 24px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.15s ease;
}

.hb-popup-search:focus-within {
    border-color: #90caf9;
    background: #fff;
}

.hb-popup-search svg {
    color: #868e96;
    flex-shrink: 0;
}

.hb-popup-search input {
    border: none;
    outline: none;
    background: transparent;
    flex: 1;
    font-size: 14px;
    color: #212529;
}

.hb-popup-search input::placeholder {
    color: #adb5bd;
}

/* ── Content area ── */
.hb-popup-content {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 200px;
}

/* ── City list ── */
.hb-city-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hb-city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hb-city-item:hover {
    background: #e3f2fd;
    border-color: #bbdefb;
}

.hb-city-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
}

.hb-city-count {
    font-size: 12px;
    color: #868e96;
    background: #e9ecef;
    padding: 2px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.hb-city-item:hover .hb-city-count {
    background: #bbdefb;
    color: #1565c0;
}

/* ── Bookstore cards ── */
.hb-store-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hb-store-card {
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: border-color 0.15s ease;
}

.hb-store-card:hover {
    border-color: #dee2e6;
}

.hb-store-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.hb-store-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.hb-store-address {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
}

/* ── Availability badges ── */
.hb-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.hb-badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hb-badge-available {
    background: #e8f5e9;
    color: #2e7d32;
}

.hb-badge-available .hb-badge-dot {
    background: #43a047;
}

.hb-badge-limited {
    background: #fff8e1;
    color: #e65100;
}

.hb-badge-limited .hb-badge-dot {
    background: #fb8c00;
}

.hb-badge-none {
    background: #ffebee;
    color: #c62828;
}

.hb-badge-none .hb-badge-dot {
    background: #e53935;
}

/* ── Loader / Spinner ── */
.hb-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 12px;
}

.hb-loader p {
    font-size: 13px;
    color: #868e96;
    margin: 0;
}

.hb-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top-color: #1976d2;
    border-radius: 50%;
    animation: hb-spin 0.7s linear infinite;
}

@keyframes hb-spin {
    to { transform: rotate(360deg); }
}

/* ── Empty state ── */
.hb-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #868e96;
}

.hb-empty-state svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.hb-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ── Scrollbar ── */
.hb-popup-content::-webkit-scrollbar {
    width: 6px;
}

.hb-popup-content::-webkit-scrollbar-track {
    background: transparent;
}

.hb-popup-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.hb-popup-content::-webkit-scrollbar-thumb:hover {
    background: #ced4da;
}

/* ── Responsive ── */
@media (max-width: 560px) {
    .hb-popup-container {
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        max-width: 100%;
    }

    .hb-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .hb-popup-header {
        padding: 20px 16px 0;
    }

    .hb-popup-breadcrumb {
        padding: 10px 16px 0;
    }

    .hb-popup-search {
        margin: 12px 16px 0;
    }

    .hb-popup-content {
        padding: 12px 16px 20px;
    }
}
