/* Contact Us form (/contact-us). Linked from the page, not part of the site bundle.
   Mobile-first: one column, large tap targets. Wider screens only pair up the short fields. */

.cu {
    --cu-brand: #1ea199;
    --cu-brand-dark: #187d75;
    --cu-brand-tint: #f4fbfa;
    --cu-ink: #263238;
    --cu-muted: #59666d;
    --cu-line: #d5dadd;
    --cu-error: #b3261e;
    --cu-error-tint: #fdf1f0;
    --cu-radius: 10px;

    max-width: 720px;
    margin: 0 0 40px;
    font-family: 'Roboto Slab', serif;
    font-size: var(--txt-sm);
    line-height: 1.5;
    color: var(--cu-ink);
}

/* Several parts set their own display, which would otherwise beat the hidden attribute. */
.cu [hidden] {
    display: none !important;
}

.cu__form {
    display: grid;
    gap: 24px;
}

.cu__group {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.cu__section {
    display: grid;
    gap: 24px;
}

.cu__group.cu__section {
    gap: 12px;
}

.cu__pair,
.cu-lookup__fields {
    display: grid;
    gap: 16px;
}

.cu__label {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: var(--txt-lg);
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--cu-ink);
}

.cu__sublabel {
    margin: 0;
    font-size: var(--txt-sm);
    font-weight: 600;
    color: var(--cu-ink);
}

.cu__optional {
    font-family: 'Roboto Slab', serif;
    font-size: var(--txt-sm);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--cu-muted);
}

.cu__hint,
.cu__notice,
.cu__counter {
    margin: 0;
    font-size: var(--txt-sm);
    color: var(--cu-muted);
}

.cu__notice:empty,
.cu__error:empty {
    display: none;
}

.cu__counter {
    text-align: right;
}

.cu__error {
    margin: 0;
    font-size: var(--txt-sm);
    font-weight: 600;
    color: var(--cu-error);
}

.cu__alert {
    padding: 14px 18px;
    border: 1px solid var(--cu-error);
    border-radius: var(--cu-radius);
    background: var(--cu-error-tint);
    font-weight: 600;
    color: var(--cu-error);
}

.cu__alert p,
.cu__alert ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* The element and type are in the selector because global.css fixes text inputs at 300px wide, 40px
   high and grey, at a specificity a bare class does not beat. */
input[type="text"].cu__input,
input[type="email"].cu__input,
textarea.cu__input {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 52px;
    padding: 12px 14px;
    border: 2px solid var(--cu-line);
    border-radius: var(--cu-radius);
    background: #fff;
    font-family: inherit;
    font-size: var(--txt-sm);
    color: var(--cu-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea.cu__textarea {
    min-height: 160px;
    resize: vertical;
}

input[type="text"].cu__input:focus,
input[type="email"].cu__input:focus,
textarea.cu__input:focus {
    outline: none;
    border-color: var(--cu-brand);
    box-shadow: 0 0 0 4px rgba(30, 161, 153, 0.16);
}

input[type="text"].cu__input--error,
input[type="email"].cu__input--error,
textarea.cu__input--error {
    border-color: var(--cu-error);
}

/* ---------- Choices: topic cards and optional chips ---------- */

.cu__choices {
    display: grid;
    gap: 10px;
}

.cu__choices--chips {
    display: flex;
    flex-wrap: wrap;
}

.cu__choice {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.cu__choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cu__choice span {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 10px 16px;
    border: 2px solid var(--cu-line);
    border-radius: var(--cu-radius);
    background: #fff;
    font-size: var(--txt-sm);
    font-weight: 600;
    color: var(--cu-ink);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cu__choices--chips .cu__choice span {
    min-height: 44px;
    padding: 8px 18px;
    border-radius: 999px;
}

.cu__choice:hover span {
    border-color: var(--cu-brand);
}

.cu__choice input:checked + span {
    border-color: var(--cu-brand);
    background: var(--cu-brand-tint);
    color: var(--cu-brand-dark);
}

.cu__choice input:focus-visible + span {
    box-shadow: 0 0 0 4px rgba(30, 161, 153, 0.25);
}

/* ---------- Buttons and links ---------- */

.cu__button {
    justify-self: start;
    min-height: 52px;
    padding: 12px 32px;
    border: 2px solid var(--cu-brand);
    border-radius: var(--cu-radius);
    background: var(--cu-brand);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: var(--txt-lg);
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cu__button:hover,
.cu__button:focus-visible {
    border-color: var(--cu-brand-dark);
    background: var(--cu-brand-dark);
}

.cu__button:disabled {
    opacity: 0.6;
    cursor: default;
}

.cu__button--ghost {
    background: #fff;
    color: var(--cu-brand-dark);
}

.cu__button--ghost:hover,
.cu__button--ghost:focus-visible {
    background: var(--cu-brand-tint);
}

.cu__link,
.cu a {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: var(--txt-sm);
    font-weight: 600;
    color: var(--cu-brand-dark);
    text-decoration: underline;
    cursor: pointer;
}

.cu__link {
    justify-self: start;
    min-height: 44px;
}

.cu__sending-as {
    margin: 0;
    padding: 14px 18px;
    border-radius: var(--cu-radius);
    background: var(--cu-brand-tint);
    overflow-wrap: anywhere;
}

/* ---------- Order picker ---------- */

.cu-orders {
    display: grid;
    gap: 10px;
}

.cu-orders__item {
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--cu-line);
    border-radius: var(--cu-radius);
    background: #fff;
    font-family: inherit;
    font-size: var(--txt-sm);
    text-align: left;
    color: var(--cu-ink);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.cu-orders__item:hover,
.cu-orders__item:focus-visible {
    outline: none;
    border-color: var(--cu-brand);
    background: var(--cu-brand-tint);
}

.cu-orders__number {
    font-size: var(--txt-md);
}

.cu-orders__meta,
.cu-orders__products {
    color: var(--cu-muted);
}

.cu-orders__products {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cu-lookup {
    display: grid;
    gap: 12px;
}

.cu-order {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--cu-brand);
    border-radius: var(--cu-radius);
    background: var(--cu-brand-tint);
}

.cu-order__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.cu-order__title {
    display: block;
    font-size: var(--txt-md);
}

.cu-order__status {
    color: var(--cu-muted);
}

.cu-order__despatches,
.cu-order__lines,
.cu-product__results,
.cu-photos {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cu-order__despatches:empty {
    display: none;
}

.cu-order__lines {
    display: grid;
    gap: 6px;
}

.cu-order__lines--scroll {
    max-height: 340px;
    overflow-y: auto;
    padding-right: 6px;
}

.cu-order__line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    font-size: var(--txt-sm);
    cursor: pointer;
}

.cu-order__line input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 1px 0 0;
    accent-color: var(--cu-brand);
}

/* ---------- Product search ---------- */

.cu-product {
    position: relative;
}

.cu-product__results {
    position: absolute;
    z-index: 5;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--cu-line);
    border-radius: var(--cu-radius);
    background: #fff;
    box-shadow: 0 8px 24px rgba(38, 50, 56, 0.14);
}

.cu-product__result {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: var(--txt-sm);
    text-align: left;
    color: var(--cu-ink);
    cursor: pointer;
}

.cu-product__result:hover,
.cu-product__result:focus-visible {
    outline: none;
    background: var(--cu-brand-tint);
}

.cu-product__chosen {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 6px 16px;
    border: 2px solid var(--cu-brand);
    border-radius: var(--cu-radius);
    background: var(--cu-brand-tint);
    font-weight: 600;
}

/* ---------- Photos ---------- */

.cu__file {
    max-width: 100%;
    font-family: inherit;
    font-size: var(--txt-sm);
}

.cu-photos {
    display: grid;
    gap: 10px;
}

.cu-photos:empty {
    display: none;
}

.cu-photos__item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cu-photos__thumb {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    object-fit: cover;
}

.cu-photos__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Thank-you ---------- */

.cu-thanks {
    padding: 28px 24px;
    border: 2px solid var(--cu-brand);
    border-radius: var(--cu-radius);
    background: var(--cu-brand-tint);
}

.cu-thanks:focus {
    outline: none;
}

.cu-thanks__title {
    margin: 0 0 10px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: var(--txt-3xl);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cu-brand-dark);
}

.cu-thanks__text {
    margin: 0 0 6px;
    font-size: var(--txt-md);
    overflow-wrap: anywhere;
}

@media (min-width: 768px) {
    .cu__pair {
        grid-template-columns: 1fr 1fr;
    }

    .cu__choices {
        grid-template-columns: 1fr 1fr;
    }

    .cu-lookup__fields {
        grid-template-columns: 1fr 1fr auto;
        align-items: end;
    }
}
