/* Header shipping calculator (calculator/_widget.php). Controls match checkout-accordion.css. */
@import url("palette.css");

.calc-on {
    border: 0;
    padding: 0;
}

.calc-on:focus-visible {
    outline: 3px solid var(--sc-accent);
    outline-offset: 3px;
}

.calc-quote .modal-dialog {
    width: min(800px, calc(100% - 32px));
    margin: 48px auto;
}

.calc-quote .cq-dialog {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(31, 36, 48, .2);
    color: var(--sc-ink);
    text-align: start;
}

.calc-quote ::selection {
    background: var(--sc-accent);
    color: #fff;
}

.calc-quote :focus-visible {
    outline: 2px solid var(--sc-accent);
    outline-offset: 2px;
}

.calc-quote p {
    margin: 0;
}

/* Form */

.calc-quote .cq-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 24px;
}

.calc-quote .cq-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.calc-quote .cq-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--sc-ink);
}

.calc-quote .cq-sub {
    margin-top: 2px;
    font-size: 14px;
    color: var(--sc-muted);
}

.calc-quote .cq-close {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--sc-ink);
    cursor: pointer;
}

.calc-quote .cq-close:hover {
    background: var(--sc-page);
}

.calc-quote fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.calc-quote .cq-label,
.calc-quote legend.cq-label {
    display: block;
    width: auto;
    margin: 0 0 6px;
    padding: 0;
    border: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--sc-ink);
}

.calc-quote .cq-hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--sc-muted);
}

.calc-quote .cq-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.calc-quote .cq-sides {
    display: flex;
    flex: 1;
    gap: 8px;
    min-width: 0;
}

.calc-quote .cq-side {
    flex: 1;
    min-width: 0;
}

.calc-quote .cq-side label {
    display: block;
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 400;
    color: var(--sc-muted);
}

.calc-quote .cq-input {
    width: 100%;
    max-width: none;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--sc-field-line);
    border-radius: 10px;
    background: #fff;
    color: var(--sc-ink);
    caret-color: var(--sc-accent);
    font: inherit;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
    text-align: start;
    box-shadow: none;
}

.calc-quote .cq-row > .cq-input {
    flex: 1;
    min-width: 0;
}

.calc-quote .cq-input::placeholder {
    color: var(--sc-muted);
    opacity: 1;
}

.calc-quote .cq-input:focus {
    border-color: var(--sc-accent);
    outline: 0;
    box-shadow: 0 0 0 3px var(--sc-accent-soft);
}

.calc-quote .cq-input[aria-invalid="true"] {
    border-color: var(--sc-danger);
}

.calc-quote .cq-err {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--sc-danger);
}

.calc-quote .cq-err:empty {
    display: none;
}

/* Segmented radio groups (origin, units) */

.calc-quote .cq-seg {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--sc-accent);
    border-radius: 10px;
    overflow: hidden;
}

.calc-quote .cq-seg.is-grow {
    display: flex;
}

.calc-quote .cq-seg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.calc-quote .cq-seg label {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 46px;
    margin: 0;
    padding: 0 14px;
    background: #fff;
    color: var(--sc-accent);
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease-out, color .15s ease-out;
}

.calc-quote .cq-seg label + input + label {
    border-inline-start: 1px solid var(--sc-accent);
}

.calc-quote .cq-seg input:checked + label {
    background: var(--sc-accent);
    color: #fff;
}

.calc-quote .cq-seg input:focus-visible + label {
    outline: 2px solid var(--sc-ink);
    outline-offset: -4px;
}

/* Quote panel */

.calc-quote .cq-quote {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: var(--sc-accent-soft);
}

.calc-quote .cq-quote-body {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.calc-quote .cq-quote-body > [data-for] {
    display: none;
}

.calc-quote .cq-quote-body:not([data-state="result"]) {
    justify-content: center;
    min-height: 160px;
    text-align: center;
}

.calc-quote .cq-idle-icon {
    display: block;
    margin: 0 auto 10px;
    color: var(--sc-accent);
}

.calc-quote .cq-quote-body[data-state="idle"] > [data-for="idle"],
.calc-quote .cq-quote-body[data-state="invalid"] > [data-for="invalid"],
.calc-quote .cq-quote-body[data-state="failed"] > [data-for="failed"],
.calc-quote .cq-quote-body[data-state="result"] > [data-for="result"] {
    display: block;
}

.calc-quote .cq-message {
    font-size: 15px;
    line-height: 1.55;
    color: var(--sc-accent-dark);
}

.calc-quote .cq-retry {
    margin-top: 10px;
    height: 40px;
    padding: 0 16px;
    border: 1.5px solid var(--sc-accent);
    border-radius: 10px;
    background: #fff;
    color: var(--sc-accent);
    font: inherit;
    cursor: pointer;
}

.calc-quote .cq-result {
    transition: opacity .2s ease-out;
}

.calc-quote .cq-quote.is-busy .cq-result {
    opacity: .5;
}

.calc-quote .cq-updating {
    display: none;
    font-size: 13px;
    color: var(--sc-accent-dark);
}

.calc-quote .cq-quote.is-busy .cq-updating {
    display: block;
}

.calc-quote .cq-result > * + * {
    margin-top: 14px;
}

.calc-quote .cq-from-label {
    display: block;
    font-size: 14px;
    color: var(--sc-accent-dark);
}

.calc-quote .cq-from-price {
    display: inline-block;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--sc-accent);
    font-variant-numeric: tabular-nums;
}

.calc-quote .cq-from-price.is-new {
    animation: cq-price-in .32s cubic-bezier(.16, 1, .3, 1);
}

@keyframes cq-price-in {
    from {
        opacity: .35;
        filter: blur(3px);
        transform: translateY(4px);
    }
}

.calc-quote .cq-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.calc-quote .cq-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--sc-line);
    border-radius: 10px;
    background: #fff;
}

.calc-quote .cq-option.is-recommended {
    border-color: var(--sc-accent);
    box-shadow: inset 0 0 0 1px var(--sc-accent);
}

.calc-quote .cq-option.is-unavailable {
    border-style: dashed;
    background: transparent;
}

.calc-quote .cq-option.is-unavailable .cq-option-name,
.calc-quote .cq-option.is-unavailable .cq-option-price {
    color: var(--sc-muted);
}

.calc-quote .cq-option.is-unavailable .cq-option-price {
    font-size: 14px;
    font-weight: 500;
}

.calc-quote .cq-option-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    min-width: 0;
}

.calc-quote .cq-option-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--sc-ink);
}

.calc-quote .cq-option-days {
    flex-basis: 100%;
    font-size: 13px;
    color: var(--sc-muted);
}

.calc-quote .cq-option-price {
    flex-shrink: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--sc-ink);
    font-variant-numeric: tabular-nums;
}

.calc-quote .cq-option.is-recommended .cq-option-price {
    color: var(--sc-accent);
}

.calc-quote .cq-perks {
    display: flex;
    flex-basis: 100%;
    flex-wrap: wrap;
    gap: 2px 12px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--sc-accent-dark);
}

.calc-quote .cq-perks li {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.calc-quote .cq-perks li::before {
    content: "";
    inline-size: 8px;
    block-size: 4px;
    margin-block-end: 3px;
    border-left: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}

.calc-quote .cq-tag {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--sc-accent-soft);
    color: var(--sc-accent-dark);
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}

.calc-quote .cq-tag.is-strong {
    background: var(--sc-accent);
    color: #fff;
}

.calc-quote .cq-meter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-quote .cq-bar-text {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--sc-muted);
    font-variant-numeric: tabular-nums;
}

.calc-quote .cq-bar.is-on .cq-bar-text {
    color: var(--sc-ink);
}

.calc-quote .cq-bar-track {
    height: 8px;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.calc-quote .cq-bar-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #cdb6d3;
    transition: inline-size .3s cubic-bezier(.16, 1, .3, 1);
}

.calc-quote .cq-bar.is-on .cq-bar-track span {
    background: var(--sc-accent);
}

.calc-quote .cq-note {
    font-size: 14px;
    line-height: 1.55;
    color: var(--sc-muted);
}

.calc-quote .cq-note.is-emphasis {
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    color: var(--sc-ink);
}

.calc-quote .cq-too-big {
    padding: 14px;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    line-height: 1.55;
}

.calc-quote .cq-too-big .cq-link {
    display: inline-block;
    margin-top: 6px;
}

.calc-quote .cq-link {
    color: var(--sc-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.calc-quote .cq-link:hover {
    color: var(--sc-accent-dark);
}

.calc-quote .cq-signup {
    display: inline-block;
    font-size: 15px;
    font-weight: 500;
}

.calc-quote .cq-fineprint {
    margin-top: auto;
    font-size: 13px;
    line-height: 1.5;
    color: var(--sc-muted);
}

@media (max-width: 767px) {
    .calc-quote .modal-dialog {
        width: auto;
        margin: 8px;
    }

    .calc-quote .cq-dialog {
        grid-template-columns: minmax(0, 1fr);
    }

    .calc-quote .cq-form,
    .calc-quote .cq-quote {
        padding: 18px;
    }
}

@media (max-width: 359px) {
    .calc-quote .cq-row.is-dims {
        flex-wrap: wrap;
    }

    .calc-quote .cq-row.is-dims .cq-sides {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calc-quote .cq-from-price.is-new {
        animation: none;
    }

    .calc-quote .cq-bar-track span,
    .calc-quote .cq-result,
    .calc-quote .cq-seg label {
        transition: none;
    }
}
