/* ============================================================
   MTQ World Map — Frontend Styles
   ============================================================ */

.mtq-world-map-wrapper {
    font-family: inherit;
    margin: 0 0 2.5rem;
}

/* Heading & subtitle */
.mtq-map-heading {
    text-align:    center;
    font-size:     clamp(1.6rem, 4vw, 2.4rem);
    font-weight:   700;
    color:         #1a2b4a;
    margin:        0 0 0.6rem;
    line-height:   1.2;
}

.mtq-map-sub {
    text-align:   center;
    color:        #64748b;
    max-width:    620px;
    margin:       0 auto 1.75rem;
    line-height:  1.65;
    font-size:    1rem;
}

/* Container */
.mtq-map-outer {
    position:      relative;
    background:    #f1f5f9;
    border-radius: 12px;
    overflow:      hidden;
    border:        1px solid #dde3ec;
    box-shadow:    0 2px 12px rgba(0, 0, 0, 0.06);
}

.mtq-map-canvas {
    width:      100%;
    display:    block;
    min-height: 200px;
}

/* ---- Engine switch (visitor toggle) ---- */
.mtq-engine-switch {
    display:         flex;
    flex-wrap:       wrap;
    gap:             6px;
    padding:         8px 12px;
    background:      rgba(255, 255, 255, 0.98);
    border-bottom:   1px solid #dde3ec;
}

.mtq-engine-switch__btn {
    appearance:      none;
    border:          1px solid #c5cdd6;
    background:      #f8fafc;
    color:           #334155;
    border-radius:   6px;
    padding:         6px 14px;
    font-size:       12px;
    font-weight:     600;
    cursor:          pointer;
    font-family:     inherit;
    line-height:     1.2;
}

.mtq-engine-switch__btn:hover {
    background:      #eef2f7;
    border-color:    #94a3b8;
}

.mtq-engine-switch__btn.is-active {
    background:      #1a2b4a;
    border-color:    #1a2b4a;
    color:           #ffffff;
}

.mtq-engine-switch__btn:focus-visible {
    outline:         2px solid #2271b1;
    outline-offset:  2px;
}

/* ---- Custom marker tooltip (HTML, attached to body) ---- */
.mtq-ct {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    padding: 10px 12px;
    max-width: 280px;
    font-family: inherit;
    color: #0f172a;
}

.mtq-ct__inner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.mtq-ct__img {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    flex: 0 0 auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f8fafc;
}

.mtq-ct__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mtq-ct__body {
    min-width: 0;
}

.mtq-ct__title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.25;
    color: #0f172a;
    margin-bottom: 2px;
}

.mtq-ct__desc {
    font-size: 11.5px;
    line-height: 1.4;
    color: #334155;
}

.mtq-ct__actions {
    margin-top: 6px;
}

.mtq-ct__link {
    font-size: 12px;
    font-weight: 600;
    color: #1a2b4a;
    text-decoration: none;
}

.mtq-ct__link:hover {
    text-decoration: underline;
}

/* ---- Marker cards under map ---- */
.mtq-marker-cards {
    margin-top: 18px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 14px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding: 0 2px 6px; /* keep space for focus ring near the bottom */

    /* Better interaction feel */
    scroll-behavior: smooth;
    touch-action: pan-x;
    overscroll-behavior-x: contain;
    cursor: default;
}

.mtq-marker-cards::-webkit-scrollbar {
    width: 0;
    height: 0;
}

@media (pointer: coarse) {
    .mtq-marker-cards {
        cursor: grab;
    }
}

.mtq-marker-card {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 14px;
    text-align: left;
    display: flex;
    align-items: stretch;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;

    /* Carousel: fixed card width so cards stay on one horizontal row */
    flex: 0 0 auto;
    width: clamp(250px, 28vw, 360px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.mtq-marker-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border-color: #dbe3ee;
}

.mtq-marker-card:focus-visible {
    outline: 3px solid rgba(34, 113, 177, 0.35);
    outline-offset: 2px;
}

.mtq-marker-card__body {
    display: grid;
    grid-template-columns: 28px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
    row-gap: 6px;
    width: 100%;
}

.mtq-marker-card {
    --mtq-marker-color: #1a2b4a;
}

.mtq-marker-card__icon {
    grid-row: 1 / span 3;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--mtq-marker-color) 15%, #ffffff);
    position: relative;
}

.mtq-marker-card__icon::after {
    content: '';
    position: absolute;
    inset: 9px;
    border-radius: 50%;
    background: var(--mtq-marker-color);
}

.mtq-marker-card__title {
    display: block;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
    color: #0f172a;
}

.mtq-marker-card__desc {
    display: block;
    font-size: 12.5px;
    line-height: 1.5;
    color: #475569;
}

.mtq-marker-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1a2b4a;
}

.mtq-marker-card__cta::after {
    content: '→';
    font-size: 13px;
    line-height: 1;
}

.mtq-marker-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mtq-marker-card__zoom {
    appearance: none;
    border: 1px solid #d8dee8;
    background: #f8fafc;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #1a2b4a;
    cursor: pointer;
}

.mtq-marker-card__zoom:hover {
    background: #eef2f7;
}

.mtq-marker-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #1a2b4a;
    text-decoration: none;
}

.mtq-marker-card__link::after {
    content: '↗';
    font-size: 11px;
    line-height: 1;
}

.mtq-marker-card__link:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .mtq-marker-card { width: clamp(240px, 46vw, 320px); }
}

@media (max-width: 600px) {
    .mtq-marker-card { width: 82vw; }
}

/* ---- Legend ---- */
.mtq-legend {
    position:        absolute;
    bottom:          20px;
    left:            20px;
    background:      rgba(255, 255, 255, 0.96);
    border-radius:   8px;
    padding:         10px 14px;
    box-shadow:      0 2px 10px rgba(0, 0, 0, 0.10);
    border:          1px solid rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(4px);
    display:         flex;
    flex-direction:  column;
    gap:             7px;
    z-index:         10;
}

.mtq-legend-row {
    display:     flex;
    align-items: center;
    gap:         8px;
    font-size:   10.5px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color:       #374151;
    white-space: nowrap;
}

.mtq-dot {
    width:         10px;
    height:        10px;
    border-radius: 50%;
    display:       inline-block;
    flex-shrink:   0;
}
.mtq-dot--hq    { background: #1a2b4a; }
.mtq-dot--rd    { background: #2e86c1; }
.mtq-dot--sales { background: #8fa3b3; }

/* ---- Stats overlay ---- */
.mtq-stats {
    position:      absolute;
    bottom:        20px;
    right:         20px;
    background:    #1a2b4a;
    border-radius: 10px;
    padding:       16px 22px;
    display:       flex;
    gap:           22px;
    box-shadow:    0 4px 16px rgba(0, 0, 0, 0.22);
    z-index:       10;
}

.mtq-stat {
    display:        flex;
    flex-direction: column;
    align-items:    center;
}

.mtq-stat__number {
    font-size:   2rem;
    font-weight: 700;
    line-height: 1;
    color:       #ffffff;
}

.mtq-stat__label {
    font-size:      9.5px;
    letter-spacing: 0.12em;
    color:          rgba(255, 255, 255, 0.65);
    margin-top:     5px;
    font-weight:    600;
}

/* Google Maps: free bottom corners for zoom + attribution; stats centered at top */
.mtq-map-provider--google .mtq-stats {
    top:       12px;
    bottom:    auto;
    left:      50%;
    right:     auto;
    transform: translateX(-50%);
}

.mtq-map-provider--google .mtq-legend {
    bottom: 56px;
    left:   12px;
    top:    auto;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .mtq-map-canvas         { min-height: 260px !important; }
    .mtq-legend             { padding: 8px 10px; gap: 5px; }
    .mtq-legend-row         { font-size: 9.5px; }
    .mtq-stats              { padding: 10px 14px; gap: 14px; bottom: 12px; right: 12px; }
    .mtq-stat__number       { font-size: 1.5rem; }
    .mtq-map-heading        { font-size: 1.4rem; }

    .mtq-map-provider--google .mtq-stats {
        top:       8px;
        bottom:    auto;
        left:      50%;
        right:     auto;
        transform: translateX(-50%);
        padding:   8px 12px;
        gap:       12px;
    }
    .mtq-map-provider--google .mtq-legend {
        bottom: 50px;
        left: 8px;
        padding: 8px 10px;
    }
}
