/**
 * 2007-2025 PrestaShop
 * Store Map front styles.
 * @license http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

.pi-storemap {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 520px;
}

.pi-storemap__sidebar {
    flex: 1 1 320px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    max-height: 640px;
}

.pi-storemap__map {
    flex: 2 1 480px;
    min-height: 520px;
    border-radius: 6px;
    overflow: hidden;
    z-index: 0;
}

.pi-storemap__search {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.pi-storemap__search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.pi-storemap__geoloc.is-loading {
    opacity: .6;
    pointer-events: none;
}

.pi-storemap__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pi-storemap__controls .pi-storemap__geoloc {
    white-space: nowrap;
}

.pi-storemap__radius-label {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.pi-storemap__radius-select {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* "Stores in your area" section */
.pi-storemap__nearby {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #eef6fb;
    border: 1px solid #cfe6f5;
    border-radius: 6px;
}

.pi-storemap__nearby-title {
    font-size: 14px;
    margin: 0 0 8px;
}

.pi-storemap__nearby-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 220px;
    overflow-y: auto;
}

.pi-storemap__nearby-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px solid #dcebf5;
    cursor: pointer;
}

.pi-storemap__nearby-item:last-child {
    border-bottom: none;
}

.pi-storemap__nearby-item:hover {
    background: #e0f0fa;
}

.pi-storemap__nearby-name {
    font-weight: 600;
}

.pi-storemap__nearby-meta {
    font-size: 12px;
    color: #567;
    white-space: nowrap;
}

.pi-storemap__nearby-dist {
    font-weight: 600;
    color: #2b6cb0;
}

.pi-storemap__nearby-empty {
    margin: 0;
    font-size: 13px;
    color: #666;
}

/* Built-in store pin (Leaflet divIcon); scales from the bottom on hover. */
.pi-storemap-marker {
    background: none;
    border: 0;
}

.pi-storemap-marker__pin {
    display: block;
    width: 25px;
    height: 41px;
    transform-origin: center bottom;
    transition: transform .12s ease;
}

.pi-storemap-marker__pin svg,
.pi-storemap-marker__pin img {
    display: block;
    width: 100%;
    height: 100%;
}

.pi-storemap-marker.is-active .pi-storemap-marker__pin {
    /* Grow to 48px tall (41px base) keeping the tip anchored. */
    transform: scale(1.171);
}

/* Open/closed badges */
.pi-storemap__badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

.pi-storemap__badge--open {
    background: #e3f6ea;
    color: #1e7e46;
}

.pi-storemap__badge--closed {
    background: #fbe7e7;
    color: #b02a2a;
}

.pi-storemap__open-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
}

/* Colour legend */
.pi-storemap__legend {
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: #f7f8fa;
    border: 1px solid #e2e6ea;
    border-radius: 6px;
}

.pi-storemap__legend-title {
    margin: 0 0 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #666;
}

.pi-storemap__legend-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pi-storemap__legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
    font-size: 14px;
}

.pi-storemap__legend-swatch {
    display: inline-block;
    width: 16px;
    height: 26px;
    flex: 0 0 16px;
}

.pi-storemap__legend-swatch svg {
    display: block;
    width: 100%;
    height: 100%;
}

.pi-storemap__legend-label {
    flex: 1;
}

.pi-storemap__legend-count {
    color: #888;
    font-size: 13px;
}

/* "You are here" location pin (Leaflet divIcon) */
.pi-storemap-you__pin {
    display: block;
    width: 18px;
    height: 18px;
    margin: 0 auto;
    background: #2b6cb0;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

.pi-storemap__count {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.pi-storemap__list {
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.pi-storemap__group.is-hidden,
.pi-storemap__item.is-hidden {
    display: none;
}

.pi-storemap__group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    margin: 12px 0 6px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

.pi-storemap__group-title.is-collapsible {
    cursor: pointer;
    user-select: none;
}

.pi-storemap__group-count {
    color: #999;
    font-weight: normal;
}

.pi-storemap__group-toggle {
    margin-left: auto;
    color: #999;
    transition: transform .15s ease;
}

.pi-storemap__group-toggle::before {
    content: '\25B8'; /* ▸ */
}

.pi-storemap__group.is-open .pi-storemap__group-toggle {
    transform: rotate(90deg);
}

/* Accordion: store lists (and the "coming soon" note of empty regions) are
   collapsed until their region header is opened. A text search reveals every
   matching store regardless of the accordion state. */
.pi-storemap__group .pi-storemap__items,
.pi-storemap__group .pi-storemap__coming-soon {
    display: none;
}

.pi-storemap__group.is-open .pi-storemap__items,
.pi-storemap__list.is-searching .pi-storemap__group .pi-storemap__items {
    display: flex;
}

.pi-storemap__group.is-open .pi-storemap__coming-soon {
    display: block;
}

.pi-storemap__coming-soon {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

.pi-storemap__items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* "Show in-view first" mode: push out-of-view stores below, slightly dimmed. */
.pi-storemap__item.is-below {
    order: 100;
    opacity: .7;
}

.pi-storemap__item {
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.pi-storemap__item:hover {
    background: #f7f7f7;
    border-color: #ddd;
}

.pi-storemap__item-name {
    font-weight: 600;
}

.pi-storemap__item-address {
    font-size: 13px;
    color: #666;
}

.pi-storemap__item-hours-toggle {
    background: none;
    border: none;
    padding: 4px 0;
    color: #2fb5d2;
    cursor: pointer;
    font-size: 13px;
}

.pi-storemap__item-hours {
    display: none;
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
    font-size: 13px;
    color: #555;
}

.pi-storemap__item.is-open .pi-storemap__item-hours {
    display: block;
}

.pi-storemap__item-hours-day {
    display: inline-block;
    min-width: 90px;
    font-weight: 600;
}

.pi-storemap__item-actions {
    margin-top: 6px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.pi-storemap__cta {
    margin-top: 12px;
    padding: 12px;
    background: #f2f2f2;
    border-radius: 4px;
}

/* Popup / modal */
.pi-storemap-popup__name {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.pi-storemap-popup__addr,
.pi-storemap-popup__hours,
.pi-storemap-popup__categories,
.pi-storemap-popup__notes {
    font-size: 13px;
    margin-bottom: 4px;
}

.pi-storemap-popup__hours-row {
    display: block;
}

.pi-storemap-popup__hours-day {
    display: inline-block;
    min-width: 90px;
    font-weight: 600;
}

.pi-storemap-popup__default {
    margin-top: 8px;
}

.pi-storemap-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.pi-storemap-modal__box {
    background: #fff;
    padding: 24px;
    border-radius: 6px;
    max-width: 420px;
    width: 90%;
    position: relative;
}

.pi-storemap-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 767px) {
    .pi-storemap__sidebar {
        max-width: none;
        max-height: 320px;
    }
}

/* --- Click & collect checkout picker --- */
.pi-storemap-pickup {
    margin: 10px 0;
}

.pi-storemap-pickup__instructions {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.pi-storemap-pickup__selected {
    padding: 8px 10px;
    background: #eef8ec;
    border: 1px solid #bfe3b6;
    border-radius: 4px;
    margin-bottom: 8px;
}

.pi-storemap-pickup__search {
    width: 100%;
    margin-bottom: 8px;
}

.pi-storemap-pickup__body {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pi-storemap-pickup__list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 240px;
    max-height: 320px;
    overflow-y: auto;
}

.pi-storemap-pickup__map {
    flex: 1 1 320px;
    min-height: 320px;
    border-radius: 4px;
    z-index: 0;
}

.pi-storemap-pickup__item {
    padding: 8px 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pi-storemap-pickup__item.is-selected {
    border-color: #bfe3b6;
    background: #f4fbf2;
}

.pi-storemap-pickup__item-name {
    font-weight: 600;
}

.pi-storemap-pickup__item-addr {
    font-size: 13px;
    color: #666;
}

.pi-storemap-pickup__item-btn {
    align-self: flex-start;
    margin-top: 4px;
}

.pi-storemap-pickup-summary {
    margin-top: 16px;
}

.pi-storemap-pickup-summary__title {
    margin-top: 0;
}
