/* ============================================================
   Custom Store Locator v6.1 – Devma Agency
   ============================================================ */

@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
   FORCE 1000px – breaks out of any theme container
   ══════════════════════════════════════ */
.csl-wrapper {
    font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
    color: #222;

    /* ── Breakout: escape theme's narrow container ── */
    width: 100vw !important;
    max-width: 1000px !important;
    position: relative !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    -webkit-transform: translateX(-50%) !important;

    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !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%;
}

.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;
}

/* 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
   Full width always, height by JS
   ══════════════════════════════════════ */
.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;
}

/* 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;
}