/*
 * The side basket.
 *
 * Scoped entirely under .hc so it cannot reach the rest of the theme. That matters more than usual
 * here: this store carries a decade of stylesheets, several of them with !important on generic
 * selectors, and the old cart has to keep working untouched while this is tested.
 *
 * Brand colours are taken from the 2019 symbol: the spiral blue and the green centre.
 */

/*
 * The hidden attribute has to win here, and without this rule it does not.
 *
 * [hidden] { display: none } is a browser default, so it carries less weight than any author rule that
 * sets display - and several below do, because the panel and its screens are flex containers. The
 * result was both screens laid out side by side inside one flex row: the basket squeezed into half the
 * panel, every product name wrapping one word per line, and the checkout's totals and button sitting
 * next to the basket's own.
 *
 * Declared first and with !important so that toggling the attribute in JavaScript is enough, and no
 * future display rule can quietly reopen the same hole.
 */
.hc[hidden],
.hc-scrim[hidden],
.hc [hidden] {
    display: none !important;
}

.hc,
.hc-scrim,
.hc-trigger {
    --hc-blue: #0094d9;
    --hc-blue-dark: #007cb5;
    --hc-green: #8cab00;
    --hc-ink: #1b2430;
    --hc-muted: #6b7885;
    --hc-line: #e7eaee;
    --hc-bg: #ffffff;
    --hc-panel: 400px;
    --hc-radius: 12px;
}

/* ------------------------------------------------------------------ trigger */

.hc-trigger {
    position: fixed;
    right: 18px;
    bottom: 96px;                 /* clear of the player bar, which owns the bottom strip */
    z-index: 99999990;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--hc-blue);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
    transition: transform .18s ease, background-color .18s ease;
}

.hc-trigger:hover,
.hc-trigger:focus-visible {
    background: var(--hc-blue-dark);
    transform: translateY(-2px);
}

.hc-trigger svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.hc-trigger-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--hc-green);
    color: #fff;
    font: 700 12px/22px Arial, Helvetica, sans-serif;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------- scrim */

.hc-scrim {
    position: fixed;
    inset: 0;
    z-index: 99999995;
    background: rgba(16, 22, 30, .45);
    opacity: 0;
    transition: opacity .24s ease;
}

.hc-scrim.is-open {
    opacity: 1;
}

/* --------------------------------------------------------------------- panel */

.hc {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 99999996;
    display: flex;
    flex-direction: column;
    width: var(--hc-panel);
    max-width: 100vw;
    background: var(--hc-bg);
    color: var(--hc-ink);
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: -10px 0 30px rgba(16, 22, 30, .18);

    /*
     * Off canvas by default and moved with a transform, not by animating right/width: a transform is
     * composited, so the panel slides without forcing the page behind it to lay out again on every
     * frame. On a catalogue page with thirty product tiles that is the difference between a smooth
     * open and a visible stutter.
     */
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.22, .61, .36, 1);
    will-change: transform;
}

.hc.is-open {
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {
    .hc,
    .hc-scrim,
    .hc-trigger {
        transition: none;
    }
}

/* Full width on a phone: 400px of panel on a 412px screen leaves a useless sliver behind it. */
@media only screen and (max-width: 460px) {
    .hc {
        --hc-panel: 100vw;
    }
}

/* ---------------------------------------------------------------------- head */

.hc-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hc-line);
    flex: 0 0 auto;
}

.hc-title {
    margin: 0;
    font-size: 19px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--hc-ink);
}

.hc-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--hc-muted);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}

.hc-close:hover,
.hc-close:focus-visible {
    background: #f2f4f7;
    color: var(--hc-ink);
}

.hc-close svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Visible to assistive technology, out of the way visually. */
.hc-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------- screens */

.hc-screens {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;             /* lets the body scroll instead of the panel growing */
    display: flex;
}

.hc-screen {
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
    min-width: 0;
    min-height: 0;
}

.hc-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 20px;
    /*
     * The basket scrolls on its own.
     *
     * Reaching the end of this list used to carry straight on into the page behind it, so the two felt like
     * one scroll. contain stops that chaining; the page is also held still while the panel is open, which is
     * the other half of it.
     */
    overscroll-behavior: contain;
}

/*
 * The page, held still while the panel is open.
 *
 * position: fixed rather than overflow: hidden, because iOS ignores overflow on the document and scrolls the
 * page anyway. The offset is applied to the body by the script so the reading position is kept, and restored
 * on close.
 */
html.hc-locked,
html.hc-locked body {
    overflow: hidden;
}

html.hc-locked body {
    position: fixed;
    width: 100%;
}

/* --------------------------------------------------------------------- lines */

.hc-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--hc-line);
}

.hc-item:last-child {
    border-bottom: 0;
}

.hc-item-art {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 8px;
    background: #f5f7f9;
    object-fit: cover;
}

.hc-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

.hc-item-name {
    display: block;
    margin: 0 0 4px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--hc-ink);
    text-decoration: none;
}

.hc-item-name:hover {
    color: var(--hc-blue);
}

.hc-item-price {
    font-size: 13px;
    color: var(--hc-muted);
}

.hc-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
}

.hc-item-total {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.hc-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    overflow: hidden;
}

.hc-qty button {
    width: 28px;
    height: 28px;
    border: 0;
    background: #fff;
    color: var(--hc-ink);
    font: 700 15px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
}

.hc-qty button:hover:not(:disabled) {
    background: #f2f4f7;
}

.hc-qty button:disabled {
    color: #c3cad2;
    cursor: default;
}

.hc-qty-value {
    min-width: 28px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.hc-item-remove {
    border: 0;
    background: none;
    padding: 0;
    font-size: 12px;
    color: var(--hc-muted);
    text-decoration: underline;
    cursor: pointer;
}

.hc-item-remove:hover {
    color: #c0392b;
}

/* --------------------------------------------------------------------- empty */

.hc-empty {
    padding: 48px 8px;
    text-align: center;
    color: var(--hc-muted);
}

.hc-empty svg {
    width: 54px;
    height: 54px;
    fill: #d7dde3;
    margin-bottom: 14px;
}

.hc-empty strong {
    display: block;
    font-size: 16px;
    color: var(--hc-ink);
    margin-bottom: 6px;
}

/* -------------------------------------------------------------------- coupon */

.hc-coupon {
    flex: 0 0 auto;
    /*
     * Room below the field, not just above it. With no bottom padding the input and its button sat hard
     * against the totals divider, reading as part of the footer rather than as the last thing in the
     * basket.
     */
    padding: 18px 20px 26px;
}

.hc-coupon-label {
    display: block;
    font-size: 12px;
    color: var(--hc-muted);
    margin-bottom: 6px;
}

.hc-coupon-row {
    display: flex;
    gap: 8px;
}

.hc-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--hc-line);
    border-radius: 8px;
    font-size: 14px;
    color: var(--hc-ink);
    background: #fff;
    box-sizing: border-box;
}

.hc-input:focus {
    outline: 2px solid rgba(0, 148, 217, .35);
    outline-offset: 1px;
    border-color: var(--hc-blue);
}

/*
 * Do not let the theme paint an untouched field as a mistake.
 *
 * The theme carries `input:invalid, textarea:invalid { background-color: #f0dddd }`, and a required field
 * that is simply still empty already matches :invalid - so both login fields rendered pink before the
 * customer had typed a character. An email field also matches while the address is half typed.
 *
 * `input:invalid` is (0,1,1) and beats a bare class, hence the descendant selector rather than
 * !important. The required attribute stays, because it is what tells assistive technology the field is
 * needed; only the colouring is neutralised, and a genuine failure is reported in the panel's own error
 * strip instead.
 */
.hc .hc-input:invalid,
.hc .hc-input:required {
    background-color: #fff;
}

/* ---------------------------------------------------------------------- foot */

.hc-foot {
    flex: 0 0 auto;
    padding: 16px 20px 20px;
    border-top: 1px solid var(--hc-line);
    background: #fff;
}

.hc-totals {
    margin: 0 0 14px;
}

.hc-totals div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin: 0 0 6px;
}

.hc-totals dt {
    margin: 0;
    font-size: 13px;
    color: var(--hc-muted);
}

.hc-totals dd {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
}

.hc-totals .hc-grand dt,
.hc-totals .hc-grand dd {
    font-size: 17px;
    color: var(--hc-ink);
    font-weight: 700;
}

.hc-btn {
    display: block;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    font: 700 15px/48px Arial, Helvetica, sans-serif;
    text-align: center;
    cursor: pointer;
    transition: background-color .16s ease, opacity .16s ease;
}

.hc-btn--primary {
    background: var(--hc-green);
    color: #fff;
}

.hc-btn--primary:hover:not(:disabled) {
    background: #7d9900;
}

.hc-btn--ghost {
    width: auto;
    padding: 0 16px;
    height: 40px;
    line-height: 40px;
    background: #f2f4f7;
    color: var(--hc-ink);
}

.hc-btn:disabled {
    opacity: .55;
    cursor: default;
}

.hc-link {
    display: block;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    width: 100%;
    font-size: 13px;
    color: var(--hc-muted);
    text-align: center;
    text-decoration: underline;
    cursor: pointer;
}

.hc-link:hover {
    color: var(--hc-ink);
}

/* ------------------------------------------------------------------- payment */

.hc-pay-who {
    padding: 14px 0 4px;
    font-size: 13px;
    color: var(--hc-muted);
}

.hc-pay-who strong {
    color: var(--hc-ink);
}

.hc-pay-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.hc-pay-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--hc-line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease;
}

.hc-pay-option:hover {
    border-color: #cfd6dd;
    background: #fafbfc;
}

.hc-pay-option.is-chosen {
    border-color: var(--hc-blue);
    background: rgba(0, 148, 217, .05);
}

.hc-pay-option input {
    margin: 2px 0 0;
}

.hc-pay-title {
    font-size: 14px;
    font-weight: 700;
}

.hc-pay-note {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: var(--hc-muted);
}

/* --------------------------------------------------------------- identify me */

.hc-identify {
    padding: 34px 4px;
    text-align: center;
}

.hc-identify strong {
    display: block;
    font-size: 16px;
    margin-bottom: 6px;
}

.hc-identify p {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--hc-muted);
}

/* The sign in form, left aligned inside an otherwise centred block. */
.hc-login {
    text-align: left;
    margin-bottom: 6px;
}

.hc-login .hc-input {
    width: 100%;
    margin-bottom: 14px;
}

.hc-login .hc-btn {
    margin-top: 4px;
}

/*
 * What the panel says after asking for a reset link.
 *
 * Kept next to the form instead of in the panel's error strip, and the form is left standing: the sentence is
 * deliberately non-committal about whether the address has an account, so a customer who mistyped needs to see
 * the confirmation and the field they typed at the same time to work out which happened.
 */
.hc-forgot-said {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
    color: var(--hc-muted);
}

.hc-forgot-said.is-sent {
    color: #2f7d32;
    font-weight: 600;
}

/* ---------------------------------------------------------------------- done */

.hc-done {
    padding: 52px 20px;
    text-align: center;
}

.hc-done svg {
    width: 62px;
    height: 62px;
    fill: var(--hc-green);
    margin-bottom: 16px;
}

.hc-done strong {
    display: block;
    font-size: 19px;
    margin-bottom: 8px;
}

.hc-done p {
    margin: 0;
    font-size: 14px;
    color: var(--hc-muted);
}

/* --------------------------------------------------------------------- error */

.hc-error {
    flex: 0 0 auto;
    margin: 0;
    padding: 12px 20px;
    background: #fdecea;
    border-top: 1px solid #f5c6c0;
    color: #a33;
    font-size: 13px;
}

/* ------------------------------------------------------------------- working */

.hc.is-busy .hc-body,
.hc.is-busy .hc-foot {
    opacity: .55;
    pointer-events: none;
}

/* ------------------------------------------------------------------- combo */

/*
 * The highlighted offer. Given a tinted card and a headline so it reads as an offer rather than as another
 * line in the basket, but kept below the items: it is an addition to a decision already made, and putting it
 * first would push what they chose out of view.
 */
.hc-combo {
    margin: 4px 0 22px;
    padding: 16px 0 0;
    border-top: 1px dashed var(--hc-line);
}

.hc-combo-head {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--hc-green);
}

.hc-combo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(140, 171, 0, .35);
    border-radius: var(--hc-radius);
    background: linear-gradient(180deg, rgba(140, 171, 0, .07), rgba(140, 171, 0, .02));
}

.hc-combo-art {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}

.hc-combo-body {
    flex: 1 1 auto;
    min-width: 0;
}

.hc-combo-name {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    color: var(--hc-ink);
}

.hc-combo-sub {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--hc-muted);
}

.hc-combo-price {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
    color: var(--hc-ink);
}

.hc-combo-was {
    margin-right: 6px;
    font-weight: 400;
    color: var(--hc-muted);
}

.hc-combo-add {
    flex: 0 0 auto;
    align-self: center;
}

/* ------------------------------------------------- embedded payment forms */

/*
 * These rules dress markup this module does not own: the payment block comes from Magento and each fieldset
 * comes from its gateway. So the styling stays structural - spacing, borders, full width fields - and avoids
 * anything that assumes a particular field order or a particular label, which would break the moment a
 * gateway changes its own form.
 */
.hc-pay-methods {
    margin-top: 6px;
}

.hc-pay-loading {
    margin: 18px 0;
    font-size: 13px;
    color: var(--hc-muted);
    text-align: center;
}

.hc-pay-methods dl,
.hc-pay-methods dt,
.hc-pay-methods dd,
.hc-pay-methods ul,
.hc-pay-methods li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hc-pay-methods dt.hc-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--hc-line);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--hc-ink);
    transition: border-color .16s ease, background-color .16s ease;
}

.hc-pay-methods dt.hc-method:hover {
    border-color: #cfd6dd;
    background: #fafbfc;
}

.hc-pay-methods dt.hc-method.is-chosen {
    border-color: var(--hc-blue);
    background: rgba(0, 148, 217, .05);
}

.hc-pay-methods dt.hc-method label {
    cursor: pointer;
    font-weight: 700;
}

/* The gateway's own fieldset, revealed once its method is chosen. */
.hc-pay-methods dd {
    padding: 4px 2px 16px;
}

.hc-pay-methods dd .form-list,
.hc-pay-methods dd ul {
    margin: 0;
}

.hc-pay-methods dd li {
    margin-bottom: 12px;
}

.hc-pay-methods label {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    color: var(--hc-muted);
}

.hc-pay-methods input[type="text"],
.hc-pay-methods input[type="tel"],
.hc-pay-methods input[type="number"],
.hc-pay-methods input[type="password"],
.hc-pay-methods select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--hc-line);
    border-radius: 8px;
    font-size: 14px;
    color: var(--hc-ink);
    background-color: #fff;
    box-sizing: border-box;
}

/* Same reasoning as the login fields: an untouched required field is not a mistake. */
.hc-pay-methods input:invalid,
.hc-pay-methods select:invalid {
    background-color: #fff;
}

/*
 * Radios and checkboxes need a size of their own.
 *
 * The rule above sizes text inputs and selects to fill the panel, and the reset that followed set these back
 * to width:auto / height:auto - which on a native radio collapses it to almost nothing, so choosing a payment
 * method or a saved card meant aiming at a control that could not be seen. An explicit box is given instead,
 * appearance kept native so it still looks like the control it is, and flex-shrink pinned because several of
 * these sit in flex rows and were being squeezed further.
 */
.hc-pay-methods input[type="radio"],
.hc-pay-methods input[type="checkbox"],
.hc-methods input[type="radio"],
.hc-methods input[type="checkbox"] {
    -webkit-appearance: radio;
    appearance: auto;
    flex: 0 0 auto;
    width: 17px;
    min-width: 17px;
    height: 17px;
    min-height: 17px;
    padding: 0;
    margin: 0 2px 0 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    vertical-align: middle;
    cursor: pointer;
}

.hc-pay-methods input[type="checkbox"],
.hc-methods input[type="checkbox"] {
    -webkit-appearance: checkbox;
}

/*
 * A gateway's own list of saved cards is a stack of radios with their labels, and the theme's label rule
 * above makes every label a block - which dropped each label onto its own line, away from its radio. Keep
 * each saved card on one line with its control.
 */
.hc-pay-methods li label,
.hc-pay-methods dd label {
    display: inline-block;
    margin: 0 0 0 6px;
    font-size: 13px;
    color: var(--hc-ink);
    vertical-align: middle;
    cursor: pointer;
}

/* A couple of gateways group month and year side by side; keep them on one line. */
.hc-pay-methods .v-fix {
    display: inline-block;
    margin-right: 8px;
}

/* ------------------------------------------------------------- agreements */

/*
 * The store's required terms, shown in full rather than behind a link.
 *
 * A side panel has nowhere to put a popup, and the checkout's own overlay would land behind the drawer.
 * So the text is scrollable in place: capped in height so it never pushes the pay button off the step,
 * and focusable so a keyboard can scroll it.
 */
.hc-agreements {
    margin: 4px 0 18px;
}

.hc-agreement + .hc-agreement {
    margin-top: 14px;
}

.hc-agreement-text {
    max-height: 132px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--hc-line);
    border-radius: 10px;
    background: #fafbfc;
    font-size: 12px;
    line-height: 1.55;
    color: var(--hc-muted);
    -webkit-overflow-scrolling: touch;
}

.hc-agreement-text:focus {
    outline: 2px solid var(--hc-blue);
    outline-offset: 1px;
}

.hc-agreement-text p {
    margin: 0 0 8px;
}

.hc-agreement-text :last-child {
    margin-bottom: 0;
}

.hc-agreement-accept {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--hc-ink);
    cursor: pointer;
}

.hc-agreement-accept input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

/* ------------------------------------------------------- account creation */

.hc-newacct {
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hc-line);
    margin-bottom: 16px;
}

.hc-newacct-hint {
    margin: 0 0 14px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--hc-muted);
}

/*
 * The sign-in offer, above the registration form rather than below it.
 *
 * A returning customer meets this step too, and for them the whole form is the wrong answer - everything it
 * asks for is already on their account. At the bottom this sat under nine fields and a scroll, hidden from
 * precisely the person it is for. A full width button, not a text link: it is one of two real choices here,
 * not a footnote to the other.
 */
.hc-acct-switch {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hc-line);
}

.hc-acct-switch .hc-btn {
    width: 100%;
}

.hc-field {
    margin-bottom: 12px;
}

.hc-field .hc-input {
    width: 100%;
}

/*
 * The registration form: nine fields in a drawer.
 *
 * Laid out in two columns rather than one long column, because the panel is 380px wide and a stack of nine
 * full width inputs is taller than the viewport - the customer would scroll past the payment methods they
 * came here to choose and never see them. Paired, the whole form and the payment choice fit on one screen
 * on a laptop, which is what makes this a panel rather than a second checkout page.
 *
 * Titled in short runs for the same reason: three labelled groups of three read as a form, one run of nine
 * reads as a wall.
 */
.hc-reg-group {
    margin-bottom: 14px;
}

.hc-reg-legend {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hc-muted);
}

.hc-reg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
}

/*
 * Fields that cannot share a line. A street name, an e-mail and a full name all run long enough that half a
 * panel truncates them mid-word while the customer is still typing.
 */
.hc-reg-grid > .hc-field--wide {
    grid-column: 1 / -1;
}

.hc-reg-grid .hc-field {
    margin-bottom: 10px;
    min-width: 0;
}

/*
 * A date input reports a wider intrinsic size than a text input, so left to itself it pushes its column
 * past the panel and the picker button lands under the next field.
 */
.hc-reg-grid .hc-input {
    max-width: 100%;
}

.hc-field-hint {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--hc-muted);
}

/*
 * A refusal under the field it is about.
 *
 * The panel already has an error strip, and for one sentence that is enough. It is not enough for a form
 * this size: "check the highlighted fields" over nine inputs leaves the customer hunting, so the server
 * names each one and each message sits where it can be acted on.
 */
.hc-field-error {
    margin: 4px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #b3261e;
}

.hc-field.is-invalid .hc-input {
    border-color: #b3261e;
}

.hc-field.is-invalid .hc-coupon-label {
    color: #b3261e;
}

/*
 * A field the panel is happy with.
 *
 * Worth showing, not just the opposite. A form of nine fields that only ever speaks up to complain leaves the
 * customer unsure whether the rest was read at all - and after correcting something, unsure whether the
 * correction landed. A quiet green edge answers that without adding noise.
 */
.hc-field.is-ok .hc-input {
    border-color: #9ccc9e;
}

/*
 * A note about a whole group, above its fields.
 *
 * This started under the postcode input, which pushed that field's row out of line with the one beside it -
 * and what it explains, that the address fills itself in, was never about one field anyway.
 */
.hc-reg-note {
    margin: 0 0 10px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--hc-muted);
}

/* One column where there is no room for two. */
@media (max-width: 420px) {
    .hc-reg-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.hc-done-note {
    margin-top: 14px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--hc-muted);
}

/* The same line once the payment has landed, so the change of state is visible and not just reworded. */
.hc-done-note.hc-done-confirmed {
    color: #2f7d32;
    font-weight: 600;
}

/*
 * A refused payment reads as a problem, not as a completed purchase: no tick, and the heading in the panel's
 * warning colour rather than alongside a green mark.
 */
.hc-done.is-refused > strong {
    color: #b03030;
}

.hc-done.is-refused svg {
    display: none;
}

/*
 * The gateway's own payment instructions on the done screen.
 *
 * Boleto and PIX render a digitable line, a copy and paste code and a QR image, and those come as the
 * payment module's markup with its own inline styling. So this only constrains the box: full width, images
 * kept inside it, and long codes allowed to wrap instead of widening the drawer.
 */
.hc-done-instructions {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--hc-line);
    border-radius: 10px;
    background: #fafbfc;
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.hc-done-instructions img {
    max-width: 100%;
    height: auto;
}

/*
 * Normalise the gateway's typography.
 *
 * This markup was written for a full width success page and for order e-mails, where it inherits that page's
 * type scale. Dropped into the panel it inherited the theme's heading sizes instead, so field labels came out
 * larger than the values they label. Sizes are pinned rather than left to inherit, and the labels are allowed
 * to sit on their own line, because a digitable line is 47 characters and will not share a row at this width.
 */
.hc-done-instructions,
.hc-done-instructions * {
    font-size: 13px;
    line-height: 1.5;
}

.hc-done-instructions strong,
.hc-done-instructions b,
.hc-done-instructions th {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--hc-muted);
}

.hc-done-instructions p {
    margin: 0 0 10px;
}

.hc-done-instructions table {
    width: 100%;
    margin: 0 0 10px;
    border-collapse: collapse;
}

.hc-done-instructions td,
.hc-done-instructions th {
    display: block;
    width: auto;
    padding: 0;
    text-align: left;
}

/* The digitable line and the PIX code are for copying, so keep them monospaced and selectable. */
.hc-done-instructions td {
    margin: 0 0 10px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: var(--hc-ink);
    word-break: break-all;
    user-select: all;
}

.hc-done-instructions a {
    display: inline-block;
    margin: 2px 0 8px;
    font-weight: 700;
}
