/* =============================================
   NetMitte Store Locator — Design System
   Mobile-first, BEM naming, 8px grid
   ============================================= */

/* ── Main Container ── */
.nm-store-locator {
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    line-height: 1.5;
}

.nm-store-locator *,
.nm-store-locator *::before,
.nm-store-locator *::after {
    box-sizing: border-box;
}

/* ── Header ── */
.nm-store-locator__header {
    margin-bottom: 24px;
}

.nm-store-locator__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

/* ── Search Bar ── */
.nm-store-locator__search-bar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 20;
}

.nm-store-locator__search-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .nm-store-locator__search-inner {
        flex-direction: row;
        align-items: center;
    }
}

.nm-store-locator__search-field {
    position: relative;
    flex: 1;
}

.nm-store-locator__search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.nm-store-locator__input {
    width: 100%;
    height: 48px;
    padding: 0 56px 0 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nm-store-locator__input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.nm-store-locator__locate-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.nm-store-locator__locate-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}

.nm-store-locator__locate-btn.is--loading {
    animation: nm-spin 1s linear infinite;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes nm-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.nm-store-locator__search-actions {
    display: flex;
    gap: 8px;
}

.nm-store-locator__radius {
    height: 48px;
    padding: 0 32px 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    min-width: 90px;
}

.nm-store-locator__search-btn {
    height: 48px;
    padding: 0 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.nm-store-locator__search-btn:hover {
    background: #2563eb;
}

.nm-store-locator__filter-btn {
    height: 48px;
    padding: 0 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    transition: background 0.2s;
}

.nm-store-locator__filter-btn:hover {
    background: #f8fafc;
}

.nm-store-locator__filter-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ── Autocomplete ── */
.nm-store-locator__autocomplete {
    position: absolute;
    top: 100%;
    left: 16px;
    right: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 4px;
}

@media (min-width: 768px) {
    .nm-store-locator__autocomplete {
        right: auto;
        min-width: 400px;
    }
}

.nm-store-locator__autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nm-store-locator__autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.nm-store-locator__autocomplete-item:last-child {
    border-bottom: none;
}

.nm-store-locator__autocomplete-item:hover {
    background: #f8fafc;
}

/* ── Active Filters ── */
.nm-store-locator__active-filters {
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nm-store-locator__active-filters-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nm-store-locator__filter-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.nm-store-locator__filter-chip:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #ef4444;
}

.nm-store-locator__active-filters-clear {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* ── Content Layout ── */
.nm-store-locator__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 500px;
}

@media (min-width: 992px) {
    .nm-store-locator__body {
        flex-direction: row;
        height: 600px;
        /* Fixed height for desktop map */
    }
}

.nm-store-locator__sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

@media (min-width: 992px) {
    .nm-store-locator__sidebar {
        flex: 0 0 400px;
        overflow-y: auto;
        padding-right: 8px;
    }
}

.nm-store-locator__map-col {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    min-height: 300px;
}

.nm-store-locator__map-container {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    position: relative;
}

.nm-store-locator__map {
    width: 100%;
    height: 100%;
}

/* ── Mobile Map Toggle ── */
.nm-store-locator__map-toggle-wrapper {
    margin-bottom: 16px;
    text-align: center;
}

.nm-store-locator__map-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

@media (max-width: 991px) {
    .nm-store-locator__map-col {
        display: none;
        height: 400px;
    }

    .nm-store-locator__map-col.is--visible {
        display: block;
    }
}

/* ── Store Card ── */
.nm-store-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    margin-bottom: 16px;
}

.nm-store-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nm-store-card.is--active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.nm-store-card__banner {
    height: 80px;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
}

.nm-store-card__content {
    padding: 16px;
    display: flex;
    gap: 16px;
}

.nm-store-card__logo {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nm-store-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nm-store-card__info {
    flex: 1;
    min-width: 0;
}

.nm-store-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    flex-wrap: wrap;
    gap: 8px;
}

.nm-store-card__name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #0f172a;
}

.nm-store-card__badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.nm-store-card__badge--featured {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
}

.nm-store-card__categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.nm-store-card__cat-pill {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 500;
}

.nm-store-card__body {
    font-size: 14px;
    color: #64748b;
}

.nm-store-card__address,
.nm-store-card__distance {
    margin: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.nm-store-card__address svg,
.nm-store-card__distance svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: #94a3b8;
}

.nm-store-card__actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.nm-store-card__action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.nm-store-card__action:hover {
    text-decoration: underline;
}

.nm-store-card__desc-wrap.is--open {
    max-height: 500px !important;
}

/* ── Filter Drawer ── */
.nm-store-locator__filter-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    visibility: hidden;
    transition: visibility 0.3s;
}

.nm-store-locator__filter-drawer.is--open {
    visibility: visible;
}

.nm-store-locator__filter-drawer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
}

.nm-store-locator__filter-drawer.is--open .nm-store-locator__filter-drawer-backdrop {
    opacity: 1;
}

.nm-store-locator__filter-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.nm-store-locator__filter-drawer.is--open .nm-store-locator__filter-drawer-panel {
    transform: translateX(0);
}

.nm-store-locator__filter-drawer-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nm-store-locator__filter-drawer-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.nm-store-locator__filter-drawer-close {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #64748b;
}

.nm-store-locator__filter-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.nm-store-locator__filter-group h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nm-store-locator__filter-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    font-size: 15px;
    color: #334155;
}

.nm-store-locator__filter-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
}

.nm-store-locator__filter-drawer-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
}

.nm-store-locator__filter-apply {
    flex: 2;
    background: #3b82f6;
    color: #fff;
    border: none;
    height: 48px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.nm-store-locator__filter-reset {
    flex: 1;
    background: #f1f5f9;
    color: #475569;
    border: none;
    height: 48px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ── Map Consent ── */
.nm-store-locator__map-consent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.nm-store-locator__map-consent h4 {
    margin: 16px 0 8px;
}

.nm-store-locator__consent-btn {
    margin-top: 16px;
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
}

/* ── Result Info ── */
.nm-store-locator__result-info {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.nm-store-locator__result-count {
    font-weight: 700;
    color: #0f172a;
}

/* ── Skeleton ── */
.nm-store-locator__skeleton-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.nm-store-locator__skeleton-line {
    height: 16px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
    animation: nm-pulse 1.5s infinite;
}

.nm-store-locator__skeleton-line--title {
    width: 60%;
    height: 20px;
    margin-bottom: 12px;
}

.nm-store-locator__skeleton-line--text {
    width: 90%;
}

.nm-store-locator__skeleton-line--short {
    width: 40%;
}

@keyframes nm-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.nm-store-locator__empty,
.nm-store-locator__error {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.nm-store-locator__load-more {
    text-align: center;
    margin-top: 16px;
}

.nm-store-locator__load-more-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
}

.nm-store-locator__load-more-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}