/* Contact dialog shared by the kit landing and the kit PDP.
   Deliberately its own file: it loads on two very different templates, and
   folding it into terrace-kits.css would drag the whole landing stylesheet onto
   pages that only need the form. */

/* The page behind is deliberately left scrollable. Locking body meant replacing
   Woodmart's own overflow-x and turning body into a scroll container, and the
   related-products carousel below re-measured itself into a tall empty gap that
   only went away when the dialog closed. `overscroll-behavior` keeps the wheel
   inside the dialog, which is the part that actually mattered. */
.mds-kc__overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgb(24 18 14 / 55%);
  overscroll-behavior: contain;
}

.mds-kc__box {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  /* Never taller than the screen: the form itself scrolls instead of running off
     the top and bottom, where its own submit button becomes unreachable. */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 60px rgb(0 0 0 / 25%);
  color: #1c1f24;
  font-size: 15px;
  line-height: 1.5;
}

/* Only the contents scroll, so the close control stays put. */
.mds-kc__scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 24px 24px;
}

/* Every button rule below carries the element name on purpose. Woodmart styles
   buttons through `:is(.btn, .button, button, …)` — one class of specificity,
   a tie with a bare class here, and its stylesheet loads later, so it wins the
   tie. Without `button.` the close control lost its absolute position and came
   back as a grey box on the wrong side of the dialog. */
button.mds-kc__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #8a8f98;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

button.mds-kc__close:hover,
button.mds-kc__close:focus-visible {
  background: #f0f1ef;
  color: #1c1f24;
}

.mds-kc__title {
  margin: 0 44px 6px 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
}

.mds-kc__lead {
  margin: 0 0 14px;
  color: #61666e;
  font-size: 14px;
}

.mds-kc__context {
  margin: 0 0 16px;
  padding: 9px 11px;
  border-left: 2px solid #e06132;
  background: #faf8f7;
  color: #3a3f47;
  font-size: 13px;
}

.mds-kc__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mds-kc__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #3a3f47;
  font-size: 13px;
  font-weight: 600;
}

.mds-kc__label {
  display: block;
}

.mds-kc__hint {
  color: #8a8f98;
  font-style: normal;
  font-weight: 400;
}

.mds-kc__field input[type="text"],
.mds-kc__field input[type="email"],
.mds-kc__field input[type="tel"],
.mds-kc__field textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #d6dad7;
  border-radius: 8px;
  background: #fff;
  color: #1c1f24;
  font: inherit;
  font-weight: 400;
}

.mds-kc__field input:focus-visible,
.mds-kc__field textarea:focus-visible {
  border-color: #e06132;
  outline: 2px solid rgb(224 97 50 / 25%);
  outline-offset: 0;
}

.mds-kc__field textarea {
  resize: vertical;
  min-height: 88px;
}

.mds-kc__drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 12px;
  border: 1px dashed #c3c9c5;
  border-radius: 9px;
  background: #fbfcfb;
  color: #61666e;
  font-size: 13px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.mds-kc__drop:hover,
.mds-kc__drop:focus-within {
  border-color: #e06132;
  background: #faf6f4;
}

.mds-kc__drop.is-dragover {
  border-color: #e06132;
  border-style: solid;
  background: #f7ece7;
  color: #1c1f24;
}

.mds-kc__dropStrong {
  color: #1c1f24;
  font-weight: 600;
}

.mds-kc__dropHint {
  font-size: 12px;
}

/* The real input stays in the accessibility tree — the zone is a label for it,
   so keyboard and screen readers get the ordinary file control. */
.mds-kc__fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.mds-kc__files {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mds-kc__file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: #f3f4f2;
  font-size: 13px;
}

.mds-kc__fileName {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mds-kc__fileSize {
  color: #8a8f98;
  white-space: nowrap;
}

button.mds-kc__fileRemove {
  min-width: 0;
  min-height: 0;
  padding: 0 4px;
  border: 0;
  background: none;
  color: #8a8f98;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

button.mds-kc__fileRemove:hover,
button.mds-kc__fileRemove:focus-visible {
  background: none;
  color: #8f2a22;
}

.mds-kc__fileError {
  margin: 0;
  color: #8f2a22;
  font-size: 12px;
}

.mds-kc__fileError:empty {
  display: none;
}

.mds-kc__consent {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: #61666e;
  font-size: 13px;
}

.mds-kc__consent input {
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: #e06132;
}

.mds-kc__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0%;
}

.mds-kc__status {
  margin: 0;
  font-size: 13px;
}

.mds-kc__status:empty {
  display: none;
}

.mds-kc__status.is-error {
  color: #8f2a22;
}

button.mds-kc__submit {
  width: 100%;
  min-height: 0;
  padding: 11px 16px;
  border: 0;
  border-radius: 9px;
  background: #1c1f24;
  color: #fff;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  text-align: center;
  text-transform: none;
  cursor: pointer;
}

button.mds-kc__submit:hover:not(:disabled),
button.mds-kc__submit:focus-visible:not(:disabled) {
  background: #31231a;
  color: #fff;
}

button.mds-kc__submit:disabled {
  opacity: 60%;
  cursor: default;
}

@media (max-width: 480px) {
  .mds-kc__overlay {
    padding: 0;
    align-items: flex-end;
  }

  .mds-kc__box {
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px 14px 0 0;
  }
}
