/* CompleteStores front end. All brand values come from CSS custom properties set on .cs. */
.cs {
    --cs-pin: #e53935;
    --cs-user: #1f6feb;
    --cs-primary-bg: #2563eb;
    --cs-primary-text: #ffffff;
    --cs-secondary-bg: #1f2937;
    --cs-secondary-text: #ffffff;
    --cs-link: #2563eb;
    --cs-card-bg: #ffffff;
    --cs-border: #e2e5e9;
    --cs-text: inherit;
    --cs-muted: #6b7280;
    --cs-font: inherit;
    --cs-btn-radius: 8px;
    --cs-card-radius: 10px;
    --cs-map-radius: 10px;
    --cs-map-height: 560px;
    color: var(--cs-text);
    font-family: var(--cs-font);
    box-sizing: border-box;
}

.cs *,
.cs *::before,
.cs *::after {
    box-sizing: border-box;
}

.cs__toolbar {
    margin-bottom: 18px;
}

.cs__search-row,
.cs__controls-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cs__controls-row {
    margin-top: 10px;
}

.cs__search {
    min-width: 220px;
    flex: 1 1 320px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-btn-radius);
    background: #fff;
    color: #1f2937;
    font: inherit;
}

.cs__btn,
.cs__radius {
    min-height: 46px;
    border-radius: var(--cs-btn-radius);
    border: 1px solid var(--cs-border);
    background: #fff;
    color: #1f2937;
    padding: 0 16px;
    font: inherit;
    cursor: pointer;
}

.cs__btn--primary {
    background: var(--cs-primary-bg);
    border-color: var(--cs-primary-bg);
    color: var(--cs-primary-text);
    font-weight: 700;
}

.cs__btn--location {
    background: var(--cs-secondary-bg);
    border-color: var(--cs-secondary-bg);
    color: var(--cs-secondary-text);
    font-weight: 700;
}

.cs__btn:hover,
.cs__btn:focus-visible {
    filter: brightness(0.92);
}

.cs__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.cs__btn:focus-visible,
.cs__search:focus-visible,
.cs__radius:focus-visible,
.cs-card:focus-visible,
.cs a:focus-visible {
    outline: 3px solid var(--cs-link);
    outline-offset: 2px;
}

.cs__radius-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.cs__status {
    min-height: 22px;
    margin: 10px 0 0;
    color: var(--cs-muted);
    font-size: 14px;
}

.cs__layout {
    display: grid;
    grid-template-columns: minmax(280px, 38%) minmax(0, 62%);
    gap: 18px;
    align-items: stretch;
}

.cs--list-right .cs__layout {
    grid-template-columns: minmax(0, 62%) minmax(280px, 38%);
}

.cs--list-right .cs__results {
    order: 2;
}

.cs--stacked .cs__layout {
    grid-template-columns: 1fr;
}

.cs--stacked .cs__map {
    order: 1;
}

.cs--stacked .cs__results {
    order: 2;
    max-height: none;
}

.cs__results {
    max-height: var(--cs-map-height);
    overflow: auto;
    padding-right: 4px;
}

.cs__map {
    height: var(--cs-map-height);
    min-height: 280px;
    border-radius: var(--cs-map-radius);
    overflow: hidden;
    border: 1px solid var(--cs-border);
    z-index: 0;
}

.cs-card {
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-card-radius);
    padding: 16px;
    margin-bottom: 12px;
    background: var(--cs-card-bg);
    cursor: pointer;
}

.cs-card__top {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
}

.cs-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
    color: inherit;
}

.cs-card p {
    margin: 0 0 10px;
    color: var(--cs-muted);
}

.cs-card__distance {
    white-space: nowrap;
    font-weight: 600;
}

.cs-card__phone,
.cs-card__directions {
    display: inline-block;
    margin-right: 12px;
    color: var(--cs-link);
}

.cs-card__directions {
    font-weight: 600;
}

.cs__empty {
    padding: 16px;
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-card-radius);
}

.cs-popup strong {
    display: block;
    margin-bottom: 4px;
}

.cs-popup a {
    color: var(--cs-link);
}

.cs-popup__distance {
    margin-top: 4px;
    font-weight: 600;
}

/* Pins: one inline SVG, coloured by --cs-pin. */
.cs-pin-wrapper {
    background: transparent;
    border: 0;
}

.cs-pin {
    display: block;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.cs-pin__shape {
    fill: var(--cs-pin);
    stroke: #ffffff;
    stroke-width: 1.5;
}

.cs-pin__dot {
    fill: #ffffff;
}

.cs-user-location {
    stroke: var(--cs-user);
    fill: #ffffff;
}

@media (max-width: 820px) {
    .cs__layout,
    .cs--list-right .cs__layout {
        grid-template-columns: 1fr;
    }

    .cs__map {
        order: 1;
        height: min(var(--cs-map-height), 430px);
    }

    .cs__results,
    .cs--list-right .cs__results {
        max-height: none;
        order: 2;
    }
}

@media (max-width: 540px) {
    .cs__search-row,
    .cs__controls-row {
        align-items: stretch;
    }

    .cs__search,
    .cs__btn,
    .cs__radius-label,
    .cs__radius {
        width: 100%;
    }

    .cs__radius-label {
        flex-direction: column;
        align-items: flex-start;
    }

    .cs__map {
        height: min(var(--cs-map-height), 360px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cs * {
        transition: none !important;
    }
}
