/* Fulfilment UI structural compatibility layer.
 * WooCommerce and the active theme own all visual styling.
 */
.toprest-cart-experience,
.toprest-cart-experience *,
.toprest-completion-page,
.toprest-completion-page *,
.toprest-suggestions-modal,
.toprest-suggestions-modal * {
    box-sizing: border-box;
}

.toprest-cart-experience,
.toprest-completion-page,
.toprest-completion-empty {
    width: 100%;
    max-width: 100%;
    margin-block: 1.5rem;
}

.toprest-cart-groups,
.toprest-delivery-preferences,
.toprest-completion-progress,
.toprest-completion-empty,
.toprest-product-group-note,
.toprest-mini-cart-groups,
.toprest-order-delivery-customer {
    padding: clamp(1rem, 3vw, 1.5rem);
    color: inherit;
    background: color-mix(in srgb, currentColor 5%, transparent);
}

.toprest-cart-groups__heading,
.toprest-cart-group__top,
.toprest-group-suggestions__title,
.toprest-delivery-preferences__head,
.toprest-completion-hero,
.toprest-completion-toolbar,
.toprest-completion-actions,
.toprest-modal-live-progress > div,
.toprest-suggestions-modal__dialog > header,
.toprest-suggestions-modal__dialog > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toprest-cart-groups__heading h2,
.toprest-cart-group h3,
.toprest-delivery-preferences h3,
.toprest-completion-hero h1,
.toprest-suggestions-modal__dialog h2 {
    margin-block: 0;
}

.toprest-cart-group,
.toprest-group-suggestions,
.toprest-delivery-preferences {
    margin-block-start: 1rem;
}

.toprest-cart-group__items,
.toprest-mini-cart-groups {
    display: grid;
    gap: 0.6rem;
}

.toprest-cart-group__progress {
    position: relative;
    width: 100%;
    min-height: 0.4rem;
    margin-block: 0.75rem;
    overflow: hidden;
    background: color-mix(in srgb, currentColor 12%, transparent);
}

.toprest-cart-group__progress > i {
    display: block;
    min-height: inherit;
    background: currentColor;
}

.toprest-group-suggestions__grid,
.toprest-suggestion-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(12rem, 100%), 1fr));
    gap: 1rem;
}

.toprest-suggestion-card,
.toprest-suggestion-modal-card {
    min-width: 0;
    overflow: hidden;
}

.toprest-suggestion-card__image,
.toprest-suggestion-modal-card__image {
    display: block;
}

.toprest-suggestion-card__image img,
.toprest-suggestion-modal-card__image img {
    display: block;
    width: 100%;
    height: auto;
}

.toprest-suggestion-card__body,
.toprest-suggestion-modal-card__body {
    display: grid;
    gap: 0.5rem;
    padding-block: 0.75rem;
}

.toprest-suggestion-card .button,
.toprest-suggestion-modal-card .button {
    width: 100%;
    text-align: center;
}

.toprest-suggestion-qty {
    display: grid;
    grid-template-columns: auto minmax(3rem, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
}

.toprest-suggestion-qty input,
.toprest-delivery-grid input,
.toprest-delivery-grid select,
.toprest-completion-toolbar input {
    width: 100%;
    max-width: 100%;
}

.toprest-delivery-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-block-start: 1rem;
}

.toprest-delivery-grid label,
.toprest-completion-toolbar label {
    display: grid;
    gap: 0.4rem;
    min-width: 0;
}

.toprest-completion-hero,
.toprest-completion-progress,
.toprest-completion-toolbar,
.toprest-completion-actions {
    margin-block: 1rem;
}

.toprest-completion-status {
    flex: 1 1 auto;
}

.toprest-completion-checkout[aria-disabled="true"],
.toprest-add-completion-selection:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.toprest-suggestions-modal[hidden],
.toprest-delivery-preferences__body[hidden],
.toprest-mosque-name-field[hidden],
.toprest-show-all-suggestions[hidden] {
    display: none !important;
}

html.toprest-suggestions-modal-open,
body.toprest-suggestions-modal-open {
    overflow: hidden;
}

.toprest-suggestions-modal {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    display: grid;
    place-items: center;
    padding: min(3vw, 1.5rem);
}

.toprest-suggestions-modal__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, CanvasText 65%, transparent);
}

.toprest-suggestions-modal__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(68rem, calc(100vw - 2rem));
    max-height: 90dvh;
    overflow: hidden;
    color: var(--global-palette3, var(--wp--preset--color--contrast, CanvasText));
    background: var(--global-palette9, var(--wp--preset--color--base, Canvas));
}

.toprest-suggestions-modal__dialog > header,
.toprest-suggestions-modal__dialog > footer,
.toprest-modal-live-progress,
.toprest-suggestions-modal__body {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.toprest-suggestions-modal__body {
    min-height: 0;
    overflow: auto;
}

.toprest-suggestions-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 10rem;
}

.toprest-order-delivery-customer dl > div {
    display: grid;
    grid-template-columns: minmax(8rem, 0.4fr) minmax(0, 1fr);
    gap: 1rem;
}

@media (max-width: 48rem) {
    .toprest-cart-groups__heading,
    .toprest-cart-group__top,
    .toprest-delivery-preferences__head,
    .toprest-completion-hero,
    .toprest-completion-toolbar,
    .toprest-completion-actions,
    .toprest-suggestions-modal__dialog > header,
    .toprest-suggestions-modal__dialog > footer {
        align-items: stretch;
        flex-direction: column;
    }

    .toprest-delivery-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .toprest-suggestions-modal {
        align-items: end;
        padding: 0;
    }

    .toprest-suggestions-modal__dialog {
        width: 100%;
        max-height: 94dvh;
    }

    .toprest-completion-actions .button,
    .toprest-delivery-toggle {
        width: 100%;
        text-align: center;
    }
}
