/* ============================================================
   Custom Store Locator v8.1.4 – Devma Agency LLC
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ── Reset ── */
.csl-wrapper,
.csl-wrapper *,
.csl-wrapper *::before,
.csl-wrapper *::after {
    box-sizing: border-box;
}

/* ══════════════════════════════════════
   OUTER WRAPPER
   Desktop: breakout to 1000px max
   Mobile/Tablet: natural width (prevents map render failure)
   ══════════════════════════════════════ */
.csl-wrapper {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    color: #222;
    display: block !important;
    padding: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1000px !important;
    position: relative !important;
}

@media (min-width: 1025px) {
    div#csl-message {
        margin-left: -75px !important;
    }
}

/* Desktop-only breakout (escape narrow theme containers) */
@media (min-width: 1025px) {
    .csl-wrapper {
        width: 100vw !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        -webkit-transform: translateX(-50%) !important;
    }
}

/* ══════════════════════════════════════
   SEARCH BAR
   Centered, 515px on desktop, full on mobile
   ══════════════════════════════════════ */
.csl-search-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 18px;
    width: 100%;
}

/* ── Wrapper variants (used by separate shortcodes) ── */
.csl-wrapper-search-only {
    /* No map below — remove extra bottom padding */
}
.csl-wrapper-search-only .csl-search-bar {
    padding: 16px 16px 16px;
}
.csl-wrapper-map-only .csl-map-wrap {
    margin-top: 0;
}

/* ── CLASSIC variant (original green rounded pill) ── */
.csl-search-inner {
    display: flex;
    align-items: center;
    width: 515px;
    max-width: 100%;
    height: 60px;
    border: 1.5px solid #2F8F46;
    border-radius: 30px;
    background: #fff;
    overflow: visible;
}

.csl-search-svg {
    flex-shrink: 0;
    margin-left: 20px;
    margin-right: 8px;
    pointer-events: none;
}

#csl-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #222;
    padding: 0 6px;
    min-width: 0;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}
#csl-search-input::placeholder {
    color: #898F9A;
    font-size: 16px;
}

#csl-search-btn {
    flex-shrink: 0;
    width: 188px;
    height: 60px;
    border: none;
    margin: -1.5px -1.5px -1.5px 0;
    border-radius: 30px;
    background: #1F8F42;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background .2s;
}
#csl-search-btn:hover    { background: #166e32; }
#csl-search-btn:active   { background: #0f5225; }
#csl-search-btn:focus    { outline: none; box-shadow: none; }
#csl-search-btn:disabled { background: #7fbf94; cursor: not-allowed; }

.csl-autocomplete {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    display: flex;
    align-items: center;
}
.csl-autocomplete #csl-search-input {
    width: 100%;
}
.csl-autocomplete-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 5000;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
}
.csl-autocomplete-option {
    width: 100%;
    display: block;
    border: 0;
    background: #fff;
    color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    padding: 11px 14px;
    cursor: pointer;
}
.csl-autocomplete-option:hover,
.csl-autocomplete-option.is-active {
    background: #f3fbf5;
    color: #1F8F42;
}

/* ── NEW variant: white pill, location icon left, black circular search button right ── */
.csl-search-inner-new {
    display: flex;
    align-items: center;
    width: 515px;
    max-width: 100%;
    height: 58px;
    border: 1px solid #e8e8e8;
    border-radius: 40px;
    background: #fff;
    padding: 6px 6px 6px 18px;
/*     box-shadow: 0 2px 10px rgba(0,0,0,.05); */
    transition: border-color .2s, box-shadow .2s;
}
.csl-search-inner-new:focus-within {
    border-color: #bbb;
    box-shadow: 0 2px 14px rgba(0,0,0,.09);
}
.csl-search-loc-svg {
    flex-shrink: 0;
    margin-right: 10px;
    pointer-events: none;
}
.csl-search-new #csl-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #1a1a1a;
    padding: 0 4px;
    min-width: 0;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}
.csl-search-new #csl-search-input::placeholder {
    color: #9a9a9a;
    font-size: 15px;
    font-weight: 400;
}
.csl-search-btn-circle {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    margin: 0;
    border-radius: 50%;
    background: #0a0a0a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    outline: none;
    box-shadow: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: background .2s, transform .1s;
}
.csl-search-btn-circle:hover    { background: #222; }
.csl-search-btn-circle:active   { background: #000; transform: scale(.96); }
.csl-search-btn-circle:focus    { outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,.12); }
.csl-search-btn-circle:disabled { background: #888; cursor: not-allowed; }
.csl-search-btn-circle svg { display: block; }

/* When button is in loading state, we may inject text — keep it contained */
.csl-search-btn-circle.csl-loading {
    width: auto;
    min-width: 44px;
    padding: 0 14px;
    border-radius: 22px;
    font-size: 12px;
    font-weight: 600;
}

/* Mobile tweaks for new variant */
@media (max-width: 480px) {
    .csl-search-inner-new {
        height: 52px;
        padding: 5px 5px 5px 14px;
    }
    .csl-search-btn-circle {
        width: 40px;
        height: 40px;
    }
    .csl-search-new #csl-search-input,
    .csl-search-new #csl-search-input::placeholder {
        font-size: 14px;
    }
}

/* Message */
.csl-message {
    margin-top: 10px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    max-width: 515px;
    width: 100%;
    font-family: 'Poppins', sans-serif;
}
.csl-message.error   { background:#fff0f0; color:#c0392b; border:1px solid #f5c6cb; }
.csl-message.success { background:#f0fff4; color:#155724; border:1px solid #b2dfdb; }

/* Reset bar */
.csl-reset-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 13px;
    color: #777;
    width: 100%;
    flex-wrap: wrap;
}
.csl-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1.5px solid #2F8F46;
    color: #1F8F42;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    white-space: nowrap;
}
.csl-reset-btn:hover,
.csl-reset-btn:active { background: #1F8F42; color: #fff; }

/* ══════════════════════════════════════
   MAP CONTAINER
   CSS-first responsive heights — renders correctly
   even before JS fires (mobile race-condition safe)
   ══════════════════════════════════════ */
.csl-map-wrap {
    width: 100%;
    display: block;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.13);
    border: 1.5px solid #d4d4d4;
    background: #a8d5e8;
    position: relative;
    z-index: 0;
}

#csl-map {
    width: 100% !important;
    display: block !important;
    /* Default desktop height (JS may override via data-height) */
    height: 500px;
}

/* Responsive breakpoints — ALWAYS apply regardless of desktop data-height.
   These win on mobile because JS sets mapEl.style.height which has same specificity,
   but we also read these as fallback if JS hasn't run yet. */
@media (max-width: 1024px) { #csl-map { height: 420px; } }
@media (max-width: 768px)  { #csl-map { height: 340px; } }
@media (max-width: 600px)  { #csl-map { height: 300px; } }
@media (max-width: 480px)  { #csl-map { height: 280px; } }
@media (max-width: 360px)  { #csl-map { height: 240px; } }

/* Leaflet z-index fix */
.csl-map-wrap .leaflet-pane,
.csl-map-wrap .leaflet-control-container { z-index: 1 !important; }
.csl-map-wrap .leaflet-top,
.csl-map-wrap .leaflet-bottom            { z-index: 2 !important; }

/* Bigger touch targets */
.leaflet-touch .leaflet-control-zoom a {
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 18px !important;
}

/* ══════════════════════════════════════
   POPUP
   ══════════════════════════════════════ */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 6px 24px rgba(0,0,0,.16) !important;
    padding: 0 !important;
    overflow: hidden;
    border: none !important;
    min-width: 230px;
    max-width: 88vw;
}
.leaflet-popup-content {
    margin: 0 !important;
    font-family: 'Poppins', sans-serif !important;
    color: #222 !important;
    width: auto !important;
}
.leaflet-popup-tip       { background:#fff !important; }
.leaflet-popup-close-button {
    top:10px !important; right:10px !important;
    color:#999 !important; font-size:18px !important;
    background:rgba(0,0,0,.05) !important;
    border-radius:50% !important;
    width:26px !important; height:26px !important;
    display:flex !important; align-items:center !important; justify-content:center !important;
}

.csl-popup { font-family:'Poppins',sans-serif; color:#222; }
.csl-popup-head {
    padding: 16px 18px 11px;
    border-bottom: 1px solid #f0f0f0;
}
.csl-popup-head h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.3;
    padding-right: 18px;
}
.csl-popup-body {
    padding: 11px 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.csl-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 12px;
    color: #444;
    line-height: 1.5;
}
.csl-popup-row span { flex:1; word-break:break-word; }
.csl-popup-icon { width:14px; height:14px; flex-shrink:0; margin-top:2px; }
.csl-popup-foot {
    padding: 9px 18px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid #f5f5f5;
    flex-wrap: wrap;
}
.csl-pop-badge {
    font-size: 11px;
    font-weight: 600;
    background: #1F8F42;
    color: #fff;
    padding: 4px 11px;
    border-radius: 20px;
    white-space: nowrap;
}
.csl-gmaps-link {
    font-size: 11px;
    font-weight: 600;
    color: #1F8F42;
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.csl-gmaps-link:hover { text-decoration: underline; }

/* State marker – no pointer */
.csl-state-icon,
.leaflet-marker-icon.csl-state-icon {
    pointer-events: none !important;
    cursor: default !important;
}

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* Tablet ≤ 768px – disable breakout, go full width naturally */
@media (max-width: 768px) {
    .csl-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        transform: none !important;
        -webkit-transform: none !important;
        position: static !important;
    }
    .csl-search-bar  { padding: 16px 12px 14px; }
    .csl-search-inner {
        width: 100%;
        height: 52px;
        border-radius: 26px;
    }
    #csl-search-input            { font-size: 16px; }
    #csl-search-input::placeholder { font-size: 16px; }
    #csl-search-btn {
        width: 120px; height: 52px;
        border-radius: 26px; font-size: 14px;
        margin: -1.5px -1.5px -1.5px 0;
    }
    .csl-map-wrap { border-radius: 10px; }
    .csl-popup-head  { padding: 13px 15px 10px; }
    .csl-popup-body  { padding: 9px 15px; }
    .csl-popup-foot  { padding: 8px 15px 13px; }
}

/* Mobile ≤ 480px */
@media (max-width: 480px) {
    .csl-search-bar  { padding: 14px 10px 12px; }
    .csl-search-inner {
        height: 48px;
        border-radius: 24px;
    }
    .csl-search-svg  { margin-left: 12px; margin-right: 5px; width: 15px; height: 15px; }
    #csl-search-input            { font-size: 16px; }
    #csl-search-input::placeholder { font-size: 16px; }
    #csl-search-btn {
        width: 96px; height: 48px;
        border-radius: 24px; font-size: 13px;
        margin: -1.5px -1.5px -1.5px 0;
    }
    .csl-message     { font-size: 12px; padding: 8px 10px; }
    .csl-reset-btn   { font-size: 11px; padding: 5px 11px; }
    .csl-map-wrap    { border-radius: 8px; }
    .leaflet-popup-content-wrapper { min-width: 180px !important; }
    .csl-popup-head h4 { font-size: 13px; }
    .csl-popup-row     { font-size: 11px; }
    .csl-pop-badge     { font-size: 10px; }
    .csl-gmaps-link    { font-size: 10px; }
}

/* Very small ≤ 360px */
@media (max-width: 360px) {
    #csl-search-btn { width: 88px; font-size: 12px; }
    .csl-search-svg { margin-left: 10px; margin-right: 4px; }
}

/* ══════════════════════════════════════
   STATE POPUP
   ══════════════════════════════════════ */
.csl-state-popup .csl-popup-head h4 {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.csl-state-badge {
    display: inline-block;
    margin-top: 6px;
    background: #1F8F42;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
}

.csl-state-popup-list {
    max-height: 160px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px !important;
    padding-bottom: 12px !important;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #1F8F42 #f0f0f0;
}
.csl-state-popup-list::-webkit-scrollbar {
    width: 4px;
}
.csl-state-popup-list::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}
.csl-state-popup-list::-webkit-scrollbar-thumb {
    background: #1F8F42;
    border-radius: 4px;
}

.csl-state-popup-store {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: #333;
    font-family: 'Poppins', sans-serif;
    line-height: 1.4;
}

.csl-state-popup-store span {
    flex: 1;
}

/* ── Clickable store rows inside state popup ── */
.csl-store-link {
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 6px;
    margin: 0 -6px;
    transition: background 0.15s;
    text-decoration: none;
}
.csl-store-link:hover {
    background: #f0fff4;
}
.csl-store-link:hover span {
    color: #1F8F42;
}
