/* «Parla con un consulente» drawer (inc/consult-drawer, ST-0051). Plain CSS, no build. */

html.st-consult-open {
  overflow: hidden;
}

/* Under Select2's -overlay- lists (999999), above the bar (50), the bubble (60) and the header.
   The window sits in the middle of the screen on every size. */
.st-consult {
  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.st-consult[hidden] {
  display: none;
}

.st-consult-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 25, 26, .6);
  opacity: 0;
  transition: opacity .3s ease;
}

.st-consult-panel {
  position: relative;
  width: 100%;
  max-width: 1080px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 18px 60px rgba(24, 25, 26, .25);
  padding: 0 40px 40px;
  transform: translateY(16px) scale(.98);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
}

.st-consult.is-open .st-consult-backdrop {
  opacity: 1;
}

.st-consult.is-open .st-consult-panel {
  transform: none;
  opacity: 1;
}

.st-consult-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* Stays at the top while a long form scrolls, so «Chiudi» is always reachable. */
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  margin: 0 -40px 20px;
  padding: 32px 40px 12px;
}

.st-consult-title {
  margin: 0;
  font-size: clamp(1.266rem, 0.317vi + 1.186rem, 1.44rem);
  font-weight: 400;
  line-height: 1.25;
  color: #18191A;
}

.st-consult-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #18191A;
  border-radius: 999px;
  background: #fff;
  color: #18191A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.st-consult-close:hover {
  background: #18191A;
  color: #fff;
}

.st-consult-close svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* ST-0056: the client's three ways in («Il prossimo passo, insieme»), then the tabs. */
.st-consult-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #848484;
}

.st-consult-choose[hidden],
.st-consult-detail[hidden] {
  display: none;
}

.st-consult-lead {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.5;
  color: #5f6266;
}

.st-consult-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-consult-options li {
  display: flex;
}

.st-consult-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 24px;
  border: 1px solid #D9D9D9;
  border-radius: 16px;
  background: #fff;
  color: #18191A;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}

.st-consult-option:hover {
  border-color: #CC0F7A;
  box-shadow: 0 8px 24px rgba(24, 25, 26, .08);
}

.st-consult-option-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #FCD4EB;
  color: #CC0F7A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.st-consult-option-icon svg {
  width: 20px;
  height: 20px;
}

.st-consult-option-title {
  margin-bottom: 10px;
  font-size: clamp(1.125rem, 0.136vi + 1.091rem, 1.2rem);
  font-weight: 400;
  line-height: 1.3;
}

.st-consult-option-text {
  flex: 1 1 auto;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: #5f6266;
}

.st-consult-option-cta {
  font-size: 14px;
  font-weight: 500;
  color: #CC0F7A;
}

.st-consult-foot {
  margin: 24px 0 0;
  font-size: 14px;
  color: #5f6266;
}

.st-consult-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 16px 16px 0;
  padding: 0;
  border: 0;
  background: none;
  color: #18191A;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.st-consult-back:hover {
  color: #CC0F7A;
}

/* Tabs */
.st-consult-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: #F9FAFB;
  border: 1px solid #D9D9D9;
}

.st-consult-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #18191A;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.st-consult-tab:hover {
  background: #FCD4EB;
}

.st-consult-tab[aria-selected="true"] {
  background: #CC0F7A;
  color: #fff;
}

.st-consult-tab svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.st-consult svg.st-consult-fill {
  fill: currentColor;
}

.st-consult-close:focus-visible,
.st-consult-option:focus-visible,
.st-consult-back:focus-visible,
.st-consult-tab:focus-visible,
.st-consult-pane:focus-visible,
.st-consult-wa:focus-visible,
.st-consult a:focus-visible,
[data-st-consult]:focus-visible {
  outline: 2px solid #CC0F7A;
  outline-offset: 3px;
}

/* A tab: intro on the left, form or chat on the right (client's mockup). */
.st-consult-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 40px;
}

/* Both tabs in one cell: the panel keeps the taller one's height when switching.
   The hidden one is invisible, so it is neither seen, focused nor read. */
.st-consult-body {
  display: grid;
}

.st-consult-pane {
  grid-area: 1 / 1;
}

.st-consult-pane[hidden] {
  display: grid;
  visibility: hidden;
}

.st-consult-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #FCD4EB;
  color: #CC0F7A;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.st-consult-icon svg {
  width: 22px;
  height: 22px;
}

.st-consult-heading {
  margin: 0 0 8px;
  font-size: clamp(1.424rem, 0.553vi + 1.286rem, 1.728rem);
  font-weight: 400;
  line-height: 1.2;
  color: #18191A;
}

.st-consult-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #5f6266;
}

.st-consult-subheading {
  margin: 0 0 16px;
  font-size: clamp(1.125rem, 0.136vi + 1.091rem, 1.2rem);
  font-weight: 400;
  color: #CC0F7A;
}

/* Form: the theme styles text/email/select; the phone field is type=tel. */
.st-consult .wpcf7-form .wpcf7-form-control-wrap input[type="tel"] {
  height: 40px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid #18191A;
  padding: 0 32px;
  font: inherit;
  font-size: clamp(0.889rem, -0.101vi + 0.914rem, 0.833rem);
  color: #18191A;
}

.st-consult .wpcf7-form .wpcf7-form-control-wrap input[type="tel"]:focus {
  border-color: #CC0F7A;
  outline: 0;
  box-shadow: none;
}

.st-consult .wpcf7-form .wpcf7-form-control-wrap select {
  appearance: auto;
  padding-right: 16px;
}

.st-consult .wpcf7-form .st-consult-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5f6266;
}

.st-consult .wpcf7-form .st-consult-note a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.st-consult .wpcf7-form .st-consult-required {
  margin: 0;
  font-size: 13px;
  color: #5f6266;
}

.st-consult .wpcf7-form .st-consult-marketing .wpcf7-form-control-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.st-consult .wpcf7-form .st-consult-marketing .wpcf7-radio {
  display: inline-flex;
  gap: 16px;
  margin-top: 6px;
}

.st-consult .wpcf7-form .st-consult-marketing .wpcf7-radio > * + * {
  margin-left: 0;
}

.st-consult .wpcf7-form .st-consult-marketing label {
  margin-bottom: 0;
}

.st-consult-recaptcha {
  margin: 16px 0 0;
  font-size: 12px;
  font-style: italic;
  color: #959595;
}

.st-consult-recaptcha a {
  text-decoration: underline;
}

/* After sending */
.st-consult-done {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  border-radius: 20px;
  background: #F9FAFB;
  border: 1px solid #D9D9D9;
}

.st-consult-done[hidden] {
  display: none;
}

.st-consult-done-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #FCD4EB;
  color: #CC0F7A;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.st-consult-done-icon svg {
  width: 28px;
  height: 28px;
}

.st-consult-done-title {
  margin: 0 0 8px;
  font-size: clamp(1.266rem, 0.317vi + 1.186rem, 1.44rem);
  font-weight: 400;
  color: #18191A;
}

.st-consult-done-title:focus {
  outline: none;
}

.st-consult-done-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #18191A;
}

.st-consult-number {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.602rem, 0.858vi + 1.387rem, 2.074rem);
  font-weight: 400 !important;
  color: #CC0F7A;
  letter-spacing: .01em;
}

/* WhatsApp tab */
.st-consult-wa {
  margin-top: 24px;
  gap: 10px;
}

.st-consult-wa svg {
  width: 18px;
  height: 18px;
}

.st-consult-wa-number {
  margin: 12px 0 0;
  font-size: 14px;
  color: #5f6266;
}

@media (max-width: 1023px) {
  .st-consult-panel {
    padding: 0 24px 24px;
  }

  .st-consult-head {
    margin: 0 -24px 16px;
    padding: 24px 24px 12px;
  }

  .st-consult-pane {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 20px;
  }

  /* One column: the form tab is much taller than the WhatsApp one, so each tab
     takes its own height instead of leaving a big empty space under WhatsApp. */
  .st-consult-pane[hidden] {
    display: none;
  }

  .st-consult-intro {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 14px;
    align-items: center;
  }

  .st-consult-icon {
    grid-row: span 2;
    margin-bottom: 0;
  }

  .st-consult-heading {
    margin-bottom: 2px;
  }
}

/* Phone: the same centred card, a small margin all round, one column, compact. */
@media (max-width: 767px) {
  .st-consult {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .st-consult-panel {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
    padding: 0 16px 20px;
  }

  .st-consult-head {
    margin: 0 -16px 12px;
    padding: 16px 16px 10px;
  }

  .st-consult-tabs {
    display: flex;
    margin-bottom: 16px;
  }

  .st-consult-tab {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
    padding: 0 10px;
    white-space: nowrap;
  }

  .st-consult-pane {
    gap: 16px;
  }

  /* With tabs, the pane's heading and icon only repeat the tab: keep the one-line text. */
  .st-consult-tabs ~ .st-consult-body .st-consult-icon,
  .st-consult-tabs ~ .st-consult-body .st-consult-heading {
    display: none;
  }

  .st-consult-tabs ~ .st-consult-body .st-consult-intro {
    display: block;
  }

  .st-consult-subheading {
    margin-bottom: 12px;
  }
  .st-consult-lead {
    margin-bottom: 16px;
    font-size: 15px;
  }
  .st-consult-options {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .st-consult-option {
    padding: 16px;
  }
  .st-consult-option-icon {
    margin-bottom: 12px;
  }
  .st-consult-option-text {
    margin-bottom: 12px;
  }
  .st-consult-foot {
    margin-top: 16px;
  }

  .st-consult .wpcf7-form .grid {
    row-gap: 16px;
  }

  /* 16px text, so iPhones do not zoom in when a field gets the focus. */
  .st-consult .wpcf7-form .wpcf7-form-control-wrap input:not([type="checkbox"]):not([type="radio"]),
  .st-consult .wpcf7-form .wpcf7-form-control-wrap select {
    height: 44px;
    padding-left: 16px;
    font-size: 16px;
  }

  .st-consult .wpcf7-form .st-consult-submit input[type="submit"] {
    width: 100%;
    height: 48px;
  }

  .st-consult-done {
    padding: 20px;
  }

  .st-consult-wa {
    width: 100%;
    justify-content: center;
  }
}

/* Small phones (320–374px): both tab labels still fit on one line. */
@media (max-width: 374px) {
  .st-consult-title {
    font-size: 1.125rem;
  }

  .st-consult-tab {
    gap: 6px;
    padding: 0 6px;
    font-size: 13px;
  }

  .st-consult-tab svg {
    width: 16px;
    height: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .st-consult-backdrop,
  .st-consult-panel {
    transition: none;
  }
}
