/**
 * Rankbeta — Store Locator Widget
 * Dark-luxury theme: #0d0d0d bg · #C9A052 gold · warm-white text
 * Playfair Display headings · Montserrat body
 */

.rb-sl {
    /* ── Brand tokens (all overridable from Elementor Style panel) ── */
    --rb-sl-accent:       #C9A052;
    --rb-sl-ink:          #f0ead8;          /* main text on dark bg  */
    --rb-sl-cream:        #0d0d0d;          /* widget background     */
    --rb-sl-panel:        #141414;          /* card / input surface  */
    --rb-sl-panel-2:      #1c1c1c;          /* hover / elevated card */
    --rb-sl-muted:        rgba(240,234,216,0.50);
    --rb-sl-radius:       12px;
    --rb-sl-accent-soft:  rgba(201,160,82,0.12);
    --rb-sl-ring:         rgba(201,160,82,0.35);
    --rb-sl-line:         rgba(201,160,82,0.15);
    --rb-sl-panel-w:      380px;
    --rb-sl-map-h:        560px;

    box-sizing: border-box;
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--rb-sl-ink);
    background: var(--rb-sl-cream);
    max-width: 100%;
    overflow-x: clip;
    padding: 64px 24px;
}

.rb-sl *,
.rb-sl *::before,
.rb-sl *::after { box-sizing: border-box; }

/* ============================================================
   HERO / HEADER
   ============================================================ */
.rb-sl-hero {
    max-width: 680px;
    margin: 0 auto 40px;
    text-align: center;
}

/* Eyebrow pill — gold outlined badge */
.rb-sl-eyebrow {
    display: inline-block;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--rb-sl-accent);
    padding: 6px 18px;
    border: 1px solid rgba(201,160,82,0.5);
    border-radius: 999px;
    background: transparent;
    margin-bottom: 20px;
}

/* Main heading — Playfair Display, large */
.rb-sl-title {
    margin: 0 0 14px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--rb-sl-ink);
}

/* Subheading */
.rb-sl-sub {
    margin: 0 auto 28px;
    max-width: 520px;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.65;
    color: var(--rb-sl-muted);
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.rb-sl-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--rb-sl-panel);
    padding: 7px 7px 7px 18px;
    border-radius: 999px;
    border: 1px solid var(--rb-sl-line);
    box-shadow: 0 4px 24px rgba(0,0,0,0.35);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.rb-sl-search:focus-within {
    border-color: rgba(201,160,82,0.6);
    box-shadow: 0 0 0 3px var(--rb-sl-ring), 0 4px 24px rgba(0,0,0,0.4);
}

/* Search icon (gold) */
.rb-sl-search-icon {
    display: inline-flex;
    color: var(--rb-sl-accent);
    flex: 0 0 auto;
    opacity: 0.85;
}

/* Input field */
.rb-sl-input {
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: var(--rb-sl-ink);
    padding: 10px 4px;
    min-width: 0;
}
.rb-sl-input::placeholder {
    color: var(--rb-sl-muted);
    opacity: 0.7;
}

/* Search button */
.rb-sl-btn {
    flex: 0 0 auto;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border: 0;
    border-radius: 999px;
    transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.rb-sl-btn--go {
    background: var(--rb-sl-accent);
    color: #0d0d0d;
    padding: 12px 28px;
    font-size: 13px;
    box-shadow: 0 8px 22px -8px rgba(201,160,82,0.55);
}
.rb-sl-btn--go:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -10px rgba(201,160,82,0.65);
    background: #d9b470;
}
.rb-sl-btn--go:active { transform: translateY(0); }

/* Loading spinner state */
.rb-sl-btn--go[disabled] {
    cursor: progress;
    color: transparent;
    position: relative;
}
.rb-sl-btn--go[disabled]::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(13,13,13,0.3);
    border-top-color: #0d0d0d;
    border-radius: 50%;
    animation: rb-sl-spin 0.7s linear infinite;
}
@keyframes rb-sl-spin { to { transform: rotate(360deg); } }

/* "Use my location" link */
.rb-sl-geo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    cursor: pointer;
    background: transparent;
    border: 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--rb-sl-muted);
    transition: color 0.2s ease, opacity 0.2s ease;
}
.rb-sl-geo:hover { color: var(--rb-sl-accent); }
.rb-sl-geo svg   { color: var(--rb-sl-accent); }

/* Status message ("Searching…", errors) */
.rb-sl-status {
    min-height: 20px;
    margin: 12px 0 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--rb-sl-muted);
}
.rb-sl-status--err { color: #e05050; }
.rb-sl-status--ok  { color: var(--rb-sl-accent); }

/* ============================================================
   RESULTS + MAP GRID
   ============================================================ */
.rb-sl-grid {
    display: grid;
    grid-template-columns: var(--rb-sl-panel-w, 380px) 1fr;
    gap: 20px;
    align-items: stretch;
}
.rb-sl-results,
.rb-sl-map-wrap { min-width: 0; }

/* ============================================================
   RESULTS LIST
   ============================================================ */
.rb-sl-results {
    background: transparent;
    max-height: var(--rb-sl-map-h, 560px);
    overflow: hidden auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201,160,82,0.35) transparent;
}
.rb-sl-results::-webkit-scrollbar       { width: 6px; }
.rb-sl-results::-webkit-scrollbar-thumb {
    background: rgba(201,160,82,0.3);
    border-radius: 99px;
}

.rb-sl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── Card ── */
.rb-sl-card {
    position: relative;
    background: var(--rb-sl-panel);
    border: 1px solid var(--rb-sl-line);
    border-radius: var(--rb-sl-radius);
    padding: 18px 18px 16px;
    cursor: pointer;
    overflow: hidden;
    transform: translateY(8px);
    opacity: 0;
    animation: rb-sl-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

/* Gold accent bar slides in on left edge */
.rb-sl-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--rb-sl-accent);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.rb-sl-card:hover {
    transform: translateY(-3px);
    background: var(--rb-sl-panel-2);
    border-color: rgba(201,160,82,0.35);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}
.rb-sl-card:hover::before,
.rb-sl-card.is-active::before { transform: scaleY(1); }

.rb-sl-card.is-active {
    border-color: rgba(201,160,82,0.6);
    background: var(--rb-sl-panel-2);
    box-shadow: 0 0 0 1px rgba(201,160,82,0.25), 0 16px 40px rgba(0,0,0,0.4);
}

@keyframes rb-sl-in {
    to { transform: translateY(0); opacity: 1; }
}

/* Staggered card entrance delays */
.rb-sl-list li:nth-child(1) .rb-sl-card { animation-delay: 0.00s; }
.rb-sl-list li:nth-child(2) .rb-sl-card { animation-delay: 0.07s; }
.rb-sl-list li:nth-child(3) .rb-sl-card { animation-delay: 0.14s; }
.rb-sl-list li:nth-child(4) .rb-sl-card { animation-delay: 0.21s; }
.rb-sl-list li:nth-child(5) .rb-sl-card { animation-delay: 0.28s; }
.rb-sl-list li:nth-child(6) .rb-sl-card { animation-delay: 0.35s; }

/* Card top row: name + distance badge */
.rb-sl-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

/* Store name */
.rb-sl-card-name {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rb-sl-ink);
}

/* Distance badge — gold pill */
.rb-sl-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    background: var(--rb-sl-accent-soft);
    color: var(--rb-sl-accent);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201,160,82,0.25);
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.rb-sl-badge b     { font-size: 14px; }
.rb-sl-badge small { font-weight: 600; opacity: 0.75; font-size: 11px; }

/* "NEAREST" tag — gold badge above name */
.rb-sl-tag-nearest {
    display: inline-block;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #0d0d0d;
    background: var(--rb-sl-accent);
    padding: 3px 10px;
    border-radius: 999px;
}

/* Address */
.rb-sl-card-addr {
    margin: 8px 0 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.6;
    color: var(--rb-sl-muted);
    white-space: pre-line;
}

/* Phone / hours row */
.rb-sl-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-top: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: var(--rb-sl-muted);
}
.rb-sl-card-meta span { display: inline-flex; align-items: center; gap: 6px; }
.rb-sl-card-meta svg  { color: var(--rb-sl-accent); flex: 0 0 auto; opacity: 0.85; }

/* Divider above action chips */
.rb-sl-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(201,160,82,0.1);
}

/* Action chips (Directions / Call / View Store) */
.rb-sl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(201,160,82,0.25);
    color: var(--rb-sl-muted);
    background: rgba(201,160,82,0.06);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.18s ease;
}
.rb-sl-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(201,160,82,0.6);
    color: var(--rb-sl-accent);
    background: rgba(201,160,82,0.1);
}
.rb-sl-chip svg { flex: 0 0 auto; }

/* Directions = primary gold chip */
.rb-sl-chip--primary {
    background: var(--rb-sl-accent);
    color: #0d0d0d;
    border-color: var(--rb-sl-accent);
    font-weight: 800;
}
.rb-sl-chip--primary:hover {
    background: #d9b470;
    border-color: #d9b470;
    color: #0d0d0d;
}

/* Empty / no-results state */
.rb-sl-empty {
    text-align: center;
    color: var(--rb-sl-muted);
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 40px 16px;
    opacity: 0.7;
}

/* Skeleton shimmer for loading state */
.rb-sl-skel {
    height: 110px;
    border-radius: var(--rb-sl-radius);
    background: linear-gradient(100deg, #1c1c1c 30%, #252525 50%, #1c1c1c 70%);
    background-size: 200% 100%;
    animation: rb-sl-shimmer 1.4s infinite;
}
@keyframes rb-sl-shimmer { to { background-position: -200% 0; } }

/* ============================================================
   MAP
   ============================================================ */
.rb-sl-map-wrap {
    position: relative;
    border-radius: var(--rb-sl-radius);
    overflow: hidden;
    border: 1px solid var(--rb-sl-line);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.rb-sl-map {
    width: 100%;
    height: var(--rb-sl-map-h, 560px);
    background: #1a1a1a;
}

.rb-sl .leaflet-container { font-family: 'Montserrat', sans-serif; }

/* ── Map pin markers ── */
.rb-sl-pin {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #1c1c1c;
    border: 2px solid rgba(201,160,82,0.5);
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 14px rgba(0,0,0,0.6);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    animation: rb-sl-drop 0.55s cubic-bezier(0.2, 0.8, 0.3, 1.25) both;
    cursor: pointer;
}
.rb-sl-pin-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rb-sl-accent);
    transition: background 0.25s ease;
}
.rb-sl-pin:hover {
    transform: rotate(-45deg) scale(1.18);
    z-index: 600;
    background: #262626;
    border-color: var(--rb-sl-accent);
}
.rb-sl-pin.is-active,
.rb-sl-pin.is-nearest {
    background: var(--rb-sl-accent);
    border-color: var(--rb-sl-accent);
    box-shadow: 0 6px 20px rgba(201,160,82,0.5);
}
.rb-sl-pin.is-active .rb-sl-pin-dot,
.rb-sl-pin.is-nearest .rb-sl-pin-dot { background: #0d0d0d; }
.rb-sl-pin.is-active  { transform: rotate(-45deg) scale(1.22); animation: rb-sl-bounce 0.5s ease; }
.rb-sl-pin.is-nearest { animation: rb-sl-near 1.8s ease-in-out infinite; }

@keyframes rb-sl-drop {
    0%   { opacity: 0; transform: rotate(-45deg) translateY(-44px) scale(.5); }
    65%  { opacity: 1; transform: rotate(-45deg) translateY(4px)  scale(1.06); }
    100% { opacity: 1; transform: rotate(-45deg) translateY(0)    scale(1); }
}
@keyframes rb-sl-bounce {
    0%   { transform: rotate(-45deg) scale(1); }
    45%  { transform: rotate(-45deg) scale(1.35); }
    100% { transform: rotate(-45deg) scale(1.22); }
}
@keyframes rb-sl-near {
    0%, 100% { transform: rotate(-45deg) scale(1); }
    50%       { transform: rotate(-45deg) scale(1.14); }
}

/* "You are here" — blue pulsing dot */
.rb-sl-pin--me {
    width: 18px;
    height: 18px;
    background: #2d7ef7;
    border: 3px solid rgba(255,255,255,0.9);
    border-radius: 50%;
    transform: none;
    box-shadow: 0 0 0 5px rgba(45,126,247,0.3);
    animation: rb-sl-pulse 1.8s ease-out infinite;
}
@keyframes rb-sl-pulse {
    0%   { box-shadow: 0 0 0 0   rgba(45,126,247,0.5); }
    100% { box-shadow: 0 0 0 14px rgba(45,126,247,0);  }
}

/* ── Map zoom controls — dark themed ── */
.rb-sl .leaflet-control-zoom {
    border: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.rb-sl .leaflet-control-zoom a {
    width: 34px;
    height: 34px;
    line-height: 32px;
    color: var(--rb-sl-ink);
    background: #1c1c1c;
    border: none;
    font-size: 18px;
    font-weight: 700;
    transition: background 0.2s ease, color 0.2s ease;
}
.rb-sl .leaflet-control-zoom a:first-child {
    border-bottom: 1px solid rgba(201,160,82,0.15);
}
.rb-sl .leaflet-control-zoom a:hover {
    background: var(--rb-sl-accent);
    color: #0d0d0d;
}
.rb-sl .leaflet-control-attribution {
    background: rgba(13,13,13,0.75);
    backdrop-filter: blur(4px);
    color: rgba(240,234,216,0.5);
    font-size: 10px;
    border-radius: 6px 0 0 0;
}
.rb-sl .leaflet-control-attribution a { color: var(--rb-sl-accent); }

/* ── Map popup — dark themed ── */
.rb-sl-popup .leaflet-popup-content-wrapper {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(201,160,82,0.2);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    color: var(--rb-sl-ink);
    animation: rb-sl-pop-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.1) both;
}
.rb-sl-popup .leaflet-popup-tip-container { display: none; }
.rb-sl-popup .leaflet-popup-content { margin: 0; font-family: 'Montserrat', sans-serif; }
.rb-sl-popup a.leaflet-popup-close-button {
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    color: var(--rb-sl-muted);
    font-size: 18px;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}
.rb-sl-popup a.leaflet-popup-close-button:hover {
    background: rgba(255,255,255,0.08);
    color: var(--rb-sl-ink);
}

/* Popup inner */
.rb-sl-pop { padding: 18px 18px 14px; min-width: 200px; }
.rb-sl-pop-head {
    border-left: 3px solid var(--rb-sl-accent);
    padding-left: 11px;
    margin-bottom: 12px;
}
.rb-sl-pop-name {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.25;
    color: var(--rb-sl-ink);
}
.rb-sl-pop-addr,
.rb-sl-pop-hours {
    display: flex;
    gap: 7px;
    margin: 0 0 7px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
    color: var(--rb-sl-muted);
    white-space: pre-line;
}
.rb-sl-pop-addr svg,
.rb-sl-pop-hours svg { color: var(--rb-sl-accent); flex: 0 0 auto; margin-top: 2px; }
.rb-sl-pop-acts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(201,160,82,0.1);
}
.rb-sl-pop-acts .rb-sl-chip { padding: 7px 12px; font-size: 11.5px; }

@keyframes rb-sl-pop-in {
    0%   { opacity: 0; transform: translateY(8px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: single-column, map on top */
@media (max-width: 1024px) {
    .rb-sl .rb-sl-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    .rb-sl .rb-sl-map-wrap { order: -1; }
    .rb-sl .rb-sl-results  { max-height: none; overflow: visible; padding-right: 0; }
    .rb-sl .rb-sl-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

/* Mobile */
@media (max-width: 600px) {
    .rb-sl { --rb-sl-map-h: 340px; padding: 40px 16px; }

    .rb-sl-hero  { margin-bottom: 28px; }
    .rb-sl-title { font-size: 28px; }
    .rb-sl-sub   { font-size: 14px; }

    /* Search bar: stacked layout */
    .rb-sl-search {
        flex-wrap: wrap;
        border-radius: 18px;
        padding: 12px 14px;
        gap: 10px;
    }
    .rb-sl-search-icon { order: 1; }
    .rb-sl-input  { flex: 1 1 0; order: 2; min-width: 0; padding: 8px 4px; }
    .rb-sl-btn--go { flex: 1 1 100%; order: 3; padding: 14px; min-height: 46px; border-radius: 10px; }

    .rb-sl .rb-sl-list { grid-template-columns: 1fr; }

    /* Comfortable tap targets */
    .rb-sl-chip { padding: 10px 16px; min-height: 42px; }
    .rb-sl-geo  { min-height: 42px; }
    .rb-sl-card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .rb-sl-card       { animation: none; opacity: 1; transform: none; }
    .rb-sl-pin        { animation: none !important; }
    .rb-sl-pin--me    { animation: none; }
    .rb-sl-popup .leaflet-popup-content-wrapper { animation: none; }
}
