/* Local product/gallery details and search results. Source sections stay unchanged. */
.storefront-dialog,
.storefront-dialog *,
#product-results,
#product-results * {
    box-sizing: border-box;
}

.storefront-dialog {
    width: min(920px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: auto;
    overscroll-behavior: contain;
    background: #fff;
    color: #000;
    font-family: Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 12px 40px rgb(0 0 0 / 25%);
}

.storefront-dialog:not([open]) {
    display: none;
}

.storefront-dialog::backdrop {
    background: rgb(0 0 0 / 65%);
}

.storefront-dialog .dialog-shell {
    position: relative;
    min-width: 0;
    padding: 64px 30px 30px;
}

.storefront-dialog .dialog-close {
    position: absolute;
    z-index: 1;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 12px;
    border: 1px solid #004cca;
    border-radius: 10px;
    background: #fff;
    color: #004cca;
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.product-dialog .dialog-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 30px;
}

.storefront-dialog .dialog-product-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    max-height: 60dvh;
    object-fit: contain;
}

.storefront-dialog .dialog-product-copy {
    min-width: 0;
    overflow-wrap: anywhere;
}

.storefront-dialog .dialog-product-copy h2,
.storefront-dialog .dialog-product-copy h3 {
    margin: 0 0 16px;
    color: #000;
    font-family: "Bebas Neue", Roboto, Arial, sans-serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.15;
}

.storefront-dialog .dialog-product-copy p {
    margin: 0 0 16px;
}

.storefront-dialog .dialog-category {
    color: #555;
    font-size: 14px;
}

.storefront-dialog .dialog-price {
    font-size: 16px;
    font-weight: 500;
}

.storefront-dialog .dialog-request-link,
.storefront-dialog .dialog-gallery-controls button,
.storefront-dialog .dialog-gallery-prev,
.storefront-dialog .dialog-gallery-next,
#product-results [data-clear-search] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid #004cca;
    border-radius: 10px;
    background: #fff;
    color: #004cca;
    font-family: Roboto, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.storefront-dialog .dialog-request-link:hover,
.storefront-dialog .dialog-close:hover,
.storefront-dialog .dialog-gallery-controls button:not(:disabled):hover,
.storefront-dialog .dialog-gallery-prev:not(:disabled):hover,
.storefront-dialog .dialog-gallery-next:not(:disabled):hover,
#product-results [data-clear-search]:hover {
    background: #004cca;
    color: #fff;
    text-decoration: none;
}

.storefront-dialog .dialog-request-link {
    max-width: 100%;
    margin-top: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.gallery-dialog {
    width: min(1040px, calc(100vw - 32px));
}

.storefront-dialog .dialog-gallery-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 65vh;
    max-height: 65dvh;
    object-fit: contain;
}

.storefront-dialog .dialog-gallery-caption {
    margin: 18px 0 0;
    text-align: center;
    overflow-wrap: anywhere;
}

.storefront-dialog .dialog-gallery-caption:empty {
    display: none;
}

.storefront-dialog .dialog-gallery-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.storefront-dialog .dialog-gallery-controls button:disabled {
    opacity: 0.5;
    cursor: default;
}

#product-results {
    padding: 30px 0 60px;
    font-family: Roboto, Arial, sans-serif;
}

#product-results[hidden] {
    display: none;
}

#product-results .search-results-status {
    margin: 0 0 16px;
    color: #000;
    font-size: 15px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

#product-results [data-clear-search] {
    margin-bottom: 24px;
}

#product-results .search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 30px;
}

#product-results .search-result-card {
    display: block;
    min-width: 0;
    color: #000;
    text-decoration: none;
}

#product-results .search-result-card img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}

#product-results .search-result-copy {
    min-width: 0;
    padding-top: 16px;
    overflow-wrap: anywhere;
}

#product-results .search-result-copy h3 {
    margin: 0 0 12px;
    color: #000;
    font-family: Roboto, Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}

#product-results .search-result-copy p {
    margin: 0 0 12px;
    color: #555;
    font-size: 14px;
    line-height: 1.5;
}

#product-results .search-result-details {
    font-size: 14px;
    font-weight: 400;
}

#product-results .search-result-card:hover .search-result-details {
    color: #004cca;
    text-decoration: underline;
}

.storefront-dialog :is(a, button):focus-visible,
#product-results :is(a, button):focus-visible {
    outline: 3px solid #004cca;
    outline-offset: 3px;
}

@media screen and (max-width: 991.5px) {
    #product-results .search-results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

@media screen and (max-width: 767.5px) {
    .storefront-dialog .dialog-shell {
        padding: 64px 20px 24px;
    }

    .product-dialog .dialog-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .storefront-dialog .dialog-product-image {
        max-height: 40vh;
        max-height: 40dvh;
    }

    .storefront-dialog .dialog-product-copy h2,
    .storefront-dialog .dialog-product-copy h3 {
        font-size: 30px;
    }

    #product-results .search-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 20px;
    }
}

@media screen and (max-width: 479.5px) {
    .storefront-dialog .dialog-shell {
        padding-right: 16px;
        padding-left: 16px;
    }

    .storefront-dialog .dialog-gallery-controls {
        gap: 8px;
    }

    .storefront-dialog .dialog-gallery-controls button {
        flex: 1 1 0;
        padding: 10px 12px;
    }

    #product-results .search-results-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
