/* ─── Store Locator Free — Frontend Styles ───────────────────────────────── */

.slf-wrap { font-family: inherit; margin: 0 0 24px; }

/* ─── Search Bar ─────────────────────────────────────────────────────────── */
.slf-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.slf-search-input {
    flex: 1;
    min-width: 180px;
    padding: 9px 14px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.slf-search-input:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,.12);
}
.slf-search-btn, .slf-reset-btn {
    padding: 9px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background .2s;
    white-space: nowrap;
}
.slf-search-btn { background: #c0392b; color: #fff; }
.slf-search-btn:hover { background: #a93226; }
.slf-reset-btn { background: #f0f0f0; color: #555; }
.slf-reset-btn:hover { background: #e0e0e0; }

/* ─── Body layout ────────────────────────────────────────────────────────── */
.slf-body {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}
.slf-map-container { flex: 1; min-width: 0; }
.slf-map { width: 100%; height: 100%; min-height: 300px; }

/* ─── List Panel ─────────────────────────────────────────────────────────── */
.slf-list-panel {
    width: 300px;
    min-width: 260px;
    max-width: 300px;
    overflow-y: auto;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #ddd #fff;
}
.slf-list-panel::-webkit-scrollbar { width: 5px; }
.slf-list-panel::-webkit-scrollbar-track { background: #fff; }
.slf-list-panel::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.slf-list-inner { display: flex; flex-direction: column; }

.slf-list-loading {
    padding: 20px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

/* ─── City accordion ─────────────────────────────────────────────────────── */
.slf-city-group { border-bottom: 1px solid #efefef; }
.slf-city-group:last-child { border-bottom: none; }

.slf-city-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    cursor: pointer;
    background: #fff;
    transition: background .15s;
    user-select: none;
    -webkit-user-select: none;
}
.slf-city-header:hover { background: #fafafa; }
.slf-city-header.slf-open { background: #fdf2f2; }

.slf-city-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.slf-city-icon {
    font-size: 15px;
    flex-shrink: 0;
}
.slf-city-name {
    font-weight: 700;
    font-size: 14px;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slf-city-count {
    font-size: 11px;
    background: #e8e8e8;
    color: #666;
    border-radius: 10px;
    padding: 1px 7px;
    font-weight: 600;
    flex-shrink: 0;
}
.slf-city-header.slf-open .slf-city-count {
    background: #f5c0bb;
    color: #a93226;
}

.slf-city-arrow {
    flex-shrink: 0;
    transition: transform .2s ease;
    color: #aaa;
    margin-left: 6px;
}
.slf-city-header.slf-open .slf-city-arrow {
    transform: rotate(180deg);
    color: #c0392b;
}

/* City store list */
.slf-city-stores {
    display: none;
    background: #fafafa;
}
.slf-city-stores.slf-open { display: block; }

.slf-store-item {
    padding: 11px 16px 11px 24px;
    border-top: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background .12s;
    position: relative;
}
.slf-store-item::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ccc;
    transition: background .15s;
}
.slf-store-item:hover { background: #f0f0f0; }
.slf-store-item:hover::before { background: #c0392b; }
.slf-store-item.slf-active { background: #fdf2f2; }
.slf-store-item.slf-active::before { background: #c0392b; }

.slf-store-name {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a2e;
    margin: 0 0 3px;
    padding-left: 10px;
}
.slf-store-address {
    font-size: 12px;
    color: #888;
    margin: 0;
    line-height: 1.3;
    padding-left: 10px;
}

.slf-no-results {
    padding: 24px 16px;
    color: #aaa;
    font-size: 13px;
    text-align: center;
}

/* ─── Popup ──────────────────────────────────────────────────────────────── */
.slf-popup { min-width: 200px; max-width: 270px; font-size: 13px; line-height: 1.5; }
.slf-popup-name { font-weight: 700; font-size: 15px; color: #1a1a2e; margin: 0 0 8px; }
.slf-popup-row { display: flex; gap: 5px; align-items: flex-start; margin-bottom: 4px; color: #555; }
.slf-popup-icon { flex-shrink: 0; width: 18px; text-align: center; font-style: normal; }
.slf-popup-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.slf-popup-link {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: #c0392b;
    transition: background .15s;
}
.slf-popup-link:hover { background: #a93226; color: #fff; }
.slf-popup-link.slf-wa { background: #25d366; }
.slf-popup-link.slf-wa:hover { background: #1db954; }
.slf-popup-link.slf-web { background: #555; }
.slf-popup-link.slf-web:hover { background: #333; }
.slf-popup-link.slf-dir { background: #2c7be5; }
.slf-popup-link.slf-dir:hover { background: #1a68d4; }

/* ─── Attribution ────────────────────────────────────────────────────────── */
.slf-attribution { font-size: 11px; color: #bbb; margin: 5px 0 0; text-align: right; }
.slf-attribution a { color: #bbb; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
    .slf-body {
        flex-direction: column;
        height: auto !important;
    }
    .slf-list-panel {
        width: 100%;
        max-width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
    .slf-map { height: 320px !important; }
    .slf-search-btn, .slf-reset-btn { flex: 1; justify-content: center; }
}

/* ─── Imagen en popup ────────────────────────────────────────────────────── */
.slf-popup-img-wrap {
    margin: -14px -20px 12px;   /* sangra hasta el borde del popup de Leaflet */
    border-radius: 6px 6px 0 0;
    overflow: hidden;
    line-height: 0;
}
.slf-popup-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    border-radius: 6px 6px 0 0;
}
