/* Legacy location selector compatibility.
 * Visual properties come from the active WordPress/WooCommerce theme.
 */
#lwp-store-selector-modal,
.lwp-location-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: min(3vw, 1.5rem);
    background: color-mix(in srgb, CanvasText 65%, transparent);
}

.lwp-store-selector-content,
.lwp-popup-content {
    width: min(38rem, calc(100vw - 2rem));
    max-height: 90dvh;
    overflow: auto;
    color: var(--global-palette3, var(--wp--preset--color--contrast, CanvasText));
    background: var(--global-palette9, var(--wp--preset--color--base, Canvas));
}

.lwp-store-selector-content {
    padding: clamp(1rem, 3vw, 2rem);
    text-align: center;
}

.lwp-popup-content {
    display: flex;
    flex-direction: column;
}

.lwp-popup-header,
.lwp-form-actions,
.lwp-user-location-features,
.location-loop-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.lwp-popup-header,
.lwp-location-details {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.lwp-popup-header h3,
.lwp-details-header h4,
.lwp-shortcode-title {
    margin-block-start: 0;
}

#lwp-store-selector-modal-dropdown,
.lwp-location-dropdown,
.lwp-form-group input,
.lwp-form-group select,
.lwp-form-group textarea,
.lwp-saved-locations,
.search-input-container input {
    width: 100%;
    max-width: 100%;
}

.lwp-selector-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.lwp-location-dropdown,
.lwp-saved-locations-dropdown,
.address-search-container,
.saved-address-list-item {
    flex: 1 1 12rem;
    min-width: 0;
}

.lwp-form-group,
.lwp-details-header,
.lwp-user-location-features,
.where-component-search-form {
    margin-block-end: 1rem;
}

.lwp-form-group label,
.lwp-saved-locations-dropdown label,
.saved-address-label {
    display: block;
    margin-block-end: 0.4rem;
}

.lwp-map-container {
    position: relative;
    min-height: clamp(18rem, 60dvh, 40rem);
}

.lwp-location-map {
    position: absolute;
    inset: 0;
}

.lwp-map-controls {
    position: absolute;
    z-index: 2;
    inset-inline: 1rem;
    inset-block-end: 1rem;
    display: flex;
    justify-content: center;
}

.location-specific-info,
.product-location-unavailable,
.stock-badge,
.location-stock-loop {
    padding: 0.75rem;
}

.product-location-unavailable,
.stock-badge,
.location-stock-loop,
.location-specific-info {
    background: color-mix(in srgb, currentColor 6%, transparent);
}

.button.unavailable-product {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Functional state only; the theme decides how an unavailable card looks. */
.product.out-of-stock .add_to_cart_button,
.product.out-of-stock .product_type_simple {
    display: none;
}

.address-content,
.saved-address-list-item-container,
.search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.lwp-location-tooltip {
    position: absolute;
    z-index: 1000;
    inset-block-start: 100%;
    inset-inline-start: 0;
    width: min(25rem, 100vw - 2rem);
    max-height: 80dvh;
    overflow: auto;
    color: var(--global-palette3, var(--wp--preset--color--contrast, CanvasText));
    background: var(--global-palette9, var(--wp--preset--color--base, Canvas));
}

.two-lines {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mulopimfwc-product-location-selector-wrapper {
    display: block;
    clear: both;
    margin-block-end: 1rem;
}

@media (max-width: 30rem) {
    .lwp-selector-form,
    .lwp-user-location-features,
    .lwp-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .lwp-location-dropdown,
    .lwp-shortcode-submit,
    .lwp-form-actions .button {
        width: 100%;
    }
}
