/* ==========================================================================
   Locker Locator Frontend v1.3 — Mobile-first, City Pills, Dynamic Map
   ========================================================================== */

.llocker-app {
    --llocker-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, #333));
    --llocker-radius: 12px;
    --llocker-radius-sm: 8px;
    --llocker-shadow: 0 1px 8px rgba(0,0,0,.06);
    --llocker-shadow-hover: 0 4px 20px rgba(0,0,0,.10);
    --llocker-transition: .2s ease;
    --llocker-success: #16a34a;
    --llocker-danger: #dc2626;
    --llocker-warning: #d97706;
    --llocker-border: rgba(0,0,0,.08);
    --llocker-bg-muted: #f7f7f8;
}

.llocker-app *, .llocker-app *::before, .llocker-app *::after { box-sizing: border-box; }
.llocker-app { font-family: inherit; color: inherit; line-height: inherit; font-size: inherit; }
.llocker-app a { color: inherit; }
.llocker-app button { font-family: inherit; }

/* ===== Hero — white ===== */
.llocker-hero {
    background: #fff;
    border-bottom: 1px solid var(--llocker-border);
    padding: 48px 24px 28px;
    text-align: center;
}
.llocker-hero-inner { max-width: 700px; margin: 0 auto; }
.llocker-hero-title {
    font-size: clamp(1.5rem, 3.5vw, 2.2rem);
    font-weight: 700; margin: 0 0 8px;
    letter-spacing: -.01em; line-height: 1.25;
}
.llocker-hero-subtitle { opacity: .55; font-size: clamp(.9rem, 2vw, 1.05rem); margin: 0 0 24px; }

/* ===== Search Row: search bar + location button stacked on mobile ===== */
.llocker-search-row {
    display: flex; flex-direction: column; align-items: center;
    gap: 10px; max-width: 620px; margin: 0 auto;
}

/* Search bar pill */
.llocker-search-bar {
    display: flex; align-items: center;
    background: #fff; border-radius: 50px;
    padding: 5px 5px 5px 18px;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
    border: 1px solid var(--llocker-border);
    width: 100%; gap: 4px;
}
.llocker-search-icon { opacity: .4; flex-shrink: 0; display: flex; }
.llocker-search-input {
    flex: 1; border: none; outline: none;
    font-size: .92rem; font-family: inherit; color: inherit;
    background: transparent; padding: 9px 8px; min-width: 0;
}
.llocker-search-input::placeholder { opacity: .4; color: inherit; }

/* Search button — accent bg, white text */
.llocker-search-btn {
    background: var(--llocker-accent);
    color: #fff !important;
    border: none; border-radius: 50px;
    padding: 9px 22px; font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: var(--llocker-transition); white-space: nowrap;
}
.llocker-search-btn:hover { filter: brightness(.85); transform: translateY(-1px); }

/* "Search by your location" — outline/text button, no fill */
.llocker-location-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: transparent;
    border: 1.5px solid var(--llocker-border);
    border-radius: 50px;
    padding: 8px 18px;
    font-size: .84rem; font-weight: 600;
    color: inherit; cursor: pointer;
    transition: var(--llocker-transition);
    white-space: nowrap;
}
.llocker-location-btn:hover {
    border-color: var(--llocker-accent);
    color: var(--llocker-accent);
    background: transparent;
}
.llocker-location-btn svg { opacity: .6; }
.llocker-location-btn:hover svg { opacity: 1; }

/* ===== City Pills — horizontal scroll, mobile-first ===== */
.llocker-city-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 16px 0 4px;
    justify-content: flex-start;
    text-align: left;
    max-width: 620px;
    margin: 0 auto;
}
.llocker-city-pills::-webkit-scrollbar { display: none; }

.llocker-city-pill {
    display: inline-flex; align-items: center; gap: 2px;
    background: transparent;
    border: none;
    padding: 6px 4px;
    font-size: .84rem; font-weight: 600;
    color: inherit;
    opacity: .55;
    cursor: pointer;
    transition: var(--llocker-transition);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    flex-shrink: 0;
}
.llocker-city-pill:hover {
    opacity: 1;
    color: var(--llocker-accent);
}
.llocker-city-pill.active {
    opacity: 1;
    color: var(--llocker-accent);
    border-bottom-color: var(--llocker-accent);
}
.llocker-city-count {
    font-weight: 400;
    opacity: .7;
}

/* ===== Message Zone — between cities and map ===== */
.llocker-message-zone {
    max-width: 620px;
    margin: 0 auto;
    text-align: left;
}
.llocker-msg {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-radius: var(--llocker-radius-sm);
    font-size: .86rem;
    font-weight: 500;
    margin-top: 10px;
}
.llocker-msg-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.llocker-msg-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ===== Main ===== */
.llocker-main {
    max-width: 1200px; margin: 0 auto; padding: 24px 16px;
    background: #fff;
}
.llocker-map-wrap {
    border-radius: var(--llocker-radius); overflow: hidden;
    box-shadow: var(--llocker-shadow); margin-bottom: 28px;
    border: 1px solid var(--llocker-border);
}

/* ===== Results ===== */
.llocker-results-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; padding: 0 2px; }
.llocker-results-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.llocker-results-count { font-size: .82rem; opacity: .5; font-weight: 500; }
.llocker-results-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }

/* ===== Card ===== */
.llocker-card {
    background: #fff; border-radius: var(--llocker-radius);
    border: 1px solid var(--llocker-border);
    overflow: hidden; transition: var(--llocker-transition);
    cursor: pointer; display: flex; flex-direction: column;
}
.llocker-card:hover { box-shadow: var(--llocker-shadow-hover); transform: translateY(-2px); }
.llocker-card-image { width: 100%; height: 170px; object-fit: cover; }
.llocker-card-image-placeholder {
    width: 100%; height: 170px; background: var(--llocker-bg-muted);
    display: flex; align-items: center; justify-content: center;
    opacity: .5; font-size: 2.4rem;
}
.llocker-card-body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.llocker-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.llocker-card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.llocker-card-distance { font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--llocker-bg-muted); padding: 3px 10px; border-radius: 20px; opacity: .7; }
.llocker-card-address { font-size: .83rem; opacity: .55; margin-bottom: 12px; display: flex; align-items: flex-start; gap: 5px; line-height: 1.4; }
.llocker-card-address svg { flex-shrink: 0; margin-top: 2px; opacity: .5; }

/* Badges */
.llocker-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.llocker-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.llocker-badge-open { background: #dcfce7; color: var(--llocker-success); }
.llocker-badge-danger { background: #fee2e2; color: var(--llocker-danger); }
.llocker-badge-warning { background: #fef3c7; color: var(--llocker-warning); }
.llocker-badge-soft { background: var(--llocker-bg-muted); color: inherit; opacity: .7; }
.llocker-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Card pricing */
.llocker-card-pricing { display: flex; gap: 16px; padding: 10px 0; border-top: 1px solid var(--llocker-border); margin-top: auto; }
.llocker-price-col { flex: 1; }
.llocker-price-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; opacity: .45; font-weight: 600; margin-bottom: 1px; }
.llocker-price-value { font-size: 1.05rem; font-weight: 700; }

/* Card actions */
.llocker-card-actions { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--llocker-border); margin-top: 12px; }

/* ===== Buttons ===== */
.llocker-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    padding: 7px 14px; border-radius: 50px; font-size: .8rem; font-weight: 600;
    cursor: pointer; transition: var(--llocker-transition);
    border: none; text-decoration: none !important; white-space: nowrap;
}
.llocker-btn-primary {
    background: var(--llocker-accent) !important;
    color: #fff !important; flex: 1;
}
.llocker-btn-primary:hover { filter: brightness(.85); color: #fff !important; }
.llocker-btn-nav {
    background: transparent !important;
    border: 1.5px solid var(--llocker-border) !important;
    color: inherit !important; flex: 1;
}
.llocker-btn-nav:hover { border-color: currentColor !important; background: var(--llocker-bg-muted) !important; }
.llocker-btn-nav-modal {
    background: var(--llocker-accent) !important;
    color: #fff !important; flex: 1;
    padding: 10px 18px !important; font-size: .85rem !important;
}
.llocker-btn-nav-modal:hover { filter: brightness(.85); color: #fff !important; }
.llocker-btn-outline-modal {
    background: transparent !important;
    border: 1.5px solid var(--llocker-border) !important;
    color: inherit !important; flex: 1;
    padding: 10px 18px !important; font-size: .85rem !important;
}
.llocker-btn-outline-modal:hover { border-color: currentColor !important; background: var(--llocker-bg-muted) !important; }
.llocker-btn-icon {
    padding: 7px; background: transparent !important;
    border: 1.5px solid var(--llocker-border) !important;
    border-radius: 50%; width: 34px; height: 34px; color: inherit !important;
}
.llocker-btn-icon:hover { background: var(--llocker-bg-muted) !important; }

/* ===== Modal ===== */
.llocker-modal {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.llocker-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); }
.llocker-modal-content {
    position: relative; background: #fff; border-radius: 18px;
    max-width: 540px; width: 100%; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    animation: llocker-in .2s ease-out;
    font-family: inherit; color: inherit;
}
@keyframes llocker-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.llocker-modal-close {
    position: sticky; top: 10px; float: right; margin: 10px 10px 0 0;
    width: 34px; height: 34px; border-radius: 50%; border: none;
    background: rgba(0,0,0,.06); font-size: 1.2rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center; z-index: 2; color: inherit;
}
.llocker-modal-close:hover { background: rgba(0,0,0,.12); }
.llocker-detail-image { width: 100%; height: 200px; object-fit: cover; }
.llocker-detail-body { padding: 22px 26px 26px; }
.llocker-detail-title { font-size: 1.3rem; font-weight: 700; margin: 0 0 5px; }
.llocker-detail-address { font-size: .88rem; opacity: .55; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 5px; }
.llocker-detail-section { margin-bottom: 18px; }
.llocker-detail-section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .45; margin-bottom: 8px; }
.llocker-detail-text { font-size: .88rem; opacity: .6; line-height: 1.6; }
.llocker-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Pricing table */
.llocker-pricing-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.llocker-pricing-table th {
    background: var(--llocker-bg-muted); padding: 7px 12px; text-align: left;
    font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; opacity: .55;
    border-bottom: 2px solid var(--llocker-border);
}
.llocker-pricing-table td { padding: 7px 12px; border-bottom: 1px solid var(--llocker-border); }
.llocker-pricing-table tr:last-child td { border-bottom: none; }
.llocker-pricing-table tr:hover td { background: var(--llocker-bg-muted); }

/* Show more toggle */
.llocker-show-more-btn {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; cursor: pointer;
    font-family: inherit; font-size: .82rem; font-weight: 600;
    color: var(--llocker-accent); padding: 8px 0; transition: var(--llocker-transition);
}
.llocker-show-more-btn:hover { opacity: .7; }
.llocker-chevron { transition: transform .2s; }

/* Availability */
.llocker-availability-row { display: flex; gap: 10px; }
.llocker-avail-item { flex: 1; background: var(--llocker-bg-muted); border-radius: var(--llocker-radius-sm); padding: 12px; text-align: center; }
.llocker-avail-count { font-size: 1.4rem; font-weight: 700; }
.llocker-avail-count.low { color: var(--llocker-warning); }
.llocker-avail-count.empty { color: var(--llocker-danger); }
.llocker-avail-label { font-size: .72rem; opacity: .5; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* Schedule */
.llocker-schedule-list { list-style: none; padding: 0; margin: 0; font-size: .86rem; }
.llocker-schedule-list li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--llocker-border); }
.llocker-schedule-list li:last-child { border-bottom: none; }
.llocker-schedule-day { font-weight: 600; }
.llocker-schedule-time { opacity: .55; }
.llocker-schedule-closed { color: var(--llocker-danger); font-weight: 600; }

/* Loading / Empty */
.llocker-loading { text-align: center; padding: 50px 20px; grid-column: 1 / -1; }
.llocker-spinner { width: 32px; height: 32px; border: 3px solid var(--llocker-border); border-top-color: currentColor; border-radius: 50%; animation: llocker-spin .7s linear infinite; margin: 0 auto 10px; opacity: .4; }
@keyframes llocker-spin { to { transform: rotate(360deg); } }
.llocker-loading p { opacity: .5; font-size: .88rem; }

/* ===== Responsive — Mobile First ===== */
@media (max-width: 768px) {
    .llocker-hero { padding: 28px 16px 20px; }
    .llocker-hero-title { font-size: 1.4rem; }
    .llocker-hero-subtitle { font-size: .88rem; margin-bottom: 18px; }

    .llocker-search-row { gap: 8px; }
    .llocker-search-bar {
        border-radius: var(--llocker-radius);
        padding: 4px 4px 4px 14px;
    }
    .llocker-search-icon { display: none; }
    .llocker-search-input { font-size: .86rem; padding: 8px 6px; }
    .llocker-search-btn { padding: 8px 16px; font-size: .82rem; }

    .llocker-location-btn { font-size: .8rem; padding: 7px 14px; width: 100%; justify-content: center; }

    .llocker-city-pills { padding: 12px 0 4px; gap: 2px; }
    .llocker-city-pill { font-size: .8rem; padding: 6px 6px; }

    .llocker-main { padding: 16px 12px; }
    .llocker-results-list { grid-template-columns: 1fr; gap: 14px; }

    .llocker-modal-content {
        max-height: 92vh; border-radius: 14px 14px 0 0;
        position: fixed; bottom: 0; left: 0; right: 0; max-width: 100%;
    }
    .llocker-detail-body { padding: 16px 18px 22px; }
}
@media (max-width: 480px) {
    .llocker-card-image, .llocker-card-image-placeholder { height: 140px; }
    .llocker-card-actions { flex-wrap: wrap; }
    .llocker-card-actions .llocker-btn { flex: 1 1 45%; }
}

/* Desktop: search row side by side */
@media (min-width: 769px) {
    .llocker-search-row { flex-direction: row; align-items: center; }
    .llocker-search-bar { flex: 1; }
}
