/* ============================================================
   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;
}
button.units-toggle-btn {
    font-size: 10px !important;
    width: 50%;
    padding: 10px 20px !important;
}
.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: var(--sf-text-title, #111827);
    line-height: 1.3;
}

.facility-address {
    margin: 0 0 4px;
    color: var(--sf-text-muted, #6b7280);
    font-size: 13px;
    line-height: 1.5;
}

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

.facility-phone a {
    color: var(--sf-text-link, #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;
}

/* Action buttons (Rent Now / Pay Now) */
.facility-action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .2s, background .2s;
    white-space: nowrap;
    line-height: 1;
}

.rent-now-btn {
    background: var(--sf-primary, #1e3a8a);
    color: var(--sf-marker-text, #fff);
    border: none;
}

.rent-now-btn:hover { background: var(--sf-primary-hover, #1e40af); color: var(--sf-marker-text, #fff); }

.pay-now-btn {
    background: transparent;
    color: var(--sf-accent, #06b6d4);
    border: 1.5px solid var(--sf-accent, #06b6d4);
}

.pay-now-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: var(--sf-text-body, #374151);
}

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

.price strong {
    font-weight: 700;
    color: var(--sf-text-price, #111827);
}

/* Units toggle button */
.units-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--sf-primary, #1e3a8a);
    transition: opacity .15s;
}

.units-toggle-btn:hover { opacity: .75; }

.units-toggle-btn svg {
    flex-shrink: 0;
    transition: transform .2s;
}

/* 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: var(--sf-text-body, #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: var(--sf-primary, #1e3a8a);
    color: var(--sf-marker-text, #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: var(--sf-primary-hover, #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 — price pill (default) ───────────────────── */
.custom-marker { background: transparent; border: none; }

.marker-pin { position: relative; }

.marker-price {
    background: var(--sf-marker-bg, #111827);
    color: var(--sf-marker-text, #fff);
    font-weight: 700;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    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 Marker — image pin ──────────────────────────────── */
.marker-img-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-img-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--sf-marker-bg, #111827);
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,.35);
    background: #e5e7eb;
    flex-shrink: 0;
}

.marker-img-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.marker-img-tip {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid var(--sf-marker-bg, #111827);
    margin-top: -1px;
}

.marker-img-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: var(--sf-marker-bg, #111827);
    color: var(--sf-marker-text, #fff);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

/* ── Map Popup ───────────────────────────────────────────── */

/* Override Leaflet wrapper so our card has full control */
.sf-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    border: none;
}

.sf-popup .leaflet-popup-content {
    margin: 0;
    width: 240px !important;
}

.sf-popup .leaflet-popup-tip-container {
    margin-top: -1px;
}

.sf-popup .leaflet-popup-tip {
    background: #fff;
    box-shadow: none;
}

/* Close button */
.sf-popup .leaflet-popup-close-button {
    top: 8px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    background: rgba(255,255,255,.9) !important;
    border-radius: 50% !important;
    font-size: 16px !important;
    line-height: 24px !important;
    text-align: center !important;
    color: #374151 !important;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

/* Popup card */
.map-popup {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    font-family: inherit;
}

.map-popup-img {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: #f3f4f6;
}

.map-popup-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.map-popup-body {
    padding: 12px 14px 14px;
}

.map-popup-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--sf-text-title, #111827);
    line-height: 1.3;
}

.map-popup-address {
    margin: 0 0 12px;
    font-size: 12px;
    color: var(--sf-text-muted, #6b7280);
    line-height: 1.5;
}

.map-popup-btn {
    display: block;
    width: 100%;
    padding: 9px 0;
    background: var(--sf-primary, #1e3a8a);
    color: var(--sf-marker-text, #fff);
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    transition: background .2s;
    box-sizing: border-box;
    letter-spacing: .3px;
}

.map-popup-btn:hover {
    background: var(--sf-primary-hover, #1e40af);
    color: var(--sf-marker-text, #fff);
}

/* Google Maps popup (gm-style-iw) */
.gm-style-iw .map-popup { min-width: 220px; }
.gm-style-iw-d { overflow: hidden !important; padding: 0 !important; }
.gm-style-iw { padding: 0 !important; border-radius: 12px !important; overflow: hidden !important; }
.gm-style-iw-tc::after { background: #fff !important; }

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

/* ── No-coords notice (admin only hint) ──────────────────── */
.sf-no-coords-notice {
    font-size: 11px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 8px 0 0;
}
