:root {
    --store-red: #b31d3d;
    --store-black: #171717;
    --store-gray: #737373;
    --store-border: #e8e8e8;
}

.locations-page,
.locations-page * {
    box-sizing: border-box;
}

.locations-page {
    max-width: 1450px;
    margin: 0 auto;
    padding: 35px 20px 60px;
    font-family: Arial, sans-serif;
    color: var(--store-black);
}

/* HEADER */

.locations-header {
    margin-bottom: 23px;
}

    .locations-header h1 {
        font-size: 32px;
        font-weight: 700;
        margin: 0 0 10px;
    }

    .locations-header p {
        margin: 0;
        color: var(--store-gray);
        font-size: 14px;
        line-height: 1.6;
    }

/* FILTERS */

.locations-filters {
    display: grid;
    grid-template-columns: 1fr 190px 190px auto;
    gap: 12px;
    margin-bottom: 20px;
}

.locations-input,
.locations-select {
    width: 100%;
    height: 45px;
    padding: 0 14px;
    border: 1px solid var(--store-border);
    background: #fafafa;
    border-radius: 2px;
    font-size: 14px;
    outline: none;
    color: #222;
}

    .locations-input:focus,
    .locations-select:focus {
        border-color: var(--store-red);
        background: #fff;
    }

.locations-reset {
    height: 45px;
    padding: 0 17px;
    background: white;
    border: 1px solid var(--store-border);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

    .locations-reset:hover {
        border-color: var(--store-red);
        color: var(--store-red);
    }

/* MAIN */

.locations-layout {
    display: grid;
    grid-template-columns: 450px minmax(0, 1fr);
    gap: 20px;
    height: 575px;
    min-height: 0;
}

/* SIDEBAR */

.locations-sidebar {
    border: 1px solid var(--store-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: white;
}

.locations-sidebar-header {
    padding: 17px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--store-border);
}

    .locations-sidebar-header h2 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
    }

.locations-count {
    font-size: 12px;
    color: #666;
    background: #f4f4f4;
    border-radius: 30px;
    padding: 7px 11px;
}

.locations-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* STORE CARD */

.locations-card {
    display: flex;
    gap: 14px;
    padding: 17px;
    border-bottom: 1px solid var(--store-border);
    position: relative;
    cursor: pointer;
    transition: background .2s;
}

    .locations-card:hover {
        background: #fafafa;
    }

    .locations-card.active {
        background: #fff7f9;
    }

        .locations-card.active::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            bottom: 0;
            width: 3px;
            background: var(--store-red);
        }

.locations-card-image {
    width: 120px;
    height: 135px;
    flex-shrink: 0;
    object-fit: cover;
    background: #f7f7f7;
}

.locations-card-noimage {
    width: 120px;
    height: 135px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f7f7f7;
    color: var(--store-red);
    font-family: Georgia, serif;
    font-weight: 900;
    font-size: 57px;
    font-style: italic;
}

.locations-card-content {
    flex: 1;
    min-width: 0;
}

.locations-card-type {
    display: block;
    font-size: 10px;
    letter-spacing: .7px;
    font-weight: 700;
    color: var(--store-red);
    text-transform: uppercase;
    margin: 0 0 5px;
}

.locations-card-title {
    font-size: 16px;
    line-height: 1.35;
    margin: 0 0 9px;
    font-weight: 700;
}

.locations-card-info {
    color: #737373;
    font-size: 13px;
    line-height: 1.5;
    margin: 4px 0;
}

.locations-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 13px;
    flex-wrap: wrap;
}

.locations-button {
    border: 1px solid var(--store-black);
    background: var(--store-black);
    color: white;
    padding: 10px 13px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

    .locations-button:hover {
        background: var(--store-red);
        border-color: var(--store-red);
        color: #fff;
    }

.locations-button-outline {
    background: white;
    color: var(--store-black);
    border-color: #ddd;
}

.locations-empty {
    padding: 35px 20px;
    text-align: center;
    font-size: 14px;
    color: #777;
    line-height: 1.7;
}

/* MAP */

.locations-map-parent {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #f3f3f3;
}

#locationsMap {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.locations-map-reset {
    position: absolute;
    z-index: 500;
    top: 16px;
    left: 16px;
    background: #fff;
    padding: 12px 15px;
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,.12);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

/* INDIVIDUAL MARKER */

.locations-marker-wrapper,
.locations-cluster-wrapper {
    border: 0;
    background: transparent;
}

.locations-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    font-family: Georgia, serif;
    font-weight: 900;
    font-style: italic;
}

    .locations-marker img {
        width: 32px;
        height: 32px;
    }

/* CLUSTER */

.locations-cluster {
    background: var(--store-red);
    color: white;
    border: 3px solid white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
}

    .locations-cluster.large {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }

/* POPUP - COMPACT */

.leaflet-popup.locations-popup .leaflet-popup-content-wrapper {
    border-radius: 7px;
    padding: 0 !important;
    overflow: hidden;
    height: auto !important;
    min-height: 0 !important;
}

.leaflet-popup.locations-popup .leaflet-popup-content {
    margin: 0 !important;
    width: 265px !important;
    max-width: 265px !important;
    min-height: 0 !important;
    height: auto !important;
}

.locations-popup-inner {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

    .locations-popup-inner h3 {
        margin: 0;
        font-size: 18px;
        line-height: 1.3;
        color: #171717;
    }

    .locations-popup-inner p {
        margin: 0 !important;
        font-size: 13px;
        line-height: 1.5;
        color: #555;
    }

    .locations-popup-inner .popup-address {
        color: var(--store-red);
    }

.locations-popup-link {
    display: block;
    background: #171717;
    color: white !important;
    text-align: center;
    padding: 11px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
}

    .locations-popup-link:hover {
        background: var(--store-red);
    }

/* RESPONSIVE */

@media (max-width: 1100px) {
    .locations-layout {
        grid-template-columns: 360px minmax(0, 1fr);
    }

    .locations-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .locations-page {
        padding: 25px 15px;
    }

    .locations-header h1 {
        font-size: 26px;
    }

    .locations-filters {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .locations-input {
        grid-column: span 2;
    }

    .locations-reset {
        grid-column: span 2;
    }

    .locations-layout {
        display: flex;
        flex-direction: column-reverse;
        height: auto;
        gap: 15px;
    }

    .locations-map-parent {
        height: 350px;
        flex-shrink: 0;
    }

    .locations-sidebar {
        height: 450px;
    }

    .locations-card {
        padding: 14px;
    }

    .locations-card-image,
    .locations-card-noimage {
        width: 95px;
        height: 115px;
    }

    .locations-card-title {
        font-size: 14px;
    }
}
