/* ==========================================================================
   Store locator — eyewa-style "Our Stores" (markup: includes/sf_header.php,
   behaviour: assets/js/storefront-header.js). Full-screen: store list with search and
   "use my current location" beside a full map with store pins and a free eye-test card.
   ========================================================================== */

body.sf-modern .sf-locator { z-index: 2050; }
body.sf-modern .sf-loc {
    /* List first, map second: in Arabic (RTL) the list sits on the right, in English on the left — like eyewa */
    position: absolute; inset: 0; display: grid; grid-template-columns: minmax(340px, 470px) 1fr; grid-template-areas: "side map";
    background: #fff; opacity: 0; transform: translateY(14px); transition: opacity .25s ease, transform .3s cubic-bezier(.2, .7, .2, 1);
}
body.sf-modern .sf-locator.is-open .sf-loc { opacity: 1; transform: none; }

/* ---------- List side ---------- */
body.sf-modern .sf-loc-side { grid-area: side; display: flex; flex-direction: column; min-height: 0; border-inline-end: 1px solid #f0f0f0; }
body.sf-modern .sf-loc-top { padding: 1.4rem 1.4rem .6rem; }
body.sf-modern .sf-loc-searchrow { display: flex; align-items: center; gap: .6rem; }
body.sf-modern .sf-loc-search {
    flex: 1; display: flex; align-items: center; gap: .6rem; height: 54px; padding: 0 1.1rem; margin: 0;
    background: #f5f6f7; border-radius: 14px; cursor: text;
}
body.sf-modern .sf-loc-search .ti { font-size: 1.3rem; color: var(--sf-ink); }
body.sf-modern .sf-loc-search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 1rem; min-width: 0; }
body.sf-modern .sf-loc-search input::placeholder { color: #9aa0ab; }
body.sf-modern .sf-loc-near {
    display: inline-flex; align-items: center; gap: .45rem; margin-top: 1.1rem; padding: 0; border: 0; background: none;
    color: var(--primary-color); font-weight: 700; font-size: .98rem;
}
body.sf-modern .sf-loc-near .ti { font-size: 1.35rem; }
body.sf-modern .sf-near-status { color: var(--sf-muted); font-size: .82rem; margin-top: .35rem; min-height: 1em; }
body.sf-modern .sf-loc-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
body.sf-modern .sf-loc-empty { padding: 2rem 1.4rem; color: var(--sf-muted); text-align: center; }

body.sf-modern .sf-store { padding: 1.4rem 1.4rem 1.5rem; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background .15s; }
body.sf-modern .sf-store:hover { background: #fbfbfb; }
body.sf-modern .sf-store.is-active { background: color-mix(in srgb, var(--primary-color) 5%, #fff); }
body.sf-modern .sf-store-head { display: flex; align-items: flex-start; gap: .75rem; }
body.sf-modern .sf-store-pin { font-size: 1.5rem; color: #3b3f47; margin-top: .05rem; }
body.sf-modern .sf-store.is-active .sf-store-pin { color: var(--primary-color); }
body.sf-modern .sf-store-name { flex: 1; font-weight: 700; font-size: 1.12rem; line-height: 1.4; color: var(--sf-ink); }
body.sf-modern .sf-store-dist { font-size: .9rem; color: var(--sf-ink); white-space: nowrap; margin-top: .2rem; }
body.sf-modern .sf-store-addr { margin: .55rem 0 0; padding-inline-start: 2.25rem; color: #8a909b; font-size: .92rem; line-height: 1.6; min-height: 1.2em; }
body.sf-modern .sf-store-addr:empty { display: none; }
body.sf-modern .sf-store-hours {
    display: flex; align-items: center; gap: .4rem; margin: .8rem 0 0; padding: 0; padding-inline-start: 2.25rem; border: 0; background: none;
    color: var(--sf-ink); font-size: .92rem; text-align: start;
}
body.sf-modern .sf-store-hours .is-open { color: #12805c; font-weight: 700; }
body.sf-modern .sf-store-hours .is-closed { color: #c03a2b; font-weight: 700; }
body.sf-modern .sf-store-chev { transition: transform .2s; margin-inline-start: .15rem; }
body.sf-modern .sf-store-hours[aria-expanded="true"] .sf-store-chev { transform: rotate(180deg); }
body.sf-modern .sf-store-week { list-style: none; margin: .6rem 0 0; padding: 0; padding-inline-start: 2.25rem; max-width: 330px; font-size: .88rem; color: #5a606b; }
body.sf-modern .sf-store-week li { display: flex; justify-content: space-between; padding: .2rem 0; }
body.sf-modern .sf-store-week li.is-today { color: var(--sf-ink); font-weight: 700; }
body.sf-modern .sf-store-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; padding-inline-start: 2.25rem; }
body.sf-modern .sf-store-book {
    display: inline-flex; align-items: center; justify-content: center; padding: .8rem 1.5rem; border-radius: 999px;
    background: color-mix(in srgb, var(--primary-color) 12%, #fff); color: var(--primary-color) !important; font-weight: 700; font-size: .95rem;
    text-decoration: none; transition: background .2s, color .2s;
}
body.sf-modern .sf-store-book:hover { background: var(--primary-color); color: #fff !important; }
body.sf-modern .sf-store-dir { display: inline-flex; align-items: center; gap: .3rem; color: var(--sf-ink) !important; font-weight: 600; font-size: .9rem; text-decoration: none; }
body.sf-modern .sf-store-dir:hover { color: var(--primary-color) !important; }

/* ---------- Map side ---------- */
body.sf-modern .sf-loc-map { grid-area: map; position: relative; min-height: 0; background: #eef1f3; }
body.sf-modern #sfStoresMap { position: absolute; inset: 0; }
body.sf-modern .sf-pin {
    width: 52px; height: 52px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 18px rgba(20, 22, 31, .25); color: var(--primary-color); font-size: 1.6rem; position: relative; transition: transform .2s;
}
body.sf-modern .sf-pin::after {
    content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%);
    border: 9px solid transparent; border-bottom: 0; border-top-color: #fff;
}
body.sf-modern .sf-pin.is-active { background: var(--primary-color); color: #fff; transform: scale(1.12); }
body.sf-modern .sf-pin.is-active::after { border-top-color: var(--primary-color); }
body.sf-modern .sf-you { width: 18px; height: 18px; border-radius: 50%; background: #2f80ed; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47, 128, 237, .25); }

body.sf-modern .sf-loc-card {
    /* next to the list, like eyewa */
    position: absolute; z-index: 500; bottom: 28px; inset-inline-start: 28px; width: min(400px, calc(100% - 56px));
    display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border: 0; border-radius: 18px; text-align: start;
    background: #fff; box-shadow: 0 14px 40px rgba(20, 22, 31, .18); transition: transform .2s, box-shadow .2s;
}
body.sf-modern .sf-loc-card:hover { transform: translateY(-2px); box-shadow: 0 18px 46px rgba(20, 22, 31, .22); }
body.sf-modern .sf-loc-card-icon {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--primary-color) 12%, #fff); color: var(--primary-color); font-size: 1.6rem;
}
body.sf-modern .sf-loc-card-text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
body.sf-modern .sf-loc-card-text strong { font-size: 1.15rem; color: var(--sf-ink); }
body.sf-modern .sf-loc-card-text small { color: #6b717c; font-size: .85rem; }
body.sf-modern .sf-loc-card-text em { font-style: normal; font-weight: 700; color: var(--primary-color); font-size: .88rem; }
body.sf-modern .sf-loc-card-go { font-size: 1.4rem; color: var(--sf-ink); }
body.sf-modern .sf-loc .leaflet-control-zoom { border: 0 !important; box-shadow: 0 6px 18px rgba(20, 22, 31, .15) !important; border-radius: 12px !important; overflow: hidden; }
body.sf-modern .sf-loc .leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; }

/* ---------- Phones: map on top, list below as a sheet ---------- */
@media (max-width: 768px) {
    body.sf-modern .sf-loc {
        grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; grid-template-areas: "map" "side";
    }
    body.sf-modern .sf-loc-side { border: 0 !important; border-radius: 20px 20px 0 0; margin-top: -18px; background: #fff; position: relative; z-index: 600; box-shadow: 0 -8px 24px rgba(20, 22, 31, .08); }
    body.sf-modern .sf-loc-top { padding: 1rem 1rem .4rem; }
    body.sf-modern .sf-loc-search { height: 48px; }
    body.sf-modern .sf-store { padding: 1.1rem 1rem 1.2rem; }
    body.sf-modern .sf-store-name { font-size: 1rem; }
    body.sf-modern .sf-loc-card { bottom: 30px; inset-inline-start: 12px; width: calc(100% - 24px); padding: .75rem .9rem; }
    body.sf-modern .sf-loc-card-icon { width: 42px; height: 42px; font-size: 1.3rem; }
    body.sf-modern .sf-loc-card-text small { display: none; }
    body.sf-modern .sf-loc-list { padding-bottom: env(safe-area-inset-bottom, 0); }
}
