/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

@layer base {

.s4w-breadcrumbs {
	width: 100%;
	border-top: 1px solid var(--stroke-soft-200);
	border-bottom: 1px solid var(--stroke-soft-200);
	background-color: var(--bg-white-0);
}

.s4w-breadcrumbs__container {
	display: flex !important;
	flex-direction: row !important;
	align-items: center;
	height: 36px;
	gap: 0 !important;
}

.s4w-breadcrumbs__item {
	display: flex;
	align-items: stretch;
	height: 100%;
}

.s4w-breadcrumbs__link,
.s4w-breadcrumbs__current {
	display: flex;
	align-items: center;
	padding: 10px;
	font-family: var(--font-secondary);
	font-size: var(--paragraph-xsmall);
	font-weight: var(--weight-regular);
	line-height: 16px;
	color: var(--text-soft-400);
	border-right: 1px solid var(--stroke-soft-200);
	transition: color var(--transition-fast);
}

.s4w-breadcrumbs__item:first-child .s4w-breadcrumbs__link,
.s4w-breadcrumbs__item:first-child .s4w-breadcrumbs__current {
	border-left: 1px solid var(--stroke-soft-200);
}

.s4w-breadcrumbs__link:hover {
	color: var(--text-main-900);
}

.s4w-breadcrumbs__current {
	color: var(--text-main-900);
	font-weight: var(--weight-regular);
}

} /* end @layer base */

/* ==========================================================================
   Store Locator Page
   ========================================================================== */

/* Page container */
.store-locator-page {
    display: flex;
    flex-direction: column;
    margin-bottom: 0 !important;
}

.store-locator-page article {
    margin-bottom: 0 !important;
}

/* Body: 4/12 lista + 8/12 mappa affiancati */
.store-locator__body {
    display: grid;
    grid-template-columns: 4fr 8fr;
    align-items: stretch;
    min-height: calc(100vh - 80px);
    max-height: 80vh;
}

/* Sidebar + map side by side (legacy) */
.store-locator-page article {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: calc(100vh - 80px);
}

/* ==========================================================================
   Sidebar / Panel
   ========================================================================== */

.store-locator__panel,
.store-locator__sidebar {
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 80vh;
    position: sticky;
    top: 80px;
    overflow: hidden;
    border-right: 1px solid var(--stroke-soft-200);
}

.store-locator__header {
    padding: 24px 24px 0;
    flex-shrink: 0;
}

.store-locator__title {
    color: var(--text-main-900);
    font-family: var(--font-primary);
    font-size: 36px;
    font-style: normal;
    font-weight: var(--weight-regular);
    line-height: 140%;
    text-transform: uppercase;
    margin-top: 55px;
    margin-bottom: 12px;
}

.store-locator__list {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding-top: 20px;
}

/* ==========================================================================
   Map
   ========================================================================== */

.store-locator__map {
    flex: 1;
    height: 80vh;
    max-height: 80vh;
    position: sticky;
    top: 80px;
    overflow: hidden;
}

#store-map {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Search bar (Figma node 1888:40266)
   ========================================================================== */

.store-locator__search-row {
    margin-bottom: 0;
}

.store-locator__search-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--stroke-sub-300);
    padding: 8px 12px;
    height: 44px;
    box-sizing: border-box;
    background: var(--bg-white-0);
}

.store-locator__search-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: var(--text-soft-400);
}

.store-locator__search-input {
    flex: 1 0 0;
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-primary);
    font-weight: var(--weight-book);
    font-size: var(--paragraph-small);
    line-height: 20px;
    letter-spacing: 0.56px;
    text-transform: uppercase;
    color: var(--text-main-900);
    min-width: 0;
    height: 20px;
}

.store-locator__search-input::placeholder {
    color: var(--text-soft-400);
}

.store-locator__geolocate {
    appearance: none;
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    line-height: 1;
    color: var(--text-soft-400);
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.store-locator__geolocate svg {
    display: block;
    flex-shrink: 0;
}

.store-locator__geolocate:hover {
    color: var(--text-main-900);
}

.store-locator__geolocate.is-disabled {
    color: var(--text-soft-400);
    opacity: 0.4;
    cursor: not-allowed;
}

.store-locator__geolocate.is-loading {
    pointer-events: none;
}

.store-locator__geolocate.is-loading svg {
    animation: geo-spin 0.8s linear infinite;
}

@keyframes geo-spin {
    from { transform: rotate( 0deg ); }
    to   { transform: rotate( 360deg ); }
}

/* Override Google Places Autocomplete dropdown */
.pac-container {
    font-family: var(--font-primary);
    font-size: 13px;
    border: 1px solid var(--stroke-sub-300);
    box-shadow: none;
    border-radius: 0;
}

.pac-item {
    padding: 8px 16px;
    cursor: pointer;
}

.pac-item:hover {
    background: var(--bg-weak-100);
}

.pac-item-query {
    font-size: 13px;
    color: var(--text-main-900);
}

/* ==========================================================================
   Filters
   ========================================================================== */

.store-locator__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 25px;
    padding-bottom: 4px;
}

.store-filter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: 1px solid var(--stroke-soft-200);
    border-radius: 100px;
    background: var(--bg-white-0);
    color: var(--text-main-900);
    cursor: pointer;
    transition: var(--transition-fast);
    /* button reset */
    appearance: none;
    margin: 0;
    font-family: var(--font-primary);
    font-size: var(--paragraph-small);
    font-style: normal;
    font-weight: var(--weight-regular);
    line-height: 110%;
    white-space: nowrap;
}

.store-filter-btn:hover {
    border-color: var(--stroke-sub-300);
    background: var(--bg-weak-100);
}

.store-filter-btn.is-active {
    background: var(--bg-strong-900);
    color: var(--text-white-0);
    border-color: var(--bg-strong-900);
}

.store-filter-btn img {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.store-filter-btn.is-active img {
    filter: invert(1);
}

/* ==========================================================================
   Store list
   ========================================================================== */

.store-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.store-item {
    padding: 20px 0 25px;
    margin: 0 24px;
    border-bottom: 1px solid var(--stroke-soft-200);
    position: relative;
    transition: var(--transition-fast);
}

.store-item[hidden] {
    display: none;
}

.store-item.is-highlighted {
    background: var(--bg-weak-100);
}

.store-item__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.store-item__info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    min-width: 0;
}

.store-item__name {
    font-family: var(--font-primary);
    font-weight: var(--weight-regular);
    font-size: var(--label-large);
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--text-main-900);
    margin: 0;
}

.store-item__actions {
    display: flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    flex-shrink: 0;
}

.store-item__actions-separator {
    width: 1px;
    height: 16px;
    background: var(--stroke-sub-300);
    flex-shrink: 0;
}

.store-item__action-btn {
    /* button reset */
    appearance: none;
    background: none;
    border: none;
    padding: 4px;
    margin: 0;
    line-height: 1;
    color: var(--text-sub-500);
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-item__action-btn:hover {
    color: var(--text-main-900);
}

.store-list .store-item .store-item__address {
    font-family: var(--font-secondary) !important;
    font-weight: var(--weight-regular) !important;
    font-size: var(--paragraph-small) !important;
    line-height: 1.6 !important;
    color: var(--text-soft-400) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
}

.store-item__distance {
    font-family: var(--font-secondary);
    font-weight: var(--weight-regular);
    font-size: var(--paragraph-small);
    line-height: 1.6;
    color: var(--text-soft-400);
    margin: 0 0 12px;
}

.store-item__copy-feedback {
    position: absolute;
    top: 8px;
    right: 50px;
    background: var(--bg-strong-900);
    color: var(--text-white-0);
    padding: 4px 8px;
    opacity: 0;
    transition: var(--transition-fast);
    pointer-events: none;
}

.store-item__copy-feedback.is-visible {
    opacity: 1;
}

.store-item__directions {
    margin-top: 0;
    margin-bottom: 0;
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-primary);
    font-size: var(--paragraph-small);
    font-weight: var(--weight-medium);
    line-height: 20px;
    letter-spacing: 0.56px;
    text-transform: uppercase;
    color: var(--text-main-900);
    text-decoration: none;
    border-bottom: 1px solid var(--text-main-900);
    padding-bottom: 0;
}

.store-item__directions:hover {
    opacity: 0.7;
}

/* ==========================================================================
   Tab nav (mobile only — hidden on desktop)
   ========================================================================== */

.store-locator__tab-nav {
    display: none;
}

.store-locator__tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: var(--bg-white-0);
    cursor: pointer;
    color: var(--text-sub-500);
    transition: var(--transition-fast);
    appearance: none;
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    font-weight: var(--weight-book);
    font-size: var(--paragraph-small);
    line-height: 20px;
    letter-spacing: 0.56px;
    text-transform: uppercase;
}

.store-locator__tab-btn + .store-locator__tab-btn {
    border-left: 1px solid var(--stroke-soft-200);
}

.store-locator__tab-btn.is-active {
    background: var(--bg-weak-100);
    color: var(--text-main-900);
}

.store-locator__tab-btn svg {
    flex-shrink: 0;
}

/* ==========================================================================
   Map popup (InfoWindow)
   ========================================================================== */

/* Reset contenitore nativo Google Maps InfoWindow */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-width: none !important;
}

.gm-style .gm-style-iw-d {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
    padding: 0 !important;
}

/* Nascondi freccia e X nativa di Google — NON il wrapper chr che contiene il contenuto */
.gm-style .gm-style-iw-tc,
.gm-style .gm-style-iw-t::after {
    display: none !important;
}

.gm-style-iw-chr {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    z-index: 1 !important;
}

.gm-style-iw-chr > button {
    display: none !important;
}

/* Rimuovi bordo/outline nativo */
.gm-style .gm-style-iw-c,
.gm-style .gm-style-iw,
.gm-style .gm-style-iw-c:focus,
.gm-style .gm-style-iw:focus,
.gm-style-iw-c,
.gm-style-iw {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.store-map-popup {
    max-width: 300px;
    width: 300px;
    padding: 16px;
    position: relative;
    background: var(--bg-white-0);
    box-shadow: 0px 14px 24px 0px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.store-map-popup__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.store-map-popup__name {
    font-family: var(--font-primary);
    font-size: var(--label-large);
    font-style: normal;
    font-weight: var(--weight-regular);
    line-height: 140%;
    text-transform: uppercase;
    color: #231F20;
    margin: 0;
    flex-grow: 1;
}

.store-map-popup__close {
    appearance: none;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--text-main-900);
}

.store-map-popup__address {
    font-family: var(--font-secondary);
    font-weight: var(--weight-regular);
    font-size: var(--paragraph-small);
    line-height: 1.6;
    color: var(--text-soft-400);
    text-transform: none;
    margin: 0 0 8px;
    padding-right: 28px;
}

.store-map-popup__distance {
    font-family: var(--font-secondary);
    font-weight: var(--weight-regular);
    font-size: var(--paragraph-small);
    line-height: 1.6;
    color: var(--text-soft-400);
    margin: 0 0 12px;
}

.store-map-popup__directions {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-primary);
    font-size: var(--paragraph-small);
    font-weight: var(--weight-medium);
    font-style: normal;
    line-height: 20px;
    letter-spacing: 0.56px;
    text-transform: uppercase;
    color: var(--text-main-900);
    text-decoration: none;
    border-bottom: 1px solid var(--text-main-900);
}

.store-map-popup__directions:hover {
    opacity: 0.7;
}

/* ==========================================================================
   Mobile (max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    /* Resetta grid desktop → colonna */
    .store-locator__body {
        display: flex;
        flex-direction: column;
        max-height: unset;
        min-height: unset;
        padding-left: 0;
    }

    .store-locator-page article {
        flex-direction: column;
        min-height: unset;
    }

    /* Pannello: layout colonna, altezza in base al contenuto */
    .store-locator__panel {
        width: 100%;
        height: auto;
        max-height: none;
        position: static;
        border-right: none;
        top: auto;
        overflow: visible;
    }

    /* Header sempre visibile: non si restringe */
    .store-locator__header {
        flex-shrink: 0;
        padding: 64px 16px 0 12px;
    }

    .store-locator__title {
        margin-top: 0;
        margin-bottom: 12px;
    }

    .store-locator__search-bar {
        margin-bottom: 24px;
    }

    .store-locator__filters {
        padding-top: 0;
        padding-bottom: 28px;
    }

    /* Mappa occupa tutto il viewport meno navbar e tabnav */
    .store-locator__map {
        position: static;
        height: 502.5px;
        max-height: 502.5px;
        width: 100%;
        top: auto;
        flex: unset;
    }

    .store-locator__list {
        overflow-y: auto;
        flex: none;
        min-height: unset;
        max-height: 2000px;
        padding-top: 0;
    }

    /* Tab nav */
    .store-locator__tab-nav {
        display: flex;
        position: sticky;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 61px;
        background: var(--bg-white-0);
        border-top: 1px solid var(--stroke-soft-200);
        z-index: 100;
    }

    /* List view: pannello visibile (header + lista), mappa nascosta */
    .store-locator-page.is-list-view .store-locator__panel {
        display: flex;
    }

    .store-locator-page.is-list-view .store-locator__map {
        display: none;
    }

    /* Map view: header visibile, lista nascosta, mappa a dimensione fissa */
    .store-locator-page.is-map-view .store-locator__body {
        flex-direction: column;
        height: auto;
    }

    .store-locator-page.is-map-view .store-locator__panel {
        display: flex;
        height: auto;
        max-height: none;
        flex-shrink: 0;
    }

    .store-locator-page.is-map-view .store-locator__list {
        display: none;
    }

    .store-locator-page.is-map-view .store-locator__map {
        display: block;
        height: 502.5px;
        max-height: 502.5px;
        flex: unset;
    }

    .store-locator__list {
        padding-bottom: 0;
    }

    .store-list {
        padding-left: 12px;
        padding-right: 12px;
    }

    .store-item {
        padding: 20px 0 25px;
        margin: 0;
    }

    .store-item.is-last-visible {
        border-bottom: none;
    }

    /* Controlli mappa più piccoli su mobile */
    #store-map .gm-style-mtc button,
    #store-map .gm-style-mtc label {
        font-size: 11px !important;
        height: 24px !important;
        padding: 0 8px !important;
        line-height: 24px !important;
    }
}

/* ==========================================================================
   Tablet (769px – 1024px)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .store-locator__sidebar {
        width: 380px;
        min-width: 300px;
    }
}

/* ─── Spinner ─────────────────────────────────────────────────────────────── */
.store-locator__spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px 0;
}

.store-locator__spinner[aria-hidden="true"] {
	display: none;
}

.store-locator__spinner-icon {
	display: block;
	width: 32px;
	height: 32px;
	border: 2px solid var(--bg-soft-200);
	border-top-color: var(--text-main-900);
	border-radius: 50%;
	animation: s4w-spin 0.7s linear infinite;
}

@keyframes s4w-spin {
	to { transform: rotate(360deg); }
}
