/* ── Page Intro ── */
.bs-reg-page-intro {
    margin-bottom: 24px;
}

.bs-reg-page-h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111318;
    margin: 0 0 8px;
}

.bs-reg-page-desc {
    font-size: 14px;
    color: #4b5563;
    margin: 0 0 14px;
    line-height: 1.6;
    max-width: 720px;
}

.bs-reg-jump-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.bs-reg-jump-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1DB0E1;
    background: rgba(29, 176, 225, 0.08);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.bs-reg-jump-link:hover {
    background: rgba(29, 176, 225, 0.15);
    color: #206389;
}

.bs-reg-jump-link svg {
    width: 14px;
    height: 14px;
}

/* ── Two-column Layout ── */
.bs-reg-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: start;
    margin-bottom: 24px;
}

.bs-reg-main {
    min-width: 0;
}

.bs-reg-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Sidebar Cards ── */
.bs-reg-sidebar-card {
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.bs-reg-sidebar-header {
    font-size: 14px;
    font-weight: 700;
    color: #111318;
    padding: 16px 16px 0;
}

.bs-reg-sidebar-body {
    padding: 12px 16px 16px;
}

/* Country dropdown */
#bs-country-select {
    width: 100%;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    outline: none;
}

#bs-country-select:focus {
    border-color: #1DB0E1;
}

/* Country info panel */
#bs-country-info {
    margin-top: 10px;
}

#bs-country-info .bs-map-tt {
    font-size: 13px;
}

#bs-country-info .bs-map-tt strong {
    font-size: 14px;
    display: block;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* Reset button (ID selector to override Elementor button styles) */
#bs-map-reset {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    color: #666;
    font-size: 13px;
    font-weight: 400;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

#bs-map-reset:hover {
    color: #1DB0E1;
    border-color: #1DB0E1;
}

/* Mobile country selector (inside map controls) */
.bs-reg-mobile-country {
    display: none;
}

/* Guide list */
.bs-reg-guide-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bs-reg-guide-list li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    padding: 7px 0;
    border-bottom: 1px solid #f0f1f3;
    line-height: 1.5;
}

.bs-reg-guide-list li:last-child {
    border-bottom: none;
}

.bs-reg-guide-list li img {
    flex-shrink: 0;
    margin-top: 3px;
}

/* Stats */
.bs-reg-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    color: #374151;
    border-bottom: 1px solid #f0f1f3;
}

.bs-reg-stat-row:last-child {
    border-bottom: none;
}

.bs-reg-stat-row img {
    flex-shrink: 0;
}

.bs-reg-stat-count {
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bs-reg-stat-total {
    font-weight: 600;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #e4e7ed;
    border-bottom: none;
}

/* ── Map Wrapper ── */
.bs-reg-map-wrapper {
    max-width: 100%;
    background: #fff;
    border-radius: 20px;
    border: 1px solid #e4e7ed;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
    padding: 24px;
}

.bs-reg-map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.bs-reg-map-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #111318;
}

.bs-reg-map-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bs-reg-map-controls label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

#bs-map-dimension {
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    outline: none;
    min-width: 160px;
}

#bs-map-dimension:focus {
    border-color: #1DB0E1;
}

/* Map container */
#bs-regulation-map {
    width: 100%;
    height: 420px;
    min-height: 200px;
    cursor: grab;
}

#bs-regulation-map:active {
    cursor: grabbing;
}

/* Legend */
.bs-reg-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    margin-top: 8px;
}

.bs-reg-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.bs-reg-legend-block {
    flex-shrink: 0;
}

.bs-reg-legend-label {
    color: #555;
    white-space: nowrap;
}

/* ── Tooltip Override ── */
.jvm-tooltip {
    background: #fff;
    color: #111827;
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 10px 14px;
    font-family: inherit;
    font-size: 13px;
    z-index: 999;
}

/* Tooltip content */
.bs-map-tt {
    min-width: 200px;
    line-height: 1.6;
}

.bs-map-tt strong {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.bs-map-tt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    padding: 2px 0;
}

.bs-map-tt-label {
    color: #6b7280;
    white-space: nowrap;
}

.bs-map-tt-val {
    text-align: right;
}

.bs-map-tt .bs-reg-pill {
    font-size: 11px;
    padding: 1px 7px;
}

/* Mobile country info — slide-up bottom sheet */
.bs-reg-mobile-info {
    display: none;
}

.bs-reg-mobile-info .bs-map-tt {
    font-size: 13px;
}

.bs-reg-mobile-info .bs-map-tt strong {
    font-size: 15px;
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.bs-reg-mobile-info .bs-map-tt-row:last-child {
    padding-bottom: 0;
}

.bs-mobile-info-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f0f1f3;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s, background 0.15s;
}

.bs-mobile-info-close:hover {
    color: #333;
    background: #e4e5e7;
}

/* Two-finger toast */
.bs-map-touch-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 20;
    white-space: nowrap;
    display: none;
}

.bs-map-touch-toast--visible {
    opacity: 1;
}

/* jsvectormap zoom buttons */
.jvm-zoom-btn {
    border-radius: 6px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    width: 28px;
    height: 28px;
    font-size: 16px;
    line-height: 26px;
    text-align: center;
    padding: 0;
    left: 10px;
}

.jvm-zoom-btn.jvm-zoomin {
    top: 10px;
}

.jvm-zoom-btn.jvm-zoomout {
    top: 44px;
}

@media (max-width: 767px) {
    .jvm-zoom-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
        line-height: 34px;
    }
    .jvm-zoom-btn.jvm-zoomout {
        top: 52px;
    }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .bs-reg-layout {
        display: block;
    }
    .bs-reg-main {
        margin-bottom: 16px;
    }
    .bs-reg-sidebar-col {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .bs-reg-mobile-country {
        display: block;
        font-size: 13px;
        padding: 6px 12px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #f8f9fa;
        cursor: pointer;
        outline: none;
        min-width: 160px;
    }
    .bs-reg-mobile-country:focus {
        border-color: #1DB0E1;
    }
    .bs-reg-sidebar-card:has(#bs-country-select) {
        display: none;
    }
    .bs-reg-map-wrapper {
        position: relative;
    }
    .bs-map-touch-toast {
        display: block;
    }
    /* Hide native tooltip on touch — use bottom sheet instead */
    .jvm-tooltip,
    .jvm-tooltip.active {
        display: none;
    }

    .bs-reg-mobile-info {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: #fff;
        border-top: 1px solid #e4e7ed;
        border-radius: 14px 14px 0 0;
        padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .bs-reg-mobile-info::after {
        content: '';
        position: absolute;
        bottom: -100px;
        left: 0;
        right: 0;
        height: 100px;
        background: inherit;
    }

    .bs-reg-mobile-info.bs-reg-mobile-info--active {
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    #bs-regulation-map {
        height: 280px;
    }
    .bs-reg-map-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .bs-reg-map-controls {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .bs-reg-map-controls label {
        display: none;
    }
    #bs-map-dimension,
    .bs-reg-mobile-country {
        min-width: 0;
        flex: 1;
    }
    .bs-reg-map-wrapper {
        padding: 16px;
        border-radius: 14px;
    }
    .bs-reg-map-legend {
        gap: 8px 14px;
    }
    .bs-reg-page-h1 {
        font-size: 22px;
    }
    .bs-reg-sidebar-col {
        grid-template-columns: 1fr;
    }
}

/* ── Dark mode ── */
html.bs-dark .bs-reg-page-h1 {
    color: #e4e4ed;
}

html.bs-dark .bs-reg-page-desc {
    color: #a8a8be;
}

html.bs-dark .bs-reg-jump-link {
    background: rgba(29, 176, 225, 0.12);
    color: #1DB0E1;
}

html.bs-dark .bs-reg-jump-link:hover {
    background: rgba(29, 176, 225, 0.2);
    color: #5fc8f0;
}

html.bs-dark .bs-reg-map-wrapper {
    background: #1c1c30;
    border-color: #2d2d48;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

html.bs-dark .bs-reg-map-title {
    color: #e4e4ed;
}

html.bs-dark .bs-reg-map-controls label {
    color: #8585a0;
}

html.bs-dark #bs-map-dimension {
    background: #262640;
    border-color: #3d3d5c;
    color: #e4e4ed;
}

html.bs-dark #bs-map-dimension:focus {
    border-color: #1DB0E1;
}

html.bs-dark .bs-reg-map-legend {
    border-top-color: #2d2d48;
}

html.bs-dark .bs-reg-legend-label {
    color: #a8a8be;
}

html.bs-dark .jvm-tooltip {
    background: #1c1c30;
    color: #e4e4ed;
    border-color: #2d2d48;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

html.bs-dark .bs-map-tt strong {
    border-bottom-color: rgba(255,255,255,0.1);
}

html.bs-dark .bs-map-tt-label {
    color: #8585a0;
}

html.bs-dark .jvm-zoom-btn {
    background-color: #262640;
    color: #e4e4ed;
    border-color: #3d3d5c;
}

/* Sidebar dark mode */
html.bs-dark .bs-reg-sidebar-header {
    color: #e4e4ed;
}

html.bs-dark #bs-country-select {
    background: #262640;
    border-color: #3d3d5c;
    color: #e4e4ed;
}

html.bs-dark #bs-country-select:focus {
    border-color: #1DB0E1;
}

html.bs-dark #bs-country-info .bs-map-tt strong {
    border-bottom-color: #2d2d48;
}

html.bs-dark #bs-map-reset {
    background: #262640;
    border-color: #3d3d5c;
    color: #8585a0;
}

html.bs-dark #bs-map-reset:hover {
    color: #1DB0E1;
    border-color: #1DB0E1;
}

html.bs-dark .bs-reg-mobile-info {
    background: #1c1c30;
    border-color: #2d2d48;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

html.bs-dark .bs-mobile-info-close {
    background: #2d2d48;
    color: #8585a0;
}

html.bs-dark .bs-mobile-info-close:hover {
    color: #e4e4ed;
    background: #3d3d5c;
}

html.bs-dark .bs-map-touch-toast {
    background: rgba(255, 255, 255, 0.18);
}

html.bs-dark .bs-reg-mobile-info .bs-map-tt strong {
    border-bottom-color: #2d2d48;
}

html.bs-dark .bs-reg-mobile-country {
    background: #262640;
    border-color: #3d3d5c;
    color: #e4e4ed;
}

html.bs-dark .bs-reg-mobile-country:focus {
    border-color: #1DB0E1;
}

html.bs-dark .bs-reg-guide-list li {
    color: #a8a8be;
    border-bottom-color: #2d2d48;
}

html.bs-dark .bs-reg-stat-row {
    color: #e4e4ed;
    border-bottom-color: #2d2d48;
}

html.bs-dark .bs-reg-stat-total {
    border-top-color: #3d3d5c;
}
