/* ============================================================
   Storage Finder – Redesigned to match Image 2 layout
   ============================================================ */

/* Container */
.storage-finder-container {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    background: #f3f4f6;
    min-height: 600px;
}

.storage-finder-sidebar {
    width: 42%;
    background: #f3f4f6;
    overflow-y: auto;
    max-height: 600px;
    border-right: 1px solid #e5e7eb;
}

.storage-finder-map {
    width: 58%;
    position: relative;
}

#storage-map {
    width: 100%;
    height: 600px;
}

/* ── Search ─────────────────────────────────────────────── */
.search-section {
    padding: 16px 16px 12px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.search-box {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.search-input:focus {
    border-color: var(--sf-card-border, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.search-btn {
    padding: 10px 20px;
    background: var(--sf-primary, #1e3a8a);
    color: var(--sf-marker-text, #fff);
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
}

.search-btn:hover { background: var(--sf-primary-hover, #1e40af); }

/* ── City Filter ─────────────────────────────────────────── */
.filter-section {
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.city-filter {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.city-filter:focus { border-color: #3b82f6; }

/* ── Facilities List ─────────────────────────────────────── */
.facilities-list { padding: 12px; }

.loading,
.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    font-weight: 600;
}

/* ── Facility Card ───────────────────────────────────────── */
/* Matches Image 2: white card, rounded corners, subtle shadow */
.facility-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 12px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow .2s, border-color .2s;
    overflow: hidden;
}

.facility-card:hover,
.facility-card.active {
    border-color: #3b82f6;
    box-shadow: 0 3px 10px rgba(59,130,246,.12);
}

/* Top row: image left + identity right */
.facility-top {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.facility-image {
    width: 160px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.facility-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.facility-identity {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
}

.facility-identity h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
}

.facility-address {
    margin: 0 0 4px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.5;
}

.facility-phone {
    margin: 0 0 8px;
}

.facility-phone a {
    color: #3b82f6;
    text-decoration: none;
    font-size: 13px;
}

.facility-phone a:hover { text-decoration: underline; }

/* distance badge (optional) */
.facility-distance {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
}

/* Chat button */
.chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: transparent;
    color: var(--sf-accent, #06b6d4);
    border: 1.5px solid var(--sf-accent, #06b6d4);
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s;
    white-space: nowrap;
    width: fit-content;
}

.chat-btn:hover { background: var(--sf-accent-hover, #ecfeff); }

/* ── Bottom row: pricing | divider | amenities ───────────── */
.facility-bottom {
    display: flex;
    gap: 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}

/* Pricing column */
.unit-pricing {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 16px;
}

.unit-size {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.size-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.price {
    font-size: 13px;
    color: #374151;
}

.price strong {
    font-weight: 700;
    color: #111827;
}

/* Divider */
.facility-divider {
    width: 1px;
    background: #e5e7eb;
    margin: 0 16px;
    flex-shrink: 0;
}

/* Amenities column */
.amenities {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 130px;
}

.amenity {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #374151;
    font-size: 13px;
}

.amenity svg {
    flex-shrink: 0;
}

/* See All Units button – full width below bottom row */
.see-units-btn {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 14px;
    background: #1e3a8a;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background .2s;
}

.see-units-btn:hover { background: #1e40af; }

/* ── Map Controls ────────────────────────────────────────── */
.show-more-btn,
.search-area-btn {
    position: absolute;
    z-index: 1000;
    padding: 9px 18px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: all .2s;
}

.show-more-btn:hover,
.search-area-btn:hover {
    background: #f9fafb;
    box-shadow: 0 4px 6px rgba(0,0,0,.1);
}

.show-more-btn {
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
}

.search-area-btn {
    top: 16px;
    right: 16px;
    background: #1e3a8a;
    color: #fff;
    border: none;
}

.search-area-btn:hover { background: #1e40af; }

/* ── Map Marker ──────────────────────────────────────────── */
.custom-marker { background: transparent; border: none; }

.marker-pin { position: relative; }

.marker-price {
    background: var(--sf-marker-bg, #111827);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    white-space: nowrap;
    text-align: center;
}

.marker-price::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--sf-marker-bg, #111827);
}

/* ── Map Popup ───────────────────────────────────────────── */
.map-popup h4 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.map-popup p {
    margin: 0 0 4px;
    font-size: 12px;
    color: #6b7280;
}

.popup-price {
    font-weight: 700;
    color: #1e3a8a !important;
    margin-top: 6px !important;
    font-size: 13px !important;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    padding: 4px;
}

.leaflet-popup-content { margin: 12px; }

.leaflet-popup-tip { background: #fff; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .storage-finder-container { flex-direction: column; }
    .storage-finder-sidebar,
    .storage-finder-map { width: 100%; }
    .storage-finder-sidebar { max-height: 500px; }
    #storage-map { height: 400px; }
}

@media (max-width: 768px) {
    .facility-top { flex-direction: column; }
    .facility-image { width: 100%; height: 200px; }
    .facility-bottom { flex-direction: column; }
    .facility-divider { width: 100%; height: 1px; margin: 12px 0; }
    .unit-pricing { padding-right: 0; }
    .search-box { flex-direction: column; }
    .search-btn { width: 100%; }
}
