/* MC Date Picker — controllo data custom, zero librerie, funziona su iOS/Android/desktop */

.mc-dp {
  position: relative;
  min-width: 0;
}

.mc-dp__trigger {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-size: 16px;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(26, 28, 30, 0.22);
  border-radius: 0.3rem;
  background: #fff;
  color: #1a1c1e;
  font-family: Inter, system-ui, sans-serif;
  height: 2.5rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.mc-dp__trigger:hover {
  border-color: rgba(26, 28, 30, 0.32);
}

.mc-dp__trigger:focus,
.mc-dp__trigger.is-open {
  outline: none;
  border-color: #c9a96e;
  box-shadow: 0 0 0 2px rgba(201, 169, 110, 0.2);
}

.mc-dp__value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-dp__value--placeholder {
  color: #94918c;
}

.mc-dp__icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: #c9a96e;
  opacity: 0.85;
}

.mc-dp__popup {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 10060;
  background: #fff;
  border: 1px solid rgba(26, 28, 30, 0.1);
  border-radius: 0.5rem;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.16);
  padding: 0.7rem 0.65rem 0.65rem;
  width: 18rem;
  max-width: calc(100vw - 1.2rem);
  font-family: Inter, system-ui, sans-serif;
  color: #1a1c1e;
}

.mc-dp__popup[hidden] {
  display: none;
}

.mc-dp__popup--right {
  left: auto;
  right: 0;
}

.mc-dp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.mc-dp__nav {
  appearance: none;
  -webkit-appearance: none;
  background: #faf9f7;
  border: 1px solid rgba(26, 28, 30, 0.1);
  border-radius: 0.3rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 1rem;
  color: #1a1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.mc-dp__nav:hover {
  background: #f1ede4;
  border-color: rgba(201, 169, 110, 0.45);
}

.mc-dp__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mc-dp__title {
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex: 1 1 auto;
  text-align: center;
}

.mc-dp__dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.1rem;
  margin-bottom: 0.25rem;
}

.mc-dp__dow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #6a655d;
  text-align: center;
  padding: 0.25rem 0;
  text-transform: uppercase;
}

.mc-dp__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
}

.mc-dp__day {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.3rem;
  font-size: 0.85rem;
  color: #1a1c1e;
  padding: 0.45rem 0;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  text-align: center;
}

.mc-dp__day:hover {
  background: rgba(201, 169, 110, 0.18);
}

.mc-dp__day.is-other {
  color: #c2bfba;
  cursor: default;
}

.mc-dp__day.is-other:hover {
  background: transparent;
}

.mc-dp__day.is-disabled {
  color: #cfccc6;
  cursor: not-allowed;
}

.mc-dp__day.is-disabled:hover {
  background: transparent;
}

.mc-dp__day.is-today {
  border-color: #c9a96e;
}

.mc-dp__day.is-selected,
.mc-dp__day.is-selected:hover {
  background: #c9a96e;
  color: #1a1c1e;
  border-color: #b89660;
  font-weight: 600;
}

.mc-dp__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(26, 28, 30, 0.06);
}

.mc-dp__btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: #1a1c1e;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  border-radius: 0.25rem;
  font-family: inherit;
}

.mc-dp__btn:hover {
  background: #f1ede4;
}

.mc-dp__btn--primary {
  background: #1a1c1e;
  color: #fff;
}

.mc-dp__btn--primary:hover {
  background: #000;
}

/* Sotto .quote-modal (10040) e #request (10045): altrimenti su mobile lo scrim copre il modal
   e il calendario nel form lead non riceve tap (giorni “spenti” / non cliccabili). */
.mc-dp__scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 10025;
  display: none;
}

.mc-dp__scrim.is-active {
  display: block;
}

@media (max-width: 520px) {
  .mc-dp__popup {
    position: fixed;
    left: 50%;
    top: auto;
    bottom: 1rem;
    transform: translateX(-50%);
    width: min(20rem, calc(100vw - 1.5rem));
    max-width: none;
    border-radius: 0.6rem;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.22);
  }

  .mc-dp__popup--right {
    right: auto;
  }
}
