/* ── RDS Map (Phase 2, [rds_map] shortcode) ────────────────────────────────── */

.rds-map-wrap {
    --rds-map-blue:       #1a3a6b;
    --rds-map-blue-mid:   #2e5fa3;
    --rds-map-navy-dark:  #0f1f3d;
    --rds-map-green:      #6fa83c;
    --rds-map-border:     #dde1e8;
    margin: 20px 0;
}

.rds-map-locate {
    padding: 8px 10px;
    border: 1px solid var(--rds-map-blue-mid);
    background: #fff;
    color: var(--rds-map-blue-mid);
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.rds-map-locate:hover { background: var(--rds-map-blue-mid); color: #fff; }

.rds-map-show-all {
    width: 100%;
    padding: 8px 16px;
    border: 1px solid var(--rds-map-border);
    background: #fff;
    color: var(--rds-map-blue-mid);
    border-radius: 6px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: underline;
}
.rds-map-show-all:hover { background: #f4f6f9; }

.rds-map-status {
    align-self: center;
    font-size: .8rem;
    color: #6b7280;
    font-style: italic;
}

.rds-map-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.rds-map-sidebar {
    flex: 0 0 300px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rds-map-top-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.rds-map-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.rds-map-search-input {
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid var(--rds-map-border);
    border-radius: 6px;
    font-size: .85rem;
    box-sizing: border-box;
}
.rds-map-search-input::placeholder { font-size: .78rem; color: #6b7280; }
.rds-map-search-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    line-height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #9aa3af;
    font-size: 1.2rem;
    text-align: center;
    cursor: pointer;
}
.rds-map-search-clear:hover { background: #f0f1f3; color: #374151; }

/* Find (top row) and Near me (row directly below) share a fixed width so
   they line up as a matching pair — the most-used actions sit right on top
   of each other instead of scattered around the sidebar. */
.rds-map-search-btn,
.rds-map-locate {
    flex: 0 0 110px;
    text-align: center;
}

.rds-map-search-btn {
    padding: 8px 10px;
    border: none;
    background: var(--rds-map-navy-dark);
    color: #fff;
    border-radius: 6px;
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    cursor: pointer;
}
.rds-map-search-btn:hover { filter: brightness(1.15); }

.rds-map-quick-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.rds-map-count {
    flex: 1 1 auto;
    font-size: .82rem;
    font-weight: 600;
    color: #4b5563;
}

.rds-map-sidebar-sep {
    border: none;
    border-top: 1px solid var(--rds-map-border);
    margin: 2px 0;
}

.rds-map-country-filter,
.rds-map-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rds-map-country-btn {
    padding: 6px 14px;
    border: 1px solid var(--rds-map-blue-mid);
    background: #fff;
    color: var(--rds-map-blue-mid);
    border-radius: 6px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
}
.rds-map-country-btn.is-active { background: var(--rds-map-blue-mid); color: #fff; }
.rds-map-country-count { opacity: .75; font-weight: 500; }

.rds-map-category-pill {
    padding: 5px 12px;
    border: 1px solid var(--rds-map-border);
    background: #fff;
    color: #374151;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 600;
    cursor: pointer;
}
.rds-map-category-pill.is-active { background: var(--rds-map-green); border-color: var(--rds-map-green); color: #fff; }

.rds-map-radius-filter { font-size: .8rem; color: #374151; }
.rds-map-radius-filter label { display: block; margin-bottom: 4px; font-weight: 600; }
.rds-map-radius-input { width: 100%; }

.rds-map-list-toggle {
    display: none;
    padding: 8px 12px;
    border: 1px solid var(--rds-map-border);
    border-radius: 6px;
    background: #fff;
    font-weight: 600;
    font-size: .82rem;
    cursor: pointer;
}

.rds-map-list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Sized to roughly 3 entries so it visually matches the map's height
       instead of towering over it — the rest stay reachable by scrolling. */
    max-height: 300px;
    overflow-y: auto;
}
.rds-map-list-item {
    width: 100%;
    text-align: left;
    padding: 12px 0;
    margin: 0 !important;
    border-bottom: 1px solid var(--rds-map-border);
    cursor: pointer;
    transition: background-color .15s;
}
.rds-map-list-item:last-child { border-bottom: none; }
.rds-map-list-item:hover { background: #f4f6f9; }
.rds-map-list-name { font-weight: 700; font-size: .9rem; color: var(--rds-map-navy-dark); margin-bottom: 3px; }
.rds-map-list-address { font-size: .8rem; color: #6b7280; margin-bottom: 8px; }
.rds-map-list-distance { font-size: .74rem; font-weight: 700; color: var(--rds-map-blue-mid); margin-bottom: 8px; }
.rds-map-list-directions {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #fff !important;
    background: var(--rds-map-green);
    padding: 6px 14px;
    border-radius: 999px;
    text-decoration: none !important;
}
.rds-map-list-directions:hover { filter: brightness(1.1); }

@media (max-width: 780px) {
    .rds-map-layout { flex-direction: column; }
    .rds-map-sidebar { flex: 1 1 auto; max-width: none; width: 100%; }
    .rds-map-list-toggle { display: block; }
    .rds-map-list { display: none; max-height: none; }
    .rds-map-sidebar.is-list-open .rds-map-list { display: flex; }
}

.rds-map-canvas {
    flex: 1 1 480px;
    min-width: 0;
    width: 100%;
    height: var(--rds-map-height, 520px);
    border-radius: 10px;
    border: 0px solid var(--rds-map-border);
}
/* Many WordPress themes apply "img { max-width: 100% }" site-wide for
   responsive images — that also catches Google's own marker/UI images and
   breaks their size and position. Undo it, but only inside our map. */
.rds-map-canvas img { max-width: none !important; }

/* Google wraps our content in its own padded box — remove that padding so
   the banner/logo/card can span edge-to-edge like the brand mock-up. Google
   also caps this box's height depending on where the marker sits on screen;
   "overflow: hidden" was clipping tall cards (e.g. cutting off the phone
   number) instead of letting them grow, so allow full height/visible
   overflow here instead. */
.rds-map-canvas .gm-style-iw-d { max-height: none !important; overflow: visible !important; padding: 0; }
.rds-map-canvas .gm-style-iw-c { max-height: none !important; overflow: visible !important; padding: 0; }
/* Google reserves a separate strip above the content just to hold its own
   close (X) button, and its exact size/class isn't reliable across Google
   Maps versions — so instead of fighting it, hide Google's button entirely,
   shrink its reserved space to a minimum, and use our own close button
   (added in rds-map.js) styled to match the card. */
.rds-map-canvas .gm-style-iw,
.rds-map-canvas .gm-style-iw-chrome,
.rds-map-canvas .gm-style-iw-t {
    background: var(--rds-map-green) !important;
    min-height: 0 !important;
    padding: 0 !important;
}
.rds-map-canvas .gm-style-iw button.gm-ui-hover-effect,
.rds-map-canvas .gm-style-iw button[aria-label="Close"] {
    display: none !important;
}

.rds-map-info {
    position: relative;
    width: 260px;
    font-size: .8rem;
    line-height: 1.5;
    border-radius: 10px;
    overflow: hidden;
}

.rds-map-info-close {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 22px;
    height: 22px;
    line-height: 20px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.15);
    color: #fff;
    font-size: 1.1rem;
    text-align: center;
    cursor: pointer;
}
.rds-map-info-close:hover { background: rgba(0,0,0,.3); }

.rds-map-info-logo {
    background: #fff;
    line-height: 0;
}
.rds-map-info-logo img { width: 100%; height: auto; display: block; }

.rds-map-info-body {
    background: var(--rds-map-navy-dark);
    color: #fff;
    padding: 14px 16px 26px;
}

.rds-map-info-name {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    text-align: center;
    margin: 0 0 15px;
    line-height: 1.25;
}

.rds-map-info-address {
    display: flex;
    gap: 7px;
    align-items: flex-start;
    margin-bottom: 12px;
    opacity: .95;
    font-weight: 600;
}
.rds-map-info-address svg { flex-shrink: 0; margin-top: 2px; }

.rds-map-info-directions {
    display: block;
    text-align: center;
    background: var(--rds-map-green);
    color: #fff !important;
    font-weight: 700;
    font-size: .75rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    text-decoration: none !important;
    padding: 10px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
    transition: filter .15s, transform .15s;
}
.rds-map-info-directions:hover { filter: brightness(1.1); transform: translateY(-1px); }

.rds-map-info-details {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 600;
}
.rds-map-info-details li { display: flex; gap: 7px; align-items: flex-start; }
.rds-map-info-details svg { flex-shrink: 0; margin-top: 2px; opacity: .9; }
/* Explicit, matching hover style for both the links and the copy button —
   without this, the theme's own generic styles for <a> and <button> hover
   states fight each other here (one darkens the text, the other adds a
   background), so we override both the same way. */
.rds-map-info-details a,
.rds-map-copy-email {
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: background-color .15s;
    word-break: break-word;
}
.rds-map-info-details a:hover,
.rds-map-copy-email:hover {
    background: rgba(255,255,255,.15);
    color: #fff !important;
    text-decoration: none;
}

.rds-map-copy-email {
    background-color: transparent;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font: inherit;
    font-weight: inherit;
    text-transform: none;
    cursor: pointer;
}
.rds-map-copy-email--done { color: var(--rds-map-green) !important; }
