/*
 * Chunara Store Locator styles.
 * All rules scoped under .bh-sl-container to avoid leaking to other
 * page elements. Palette matches the site (deep red #B01621, cream
 * background #fcf9f8, off-white #f6f3f2, cream border #e3bebb).
 */

/* Wrapper */
.bh-sl-container {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    color: #1c1b1b;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Admin-only empty state before import runs */
.chunara-sl-empty {
    background: #fcf9f8;
    border: 1px dashed #e3bebb;
    padding: 24px;
    color: #8f706d;
    text-align: center;
    font-size: 14px;
}
.chunara-sl-empty a { color: #B01621; font-weight: 600; }

/* Runtime error banner */
.chunara-sl-error {
    background: #fff2f2;
    border-left: 4px solid #B01621;
    padding: 16px 20px;
    color: #7A0F17;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ============================================================
   FORM / SEARCH
   ============================================================ */
.bh-sl-form-container {
    background: #fcf9f8;
    border: 1px solid #e3bebb;
    padding: 32px;
    margin-bottom: 24px;
}
.bh-sl-form-container form { margin: 0; }
.bh-sl-form-container .form-input {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
}
.bh-sl-form-container label[for="bh-sl-address"] {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #8f706d;
    margin-bottom: 6px;
    width: 100%;
}
.bh-sl-form-container #bh-sl-address {
    flex: 1 1 320px;
    min-width: 240px;
    padding: 12px 16px;
    border: 1px solid #e3bebb;
    background: #fff;
    font-size: 15px;
    color: #1c1b1b;
    height: 46px;
    box-sizing: border-box;
}
.bh-sl-form-container #bh-sl-address:focus {
    outline: none;
    border-color: #B01621;
    box-shadow: 0 0 0 3px rgba(176, 22, 33, 0.12);
}
.bh-sl-form-container #bh-sl-maxdistance {
    padding: 12px 16px;
    border: 1px solid #e3bebb;
    background: #fff;
    font-size: 15px;
    color: #1c1b1b;
    height: 46px;
    min-width: 130px;
    box-sizing: border-box;
    cursor: pointer;
}
.bh-sl-form-container .bh-sl-submit {
    background: #B01621;
    color: #fff;
    border: 0;
    padding: 0 32px;
    height: 46px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: background 200ms;
}
.bh-sl-form-container .bh-sl-submit:hover {
    background: #7A0F17;
}

/* Filter checkboxes */
.bh-sl-filters-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e3bebb;
}
.bh-sl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.bh-sl-filters-heading {
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8f706d;
    margin-bottom: 8px;
}
.bh-sl-filters li {
    margin: 0;
    padding: 0;
}
.bh-sl-filters label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #e3bebb;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #1c1b1b;
    transition: background 200ms, border-color 200ms;
}
.bh-sl-filters label:hover {
    border-color: #B01621;
    color: #B01621;
}
.bh-sl-filters input[type="checkbox"] {
    accent-color: #B01621;
    cursor: pointer;
    margin: 0;
}

/* ============================================================
   MAP + LIST
   ============================================================ */
.bh-sl-map-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: 600px auto;
    gap: 0;
    border: 1px solid #e3bebb;
    background: #fff;
}
.bh-sl-map {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    height: 600px;
    background: #f6f3f2;
}
.bh-sl-loc-list {
    grid-column: 2;
    grid-row: 1;
    height: 600px;
    overflow-y: auto;
    background: #fff;
    border-left: 1px solid #e3bebb;
}
.bh-sl-loc-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.bh-sl-loc-list li {
    padding: 16px 20px;
    border-bottom: 1px solid #f0e6e4;
    cursor: pointer;
    transition: background 150ms;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.bh-sl-loc-list li:hover,
.bh-sl-loc-list li.list-focus {
    background: #fcf9f8;
}
.bh-sl-loc-list .list-label {
    flex: 0 0 auto;
}
.bh-sl-loc-list .loc-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #B01621;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    font-style: normal;
}
.bh-sl-loc-list .list-details {
    flex: 1;
    min-width: 0;
}
.bh-sl-loc-list .list-content {
    font-size: 13px;
    line-height: 1.5;
}
.bh-sl-loc-list .loc-name {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #1c1b1b;
    margin: 0 0 4px;
    line-height: 1.3;
}
.bh-sl-loc-list .loc-addr,
.bh-sl-loc-list .loc-addr2,
.bh-sl-loc-list .loc-addr3 {
    color: #5b403e;
}
.bh-sl-loc-list .loc-phone {
    margin-top: 4px;
}
.bh-sl-loc-list .loc-phone a {
    color: #B01621;
    text-decoration: none;
    font-weight: 500;
}
.bh-sl-loc-list .loc-phone a:hover { text-decoration: underline; }
.bh-sl-loc-list .loc-directions {
    margin-top: 8px;
}
.bh-sl-loc-list .loc-directions a {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #B01621;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #B01621;
    transition: background 200ms, color 200ms;
}
.bh-sl-loc-list .loc-directions a:hover {
    background: #B01621;
    color: #fff;
}
.bh-sl-loc-list .list-distance {
    flex: 0 0 auto;
    font-size: 12px;
    color: #8f706d;
    font-weight: 500;
    padding-top: 2px;
}

/* No-results */
.bh-sl-noresults-title {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    font-size: 20px;
    color: #1c1b1b;
    padding: 24px 20px 4px;
}
.bh-sl-noresults-desc {
    padding: 0 20px 24px;
    color: #5b403e;
    font-size: 14px;
    line-height: 1.6;
}

/* Loading indicator (plugin appends a .bh-sl-loading div during AJAX) */
.bh-sl-loading {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #8f706d;
}
.bh-sl-loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #e3bebb;
    border-top-color: #B01621;
    border-radius: 50%;
    animation: chunara-sl-spin 700ms linear infinite;
    margin-right: 12px;
}
@keyframes chunara-sl-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   PAGINATION
   ============================================================ */
.bh-sl-pagination-container {
    grid-column: 1 / -1;
    grid-row: 2;
    padding: 16px;
    border-top: 1px solid #e3bebb;
    background: #fcf9f8;
}
.bh-sl-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
.bh-sl-pagination li {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e3bebb;
    color: #1c1b1b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 150ms, color 150ms, border-color 150ms;
}
.bh-sl-pagination li:hover {
    background: #B01621;
    color: #fff;
    border-color: #B01621;
}
.bh-sl-pagination li.bh-sl-current {
    background: #B01621;
    color: #fff;
    border-color: #B01621;
    cursor: default;
}
.bh-sl-pagination li.bh-sl-next-prev {
    font-weight: 600;
}

/* ============================================================
   GOOGLE PLACES AUTOCOMPLETE DROPDOWN
   ============================================================ */
.pac-container {
    border: 1px solid #e3bebb;
    box-shadow: 0 8px 24px rgba(28, 27, 27, 0.12);
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    margin-top: 4px;
}
.pac-item {
    padding: 10px 16px;
    border-top: 1px solid #f0e6e4;
    cursor: pointer;
    font-size: 13px;
}
.pac-item:hover { background: #fcf9f8; }
.pac-item-query { color: #1c1b1b; font-weight: 500; }
.pac-matched { color: #B01621; }

/* ============================================================
   INFOWINDOW (Google Maps popup on marker click)
   ============================================================ */
.bh-sl-infowindow {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    padding: 4px;
    min-width: 200px;
    max-width: 280px;
}
.bh-sl-infowindow .loc-name {
    font-family: 'Open Sans', 'Helvetica', 'Arial', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1c1b1b;
    margin: 0 0 6px;
    line-height: 1.3;
}
.bh-sl-infowindow .loc-addr,
.bh-sl-infowindow .loc-addr2,
.bh-sl-infowindow .loc-addr3 {
    font-size: 13px;
    color: #5b403e;
    line-height: 1.4;
}
.bh-sl-infowindow .loc-phone,
.bh-sl-infowindow .loc-web {
    font-size: 13px;
    margin-top: 6px;
}
.bh-sl-infowindow a {
    color: #B01621;
    text-decoration: none;
}
.bh-sl-infowindow a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .bh-sl-container { padding: 24px 16px; }
    .bh-sl-form-container { padding: 24px 20px; }
    .bh-sl-map-container {
        grid-template-columns: 1fr;
        grid-template-rows: 400px 400px auto;
    }
    .bh-sl-map { grid-column: 1; grid-row: 1; height: 400px; }
    .bh-sl-loc-list {
        grid-column: 1;
        grid-row: 2;
        height: 400px;
        border-left: 0;
        border-top: 1px solid #e3bebb;
    }
    .bh-sl-pagination-container { grid-column: 1; grid-row: 3; }
}
@media (max-width: 640px) {
    .bh-sl-form-container .form-input { flex-direction: column; align-items: stretch; }
    .bh-sl-form-container #bh-sl-address,
    .bh-sl-form-container #bh-sl-maxdistance,
    .bh-sl-form-container .bh-sl-submit { width: 100%; min-width: 0; }
    .bh-sl-filters { gap: 6px; }
    .bh-sl-filters label { font-size: 12px; padding: 5px 10px; }
    .bh-sl-map-container { grid-template-rows: 320px 320px auto; }
    .bh-sl-map { height: 320px; }
    .bh-sl-loc-list { height: 320px; }
}
