/** Scrolling and feedback additions; the original tax-modal design stays in app.min.css. */
body.tax-selection-is-open {
    overflow: hidden;
}

#tax-selection-modal {
    --tax-modal-gap: 1rem;
    box-sizing: border-box;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    padding: var(--tax-modal-gap);
    overflow: auto;
    overscroll-behavior: contain;
}

#tax-selection-modal .tax-modal {
    box-sizing: border-box;
    flex: 0 1 auto;
    min-width: 0;
    max-height: calc(100vh - var(--tax-modal-gap) * 2);
    max-height: calc(100dvh - var(--tax-modal-gap) * 2);
    margin: auto;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scroll-padding-block: 1rem;
    -webkit-overflow-scrolling: touch;
}

#tax-selection-modal .tax-modal-close.hidden,
#tax-selection-modal [hidden],
.tax-selection-notice[hidden] {
    display: none !important;
}

#tax-selection-modal .tax-modal-btn:disabled {
    opacity: .65;
    cursor: wait;
}

#tax-selection-modal .tax-modal-change-note {
    margin: 1rem 0 .5rem;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--primary-clr);
}

#tax-selection-modal .tax-modal-feedback:not([hidden]) {
    margin: 1rem 0;
    padding: .75rem;
    border-left: 3px solid var(--wc-red);
    background: color-mix(in srgb, var(--wc-red) 5%, var(--white-clr));
    text-align: left;
}

#tax-selection-modal :is(button, a):focus-visible,
.tax-selection-notice-close:focus-visible {
    outline: 3px solid var(--secondary-clr);
    outline-offset: 3px;
}

/* One compact notification with a reveal, a static check and a ten-second lifetime. */
.tax-selection-notice {
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    position: fixed;
    top: max(1.25rem, env(safe-area-inset-top));
    right: max(1.25rem, env(safe-area-inset-right));
    bottom: auto;
    z-index: 9990;
    width: min(410px, calc(100% - 2.5rem));
    max-height: calc(100vh - 2.5rem);
    max-height: calc(100dvh - 2.5rem);
    overflow: hidden auto;
    padding: 1.125rem 1rem 1.125rem 1.125rem;
    border: 1px solid color-mix(in srgb, var(--primary-clr) 14%, var(--white-clr));
    border-radius: .875rem;
    color: var(--primary-clr);
    background: var(--white-clr);
    box-shadow: 0 12px 40px color-mix(in srgb, var(--primary-clr) 17%, transparent);
    font-family: var(--primary-font);
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .24s ease, transform .24s ease;
}
.tax-selection-notice.is-visible { opacity: 1; transform: translateY(0); }
.tax-selection-notice.is-leaving { opacity: 0; transform: translateY(-8px); transition-duration: .18s; }
body.admin-bar .tax-selection-notice { top: calc(32px + max(1.25rem, env(safe-area-inset-top))); }
.tax-selection-notice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--white-clr);
    background: var(--primary-clr);
}
.tax-selection-notice-icon .bx { font-size: 30px; line-height: 1; }
.tax-selection-notice.is-visible .tax-selection-notice-icon { animation: tax-selection-check-in .28s ease-out both; }
.tax-selection-notice-content { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.tax-selection-notice-title { display: block; margin: 0 0 .25rem; font-size: .9375rem; line-height: 1.45; }
.tax-selection-notice p { margin: 0; }
.tax-selection-notice .tax-selection-notice-rate { color: var(--primary-clr); font-size: 1.125rem; font-weight: var(--fw-bold); }
.tax-selection-notice .tax-selection-notice-detail { font-size: .8125rem; color: var(--body-text-clr); }
.tax-selection-notice .tax-selection-notice-cart { margin-top: .625rem; font-size: .8125rem; color: var(--body-text-clr); }
.tax-selection-notice-close {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    height: 36px;
    padding: .25rem;
    margin: -.375rem -.375rem 0 0;
    border: 0;
    border-radius: 50%;
    color: var(--primary-clr);
    background: transparent;
    cursor: pointer;
}
.tax-selection-notice-close .bx { font-size: 24px; line-height: 1; }
.tax-selection-notice-close:hover { color: var(--primary-clr); background: color-mix(in srgb, var(--primary-clr) 6%, var(--white-clr)); }
.tax-selection-notice-lifetime {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--secondary-clr);
    transform-origin: left center;
}
.tax-selection-notice.is-visible .tax-selection-notice-lifetime { animation: tax-selection-lifetime 10s linear forwards; }
#tax-selection-modal .tax-modal-btn.is-saving { position: relative; overflow: hidden; }
#tax-selection-modal .tax-modal-btn.is-saving::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 45%;
    height: 3px;
    border: 0;
    border-radius: 0;
    background: var(--primary-clr);
    animation: tax-selection-saving 1.3s ease-in-out infinite;
}
#tax-selection-modal .tax-modal-progress:not([hidden]) {
    margin: 1rem 0 .5rem;
    color: var(--primary-clr);
    font-size: .875rem;
    font-weight: var(--fw-bold);
}
@keyframes tax-selection-check-in { from { transform: scale(.8); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes tax-selection-lifetime { to { transform: scaleX(0); } }
@keyframes tax-selection-saving { from { transform: translateX(-110%); } to { transform: translateX(325%); } }
@media (max-width: 782px) {
    body.admin-bar .tax-selection-notice { top: calc(46px + max(.75rem, env(safe-area-inset-top))); }
}
@media (max-width: 575px) {
    #tax-selection-modal { --tax-modal-gap: .5rem; }
    .tax-selection-notice {
        top: max(.75rem, env(safe-area-inset-top));
        right: max(.75rem, env(safe-area-inset-right));
        width: calc(100% - 1.5rem);
        gap: .75rem;
        padding: 1rem;
    }
    .tax-selection-notice-icon { flex-basis: 38px; height: 38px; }
    .tax-selection-notice-icon .bx { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
    #tax-selection-modal,
    #tax-selection-modal *,
    #tax-selection-modal *::after,
    .tax-selection-notice,
    .tax-selection-notice * {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
    .tax-selection-notice-lifetime { display: none; }
    #tax-selection-modal .tax-modal-btn.is-saving::after { width: 100%; }
}
