/* Shared, instance-independent presentation for state and city Near Me pages. */
:is(main, #main) .container:has([data-storefront-component^="near-me-"][data-storefront-component$="state"], [data-storefront-component^="near-me-"][data-storefront-component$="city"]) {
    width: 100%;
    max-width: none;
    padding-inline: 0;
}

:is(main, #main) .main-content-wrap:has([data-storefront-component="near-me-state"], [data-storefront-component="near-me-city"]),
:is(main, #main) .main-content:has([data-storefront-component="near-me-state"], [data-storefront-component="near-me-city"]) {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

:is(main, #main) .main-content:has([data-storefront-component="near-me-state"], [data-storefront-component="near-me-city"]) {
    flex: 0 0 100%;
}

[data-storefront-component="near-me-state"],
[data-storefront-component="near-me-city"] {
    position: relative;
    top: -20px;
    width: 100%;
    color: #232323;
    font-family: Montserrat, Arial, sans-serif;
    font-size: 13px;
    line-height: 22px;
}

[data-storefront-component="near-me-state"] *,
[data-storefront-component="near-me-city"] *,
[data-storefront-component="near-me-state"] *::before,
[data-storefront-component="near-me-city"] *::before,
[data-storefront-component="near-me-state"] *::after,
[data-storefront-component="near-me-city"] *::after {
    box-sizing: border-box;
}

.near-me-detail__hero {
    width: 100%;
    padding: 50px 0;
}

.near-me-detail__hero-container,
.near-me-detail__quick-links,
.near-me-detail__intro,
.near-me-detail__content-block,
.near-me-detail__cities,
.near-me-detail__faq {
    width: min(1170px, calc(100% - 30px));
    margin-inline: auto;
}

.near-me-detail__hero-container {
    width: min(1200px, calc(100% - 30px));
}

.near-me-detail__title {
    display: block;
    width: 100%;
    margin: 26.8px 0 15px;
    color: #232323;
    font-family: Jost, sans-serif;
    font-size: 40px;
    font-weight: 600;
    line-height: 48px;
    letter-spacing: 2px;
    text-align: center;
}

.near-me-detail__products {
    position: relative;
    width: 100%;
    margin: 40px 0;
    overflow: hidden;
}

.near-me-detail__products .products {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 20px;
    list-style: none;
    transform: translateX(calc(var(--near-me-carousel-offset, 0) * ((100% + 20px) / -4)));
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

/* Without the controller every product remains reachable by native scrolling. */
.near-me-detail__products:not([data-near-me-carousel-ready]) {
    overflow-x: auto;
}

.near-me-detail__carousel-button[hidden] {
    display: none;
}

.near-me-detail__products .product-col {
    display: block;
    flex: 0 0 calc((100% - 60px) / 4);
    width: calc((100% - 60px) / 4);
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.near-me-detail__products .product-inner,
.near-me-detail__products .product-image {
    width: 100%;
    margin: 0;
    padding: 0;
}

.near-me-detail__products .product-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
}

.near-me-detail__products .product-image > a {
    display: block;
    width: 100%;
    height: 100%;
}

.near-me-detail__products .product-image img:not(.hover-image) {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.near-me-detail__products :is(.hover-image, .stock, .price, .add-links-wrap) {
    display: none !important;
}

.near-me-detail__products .storefront-product-card .product-content {
    display: block;
    width: 100%;
    padding: 0;
    text-align: center;
}

.near-me-detail__products .storefront-product-card .product-loop-title {
    display: block;
    width: 100%;
    max-height: 44.8px !important;
    margin: 15px 0 16px !important;
    overflow: hidden;
    color: #000;
    font-family: Jost, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .05em;
    text-align: center;
    text-decoration: none;
    text-transform: none;
}

.near-me-detail__products .storefront-product-card .product-loop-title .woocommerce-loop-product__title {
    height: auto !important;
    min-height: 0;
    max-height: none !important;
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}

.near-me-detail__carousel-button {
    position: absolute;
    top: calc(50% - 30px);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 1px 6px;
    color: #000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    box-shadow: none;
    transform: translateY(-50%);
    transition: all .3s ease;
    opacity: 1;
    cursor: pointer;
}

.near-me-detail__carousel-button--previous { left: 2px; }
.near-me-detail__carousel-button--next { right: 2px; }

.near-me-detail__carousel-button svg {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
}

.near-me-detail__quick-links {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
}

.near-me-detail__quick-title {
    margin: 20px 0;
    color: #222;
    font-family: Jost, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 22px;
    letter-spacing: .05em;
}

.near-me-detail__quick-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.near-me-detail__quick-list li {
    margin: 0 0 5px;
    color: #888;
    font-size: 13px;
    line-height: 22px;
}

.near-me-detail__quick-number {
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    margin-right: 5px;
}

.near-me-detail__quick-list a {
    color: #888;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    text-decoration: none;
    transition: all .3s ease;
}

.near-me-detail__quick-list a:hover {
    text-decoration: underline;
}

.near-me-detail__intro {
    margin-top: 0;
    margin-bottom: 30px;
    padding: 0 20px;
    font-size: 16px;
    line-height: 22px;
}

.near-me-detail__content-block {
    display: flex;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0;
    gap: 0;
}

/* Gutenberg declares normal!important; this component owns its column alignment. */
.wp-block-columns.near-me-detail__content-block {
    align-items: center !important;
}

.near-me-detail__content-text {
    display: block;
    flex: 1 1 60%;
    min-width: 0;
    padding: 20px;
    color: #444;
}

.near-me-detail__content-text a {
    color: #0066cc;
    text-decoration: underline;
    transition: all .3s ease;
}

.near-me-detail__content-text a:hover {
    text-decoration: none;
}

.near-me-detail__content-image {
    flex: 0 0 40%;
    min-width: 0;
    padding: 20px !important;
}

.near-me-detail__content-image figure,
.near-me-detail__content-image img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    object-fit: cover;
}

.near-me-detail__content-block--text .near-me-detail__content-text {
    padding: 20px;
}

.near-me-detail__content-block :is(h2, h3) {
    margin: 24px 0 10px;
    color: #222;
    font-family: Jost, sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 22px;
    letter-spacing: 1.2px;
}

.near-me-detail__content-block--lead :is(h2, h3) {
    margin-top: 19.92px;
    line-height: 28px;
}

.near-me-detail__content-block p {
    margin: 16px 0;
    font-size: 16px;
    line-height: 22px;
}

.near-me-map {
    width: 100%;
    margin: 30px 0 0;
    padding: 30px 0;
}

.nearme-map__container-full {
    width: 100%;
    padding: 0 15px;
}

.nearme-map__wrapper {
    position: relative;
    width: 100%;
}

.nearme-map__container-element {
    display: block;
    width: 100%;
    height: 500px;
    z-index: 1;
}

.nearme-map__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    transform: translate(-50%, -50%);
    text-align: center;
}

.nearme-map__loading-spinner {
    display: block;
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    border: 5px solid rgb(0 0 0 / 10%);
    border-left-color: #4285f4;
    border-radius: 50%;
    animation: near-me-map-spin 1s ease infinite;
}

.nearme-map__loading[hidden] { display: none; }

@keyframes near-me-map-spin {
    to { transform: rotate(360deg); }
}

.leaflet-container {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-x pan-y;
}

.leaflet-touch :is(.leaflet-control-attribution, .leaflet-control-layers, .leaflet-bar) {
    visibility: visible !important;
}

.near-me-detail__faq {
    width: 100%;
    padding: 30px 0;
}

.near-me-detail__faq > h2 {
    width: min(1170px, calc(100% - 30px));
    margin: 0 auto 20px;
    color: #000;
    font-family: Jost, sans-serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 28px;
    letter-spacing: 1.15px;
    text-align: center;
}

.near-me-detail__faq .rank-math-block {
    width: min(1170px, calc(100% - 30px));
    margin-inline: auto;
}

.near-me-detail__faq .rank-math-list-item {
    min-height: 48px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.near-me-detail__faq-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 22px;
    padding: 0;
    color: #232323;
    background: transparent;
    border: 0;
    font: 700 18px/22px Montserrat, Arial, sans-serif;
    text-align: left;
    cursor: pointer;
    list-style: none;
}

.near-me-detail__faq-button::-webkit-details-marker { display: none; }

.near-me-detail__faq-icon {
    flex: 0 0 24px;
    font-size: 24px;
    font-weight: 400;
    text-align: center;
}

.near-me-detail__faq-answer {
    max-height: none;
    margin: 5px 0 0;
    padding: 0 10px;
    overflow: hidden;
    font-size: 16px;
    line-height: 22px;
    transition: max-height .4s ease;
}

.near-me-detail__faq-answer p {
    margin: 16px 0;
    padding: 0;
}

.near-me-detail__faq details[data-near-me-faq-ready] .near-me-detail__faq-answer {
    max-height: 0;
}

.near-me-detail__faq details[open]:not([data-near-me-faq-ready]) .near-me-detail__faq-icon {
    font-size: 0;
}

.near-me-detail__faq details[open]:not([data-near-me-faq-ready]) .near-me-detail__faq-icon::after {
    content: '−';
    font-size: 24px;
}

.near-me-detail__cities {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0;
    margin-bottom: 0;
    padding: 40px 0;
    gap: 10px;
    list-style: none;
}

.near-me-detail__cities > li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.near-me-detail__cities > li > a {
    display: block;
    min-height: 44px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    text-decoration: none;
}

.near-me-detail__city-card {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 10px;
    background: #f2f2f2;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: all .3s ease;
}

.near-me-detail__city-name {
    min-width: 0;
    color: #333;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .3s ease;
}

.near-me-detail__cities > li > a:hover .near-me-detail__city-card {
    background: #e5e5e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
    z-index: 1;
}

.near-me-detail__cities > li > a:hover .near-me-detail__city-name {
    color: #000;
}

.near-me-detail__city-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
}

.near-me-detail__city-icon img {
    display: block;
    width: 24px;
    height: 24px;
}

@media (min-width: 768px) and (max-width: 1199px) {
    .near-me-detail__hero-container {
        width: 100%;
        max-width: none;
        margin-inline: 0;
    }

    .near-me-detail__products {
        width: 100%;
        margin: 40px 0;
        padding: 0;
    }

    .near-me-detail__products .products {
        padding-inline: 30px;
        gap: 20px;
        transform: translateX(calc(var(--near-me-carousel-offset, 0) * ((100% + 20px) / -2)));
    }

    .near-me-detail__products .product-col {
        flex-basis: calc((100% - 20px) / 2);
        width: calc((100% - 20px) / 2);
    }
}

@media (max-width: 767px) {
    .near-me-detail__products .products {
        transition: transform .2s ease-out;
    }

    .near-me-detail__carousel-button {
        width: 30px;
        height: 30px;
    }

    .near-me-detail__carousel-button--previous { left: 0; }
    .near-me-detail__carousel-button--next { right: 0; }

    .near-me-detail__hero { padding: 30px 0; }
    .near-me-detail__hero-container { width: 100%; }
    .near-me-detail__title { margin: 16.75px 0 15px; font-size: 25px; line-height: 30px; letter-spacing: 1.25px; }
    .near-me-detail__products { width: 100%; margin: 20px 0; padding: 0 20px; }
    .near-me-detail__products .products { gap: 10px; }
    .near-me-detail__products .products { transform: translateX(calc(var(--near-me-carousel-offset, 0) * ((100% + 10px) / -2))); }
    .near-me-detail__products .product-col { flex-basis: calc((100% - 10px) / 2); width: calc((100% - 10px) / 2); }
    .near-me-detail__carousel-button { top: calc(50% - 30px); }
    .near-me-detail__content-image img { height: auto; aspect-ratio: 1; }
    .near-me-detail__content-text,
    .near-me-detail__content-block--text .near-me-detail__content-text { padding: 20px; }
    .near-me-detail__content-block :is(h2, h3) { font-size: 24px; }
    .near-me-map { padding-top: 15px; padding-bottom: 15px; }
    .nearme-map__container-element { height: 350px; }
    .leaflet-container { touch-action: manipulation; }
    .leaflet-touch .leaflet-control-zoom a { width: 34px; height: 34px; line-height: 34px; }
    .near-me-detail__faq { padding-top: 15px; padding-bottom: 15px; }
}

@media (max-width: 768px) {
    .near-me-detail__content-block {
        flex-direction: column !important;
        flex-wrap: nowrap;
    }
    .near-me-detail__content-image {
        order: -1;
        flex: 1 1 100%;
        width: 100%;
        height: auto;
    }
    .near-me-detail__content-text {
        flex: 1 1 100%;
        width: 100%;
    }
}

@media (max-width: 551px) {
    .near-me-detail__quick-links,
    .near-me-detail__intro,
    .near-me-detail__content-block,
    .near-me-detail__cities { width: calc(100% - 20px); }
}

@media (max-width: 991px) {
    .near-me-detail__cities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .near-me-map { padding-top: 20px; padding-bottom: 20px; }
    .near-me-detail__faq { padding-top: 20px; padding-bottom: 20px; }
}

@media (max-width: 576px) {
    .near-me-detail__cities { grid-template-columns: 1fr; }
}
