/* =============================================================================
   mm-map.css  —  Monster Maps Customer Map v2.0.0
   All selectors are scoped under .mm-embed / .mm-root to avoid leaking
   into the host site's theme.
   ============================================================================= */

/* ── Reset inside embed ───────────────────────────────────────────────────── */
.mm-embed *,
.mm-embed *::before,
.mm-embed *::after {
    box-sizing: border-box;
}

.mm-embed {
    font-family: 'DM Sans', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #262626;
    line-height: 1.5;
}

/* ── Layout: left list + right map side-by-side ───────────────────────────── */
.mm-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

/* List panel grows to fill available space */
.mm-list-panel {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    padding: 24px;
}

/* Map panel: default width set by preset/shortcode attr via scoped <style>.
   Height is fixed at 600px — does not use viewport units. */
.mm-map-panel {
    width: 480px; /* default; overridden per-instance */
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: 600px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    overflow: hidden;
}

.mm-map-el {
    width: 100%;
    height: 100%;
}

/* ── Header row ───────────────────────────────────────────────────────────── */
.mm-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.mm-entries-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mm-label {
    font-size: 14px;
    color: #404040;
}

/* Entries dropdown */
.mm-dd-wrap {
    position: relative;
}

.mm-dd-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 14px;
    color: #31252a;
    background: #fff;
    cursor: pointer;
    min-width: 70px;
    transition: background .15s;
}
.mm-dd-btn:hover { background: #fafafa; }

.mm-dd {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    overflow: hidden;
    z-index: 50;
    min-width: 80px;
    animation: mmDropIn .13s ease;
}

.mm-dd-item {
    padding: 8px 16px;
    font-size: 14px;
    color: #404040;
    cursor: pointer;
    transition: background .12s;
}
.mm-dd-item:hover     { background: #fafafa; }
.mm-dd-item.mm-dd-active { color: #6d28d9; font-weight: 600; }

/* Search + filter row */
.mm-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.mm-search-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
    max-width: 260px;
}

.mm-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #a3a3a3;
    pointer-events: none;
}

.mm-search-input {
    width: 100%;
    padding: 8px 14px 8px 34px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-size: 14px;
    color: #262626;
    background: #fff;
    outline: none;
    transition: box-shadow .15s;
    font-family: inherit;
}
.mm-search-input::placeholder { color: #a3a3a3; }
.mm-search-input:focus { box-shadow: 0 0 0 2px rgba(109,40,217,.25); border-color: #6d28d9; }

.mm-divider {
    width: 1px;
    height: 28px;
    background: #e5e5e5;
    display: none;
}
@media (min-width: 480px) { .mm-divider { display: block; } }

/* Filter button + popup */
.mm-filter-wrap { position: relative; }

.mm-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-size: 14px;
    color: #404040;
    background: #fff;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    font-family: inherit;
}
.mm-filter-btn:hover           { background: #fafafa; }
.mm-filter-btn.mm-filter-btn-active {
    border-color: #6d28d9;
    background: #ede9fe;
    color: #6d28d9;
}
.mm-filter-label { display: none; }
@media (min-width: 600px) { .mm-filter-label { display: inline; } }

.mm-filter-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    padding: 20px;
    width: 320px;
    animation: mmPopIn .15s ease;
}

.mm-filter-title {
    font-size: 11px;
    font-weight: 700;
    color: #737373;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 14px;
}

.mm-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.mm-filter-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mm-filter-lbl {
    font-size: 10px;
    font-weight: 600;
    color: #525252;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mm-filter-input {
    padding: 6px 10px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-size: 13px;
    color: #262626;
    outline: none;
    font-family: inherit;
    transition: box-shadow .15s;
}
.mm-filter-input:focus { box-shadow: 0 0 0 2px rgba(109,40,217,.25); border-color: #6d28d9; }

.mm-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.mm-btn-clear {
    flex: 1;
    padding: 8px;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    font-size: 13px;
    color: #525252;
    background: #fff;
    cursor: pointer;
    transition: background .12s;
    font-family: inherit;
}
.mm-btn-clear:hover { background: #fafafa; }

.mm-btn-apply {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #6d28d9;
    cursor: pointer;
    transition: background .12s;
    font-family: inherit;
}
.mm-btn-apply:hover { background: #7c3aed; }

/* ── Loading / empty states ───────────────────────────────────────────────── */
.mm-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 48px 0;
    justify-content: center;
    font-size: 14px;
    color: #737373;
}

.mm-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-top-color: #6d28d9;
    border-radius: 50%;
    animation: mmSpin .7s linear infinite;
}

.mm-empty {
    grid-column: 1 / -1;
    padding: 48px 0;
    text-align: center;
    font-size: 14px;
    color: #a3a3a3;
}

/* Async full-load progress bar */
.mm-fullload-bar {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f5f3ff;
    border-radius: 8px;
    font-size: 12px;
    color: #6d28d9;
}
.mm-fullload-inner {
    flex: 1;
    height: 3px;
    background: #ddd6fe;
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}
.mm-fullload-inner::after {
    content: '';
    position: absolute;
    left: -40%;
    width: 40%;
    height: 100%;
    background: #6d28d9;
    border-radius: 99px;
    animation: mmSlide 1s ease-in-out infinite;
}

/* ── Card grid ────────────────────────────────────────────────────────────── */
.mm-grid {
    display: grid;
    grid-template-columns: 1fr; /* overridden per-instance via scoped <style> */
    gap: 16px;
}

.mm-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow .2s, transform .2s, border-color .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.mm-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.mm-card-selected {
    border-color: #6d28d9 !important;
    box-shadow: 0 0 0 3px rgba(109,40,217,.18), 0 4px 16px rgba(0,0,0,.08) !important;
}

.mm-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    flex: 1;
}

/* ── Shared field styles ──────────────────────────────────────────────────── */
.mm-field-name {
    font-size: 15px;
    font-weight: 600;
    color: #262626;
    line-height: 1.3;
}

.mm-field-address {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    font-size: 12.5px;
    color: #737373;
}

.mm-addr-icon {
    width: 14px;
    height: 14px;
    color: #da0a28;
    flex-shrink: 0;
    margin-top: 1px;
}

.mm-field-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mm-cat-pill {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #ede9fe;
    color: #6d28d9;
}

/* Review — card context */
.mm-field-review-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 8px 12px;
}

/* Review — bubble context */
.mm-field-review-bubble {
    background: #fafafa;
    border-radius: 8px;
    padding: 8px 12px;
}

.mm-review-stars {
    display: flex;
    gap: 1px;
    line-height: 1;
    margin-bottom: 4px;
}

.mm-review-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}

.mm-review-author {
    font-size: 12px;
    font-weight: 600;
    color: #404040;
}

.mm-review-body {
    font-size: 12px;
    color: #525252;
    line-height: 1.6;
    max-height: 100px;
    overflow-y: auto;
}

/* Bubble review body uses same dark text as card since bg is now light */
.mm-field-review-bubble .mm-review-body { color: #525252; }

.mm-field-no-review {
    font-size: 12px;
    color: #a3a3a3;
    font-style: italic;
    margin: 0;
}

/* Button & link fields */
.mm-field-button { margin-top: 4px; }
.mm-btn {
    display: inline-block;
    background: #da3831;
    color: #fff;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: background .15s;
}
.mm-btn:hover { background: #b91c1c; }

.mm-field-link a {
    font-size: 13px;
    color: #6d28d9;
    text-decoration: underline;
}

.mm-field-generic {
    font-size: 13px;
    color: #525252;
}
.mm-field-lbl {
    font-weight: 600;
    color: #404040;
}

/* ── Image carousel (shared by card + bubble) ─────────────────────────────── */
.mm-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e5e5e5;
    overflow: hidden;
    flex-shrink: 0;
}

.mm-bubble-img-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    background: #e5e5e5;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
}

.mm-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity .2s ease;
}

.mm-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a3a3a3;
    font-size: 12px;
}

/* Carousel nav arrows */
.mm-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.35);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background .15s;
    padding: 0;
}
.mm-nav:hover       { background: rgba(0,0,0,.55); }
.mm-nav-left        { left: 8px; }
.mm-nav-right       { right: 8px; }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.mm-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.mm-pinfo {
    font-size: 13px;
    color: #525252;
}

.mm-page-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mm-page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
    color: #404040;
    cursor: pointer;
    transition: background .12s;
    padding: 0;
}
.mm-page-btn:hover     { background: #fafafa; }
.mm-page-btn:disabled  { opacity: .4; cursor: not-allowed; }

.mm-page-text {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #404040;
}

.mm-page-input {
    width: 48px;
    padding: 4px 6px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    text-align: center;
    font-size: 13px;
    color: #262626;
    outline: none;
    font-family: inherit;
}
.mm-page-input:focus { box-shadow: 0 0 0 2px rgba(109,40,217,.2); border-color: #6d28d9; }

/* ── Map marker (OverlayView) ─────────────────────────────────────────────── */
.mm-marker {
    position: absolute;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    cursor: pointer;
    transition: transform .15s ease;
    z-index: 10;
}
.mm-marker:hover         { transform: translate(-50%,-100%) scale(1.1); }
.mm-marker.mm-marker-active { transform: translate(-50%,-100%) scale(1.4); z-index: 999; }

/* ── Bubble popup (OverlayView) ───────────────────────────────────────────── */
.mm-bubble {
    position: absolute;
    transform: translate(-50%, -118%);
    z-index: 9999;
    width: 288px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.1);
    background: #fff;
    animation: mmBubblePop .18s ease;
    font-family: 'DM Sans', system-ui, sans-serif;
}

.mm-bubble-inner {
    display: flex;
    flex-direction: column;
    max-height: 420px;
    overflow-y: auto;
}

.mm-bubble-overlay-top {
    position: relative;
    padding: 12px;
    background: #fff;
}

.mm-bubble-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #374151;
    font-size: 13px;
    flex-shrink: 0;
    transition: background .12s;
    padding: 0;
    z-index: 2;
}
.mm-bubble-close:hover { background: #e5e7eb; }

.mm-bubble-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 34px; /* clear the close button */
}

/* Review body scrollbar inside bubble */
.mm-bubble .mm-review-body::-webkit-scrollbar      { width: 4px; }
.mm-bubble .mm-review-body::-webkit-scrollbar-thumb { background: #c4b5fd; border-radius: 99px; }
.mm-bubble .mm-review-body::-webkit-scrollbar-track { background: #f3f4f6; }

/* ── Error ────────────────────────────────────────────────────────────────── */
.mm-map-error {
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-family: system-ui, sans-serif;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes mmDropIn {
    from { opacity:0; transform:translateY(-4px); }
    to   { opacity:1; transform:translateY(0); }
}
@keyframes mmPopIn {
    from { opacity:0; transform:translateY(-6px) scale(.97); }
    to   { opacity:1; transform:translateY(0) scale(1); }
}
@keyframes mmBubblePop {
    from { opacity:0; transform:translate(-50%,-112%) scale(.96); }
    to   { opacity:1; transform:translate(-50%,-118%) scale(1); }
}
@keyframes mmSpin {
    to { transform: rotate(360deg); }
}
@keyframes mmSlide {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ── Google Places autocomplete z-index fix ───────────────────────────────── */
.pac-container { z-index: 9999 !important; }
