#contact {
    --contact-line: var(--sv2-line, color-mix(in srgb, currentColor 20%, transparent));
    --contact-surface: var(--sv2-surface, color-mix(in srgb, currentColor 4%, transparent));
    --contact-tint: color-mix(in srgb, currentColor 8%, transparent);
    padding-block: clamp(28px, 5vw, 64px);
}

#contact [hidden] { display: none !important; }

.webshop-contact-shell {
    container: webshop-contact / inline-size;
    max-width: 1060px;
    margin-inline: auto;
}

.webshop-contact-heading { text-align: center; }
body:not(.webshop-v2) #contact .webshop-contact-heading { background: transparent; color: inherit; }

#contact .webshop-contact-heading h2 {
    margin: 0 0 clamp(16px, 3vw, 28px);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
    letter-spacing: -.025em;
}

#contact .webshop-contact-heading .separeteurPerso {
    max-width: 100%;
    max-height: 44px;
    margin: 0 auto 16px;
}

.webshop-contact-layout {
    display: grid;
    gap: 14px;
    max-width: 650px;
    margin-inline: auto;
}

.webshop-contact-layout.has-contact-history { max-width: none; }

#contact .webshop-contact-compose,
#contact .webshop-contact-history {
    min-width: 0;
    margin: 0;
    padding: clamp(14px, 2.5vw, 24px);
    border: 1px solid var(--contact-line);
    border-radius: 14px;
    background: var(--sv2-paper, transparent);
    overflow-wrap: anywhere;
}

.webshop-contact-compose-title { display: none; }
.has-contact-history .webshop-contact-compose-title { display: block; }

#contact :is(.webshop-contact-compose-title, .webshop-contact-history-heading h3) {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
}

#contact .webshop-contact-compose .webshop-contact-compose-title { margin-bottom: 14px; }

.webshop-contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.webshop-contact-field-wide { grid-column: 1 / -1; }

#contact label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 650;
}

#contact .form-control {
    min-height: 44px;
    height: auto;
    padding: 10px 12px;
    border: 1px solid var(--contact-line);
    border-radius: 8px;
    background: var(--contact-surface);
    color: inherit;
    font-size: 16px;
    line-height: 1.4;
}

#contact .form-control[readonly] { background: var(--contact-tint); }
#contact .form-control:focus { border-color: currentColor; box-shadow: none; }
#contact textarea.form-control { min-height: 104px; resize: vertical; }
#contact [data-contact-reply] textarea { min-height: 68px; }
#contact .help-block:empty { display: none; }
#contact .help-block:not(:empty) { margin: 4px 0 0; }

.webshop-contact-send,
.webshop-contact-history-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.webshop-contact-send { margin-top: 14px; }
.webshop-contact-history-heading { justify-content: space-between; }

#contact .btn {
    max-width: 100%;
    min-height: 44px;
    padding: 8px 13px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
}

#contact .webshop-contact-secondary {
    border: 1px solid var(--contact-line);
    background: transparent;
    color: inherit;
}

#contact .webshop-contact-secondary:hover { background: var(--contact-tint); }
#contact :is(.btn, summary, [data-contact-messages]):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

#contact :is(#success, [data-contact-status], .webshop-contact-preview-note) { margin: 0; font-size: 13px; }
#contact .webshop-contact-preview-note { margin-top: 10px; }
#contact [data-contact-status]:not(:empty) { margin-top: 8px; }
#contact #success.contact-form-error { font-weight: 650; }

.webshop-contact-signin { margin: 0; font-size: 14px; }
.webshop-contact-signin summary { cursor: pointer; width: fit-content; max-width: 100%; }
.webshop-contact-signin a { color: inherit; text-decoration: underline; }
.webshop-contact-signin form { margin-top: 10px; }
.webshop-contact-signin form .btn { margin-top: 8px; }

#contact :is([data-contact-threads], [data-contact-messages]) {
    list-style: none;
    padding: 0;
    margin: 0;
}

#contact [data-contact-list] { margin-top: 12px; }
#contact [data-contact-threads] { display: grid; gap: 5px; max-height: 166px; overflow: auto; }
#contact [data-contact-threads] button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: baseline;
    column-gap: 8px;
    width: 100%;
    text-align: start;
}

#contact [data-contact-threads] button > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#contact [data-contact-threads] time { white-space: nowrap; }

#contact [data-contact-threads] button[aria-current="true"] {
    border-color: currentColor;
    background: var(--contact-tint);
    font-weight: 650;
}

#contact [data-contact-threads] button:focus-visible { outline-offset: -3px; }
#contact [data-contact-more] { margin-top: 8px; }

#contact [data-contact-thread] {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--contact-line);
}

#contact [data-contact-subject] { margin: 0 0 8px; font-size: 15px; line-height: 1.4; }
#contact [data-contact-older] { margin-bottom: 8px; }

#contact [data-contact-messages] {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    max-height: clamp(155px, 40dvh, 360px);
    overflow: auto;
    overscroll-behavior-y: contain;
}

#contact [data-contact-messages] > li {
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--contact-line);
    border-radius: 10px 10px 10px 3px;
    background: var(--contact-surface);
    font-size: 14px;
    line-height: 1.45;
}

#contact [data-contact-messages] > li[data-direction="inbox"] {
    border-radius: 10px 10px 3px 10px;
    background: var(--contact-tint);
}

#contact .webshop-contact-history time { font-size: 12px; font-weight: 400; }
#contact [data-contact-messages] time { display: inline-block; margin-inline-start: 8px; }
#contact :is(.webshop-contact-message-text, .webshop-contact-mail-body) { margin-top: 3px; }
#contact .webshop-contact-message-text { white-space: pre-wrap; }
#contact .webshop-contact-mail-body :is(p, ul, ol, blockquote, pre, table) { margin: 0 0 0.65em; font-size: inherit; line-height: inherit; }
#contact .webshop-contact-mail-body > :last-child { margin-bottom: 0; }
#contact .webshop-contact-mail-body table { width: 100%; table-layout: fixed; }
#contact .webshop-contact-mail-body :is(th, td) { padding: 4px; border: 1px solid var(--contact-line); }
#contact .webshop-contact-mail-body pre { white-space: pre-wrap; }
#contact .webshop-contact-mail-body a { text-decoration: underline; }
#contact .webshop-contact-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#contact .webshop-contact-attachments .btn { padding-inline: 10px; text-align: start; }
#contact .webshop-contact-attachments .btn::before { content: "↓"; margin-inline-end: .45em; }
#contact [data-contact-reply] { margin-top: 12px; }
#contact [data-contact-reply] .btn { margin-top: 7px; }

#sv2-contact-dialog > .modal-dialog { width: min(720px, 100%); }
#sv2-contact-dialog:has(.has-contact-history) > .modal-dialog { width: min(1130px, 100%); }
#sv2-contact-dialog .modal-content { border-radius: 14px; }
#sv2-contact-dialog .sv2-section-dialog-body { padding: 0 clamp(12px, 3vw, 32px) clamp(14px, 3vw, 28px); }
#sv2-contact-dialog #contact { padding: 0; }
#sv2-contact-dialog #contact > .container { padding-inline: 0; }

@container webshop-contact (min-width: 760px) {
    .webshop-contact-layout.has-contact-history {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: start;
        gap: 18px;
    }
    #contact [data-contact-compose] { display: none; }
}

@container webshop-contact (max-width: 410px) {
    .webshop-contact-fields { grid-template-columns: minmax(0, 1fr); }
}
