/* ============================================
   RNZ Maps Module - Frontend Styles
   ============================================ */

.rnz-maps-module-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.rnz-maps-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid #e1e3e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* ---- Desktop layout ---- */
@media (min-width: 768px) {
    .rnz-maps-wrapper {
        flex-direction: row;
        height: 600px;
    }
}

/* ---- Mobile Toggle Tabs ---- */
.rnz-maps-mobile-toggle {
    display: none;
    background: #f9fafb;
    border-bottom: 1px solid #e1e3e5;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .rnz-maps-mobile-toggle {
        display: flex;
    }
}

.rnz-maps-mobile-toggle button {
    flex: 1;
    padding: 13px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-weight: 600;
    font-size: 14px;
    color: #6d7175;
    cursor: pointer;
    outline: none;
    transition: color 0.2s, border-color 0.2s;
}

.rnz-maps-mobile-toggle button.active {
    color: #2c6ecb;
    border-bottom-color: #2c6ecb;
}

/* ---- Sidebar ---- */
.rnz-maps-sidebar {
    width: 100%;
    overflow: hidden;
    border-right: none;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .rnz-maps-sidebar {
        height: calc(70vh - 48px);
    }
    .rnz-maps-wrapper.view-list .rnz-maps-sidebar  { display: flex; }
    .rnz-maps-wrapper.view-list .rnz-maps-map-container { display: none; }
    .rnz-maps-wrapper.view-map  .rnz-maps-sidebar  { display: none; }
    .rnz-maps-wrapper.view-map  .rnz-maps-map-container {
        display: block;
        height: 70vh;
    }
}

@media (min-width: 768px) {
    .rnz-maps-sidebar {
        width: 350px;
        border-right: 1px solid #e1e3e5;
        border-bottom: none;
    }
}

/* ---- Search bar ---- */
.rnz-maps-search-wrap {
    padding: 12px 16px;
    border-bottom: 1px solid #e1e3e5;
    background: #f9fafb;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.rnz-maps-search-wrap input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #c9cccf;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.rnz-maps-search-wrap input:focus {
    border-color: #2c6ecb;
    box-shadow: 0 0 0 1px #2c6ecb;
}

.rnz-maps-location-btn {
    padding: 10px 12px;
    background: #2c6ecb;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.rnz-maps-location-btn:hover { opacity: 0.85; }

/* ---- Office list ---- */
.rnz-maps-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}

.rnz-map-item {
    padding: 16px;
    border-bottom: 1px solid #e1e3e5;
    cursor: pointer;
    transition: background 0.2s;
}

.rnz-map-item:hover  { background: #f4f6f8; }

.rnz-map-item.active {
    background: #f4f6f8;
    border-left: 4px solid #2c6ecb;
    padding-left: 12px;
}

.rnz-map-item-title {
    font-weight: 600;
    color: #202223;
    margin: 0 0 4px 0;
    font-size: 15px;
}

.rnz-map-item-address {
    color: #6d7175;
    font-size: 13px;
    margin: 0 0 6px 0;
}

.rnz-map-item-cat {
    display: inline-block;
    background: #e4e5e7;
    color: #454f5b;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.rnz-map-item-distance {
    background: #e1f5fe;
    color: #0288d1;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Map container ---- */
.rnz-maps-map-container {
    flex: 1;
    min-height: 400px;
    z-index: 1;
}

@media (min-width: 768px) {
    .rnz-maps-map-container {
        min-height: unset;
        height: 100%;
    }
}

/* ---- Leaflet Popup ---- */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
    margin: 16px;
    min-width: 200px;
}
