
:root {
  --dp-primary: #087f8c;
  --dp-primary-dark: #066873;
  --dp-primary-light: #e8f6f6;
  --dp-hover: #e0f2f3;
  --dp-text: #1e293b;
  --dp-text-secondary: #475569;
  --dp-muted: #64748b;
  --dp-border: #cbd5e1;
  --dp-border-light: #e2e8f0;
  --dp-disabled: #cbd5e1;
  --dp-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
}

/* ── Container / Wrapper ── */
.custom-datepicker,
.booking-dates {
  position: relative;
  width: 100%;
}

.custom-datepicker .date-grid,
.booking-dates .date-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* ── Date Trigger Button ── */
.date-trigger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid var(--dp-border);
  border-radius: 8px;
  background: #fff;
  color: var(--dp-text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.date-trigger:hover,
.date-trigger[aria-expanded="true"] {
  border-color: var(--dp-primary);
  background: #f7fdfd;
}

.date-trigger:focus-visible {
  outline: 2px solid var(--dp-primary);
  outline-offset: 1px;
}

.date-trigger-label {
  color: var(--dp-muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.2px;
}

.date-trigger strong,
.date-trigger .date-trigger-display {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--dp-text);
}

.date-trigger .date-nights {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dp-primary-dark);
  background: var(--dp-primary-light);
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ── Calendar Popup Dropdown ── */
.booking-calendar,
.datepicker-calendar {
  position: absolute;
  z-index: 99;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  max-width: 335px;
  margin: 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--dp-border-light);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--dp-shadow);
  user-select: none;
}

.booking-calendar[hidden],
.datepicker-calendar[hidden] {
  display: none !important;
}

/* ── Header Intro ── */
.datepicker-calendar.has-time {
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.calendar-times {
  margin-top: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--dp-border-light);
}

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

.calendar-duration-fields .ui-select {
  width: 100%;
}

.calendar-duration-fields .ui-select__menu {
  top: auto;
  bottom: calc(100% + 6px);
  max-height: 220px;
}

.calendar-time-fields {
  display: grid;
}

.calendar-time-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 9px 0;
}

.calendar-time-field + .calendar-time-field {
  border-top: 1px solid #f1f5f9;
}

.calendar-time-caption {
  display: grid;
  gap: 3px;
  color: var(--dp-muted);
  font-size: 11px;
}

.calendar-time-caption strong {
  color: var(--dp-text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.calendar-time-control {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 5px;
  border: 1px solid var(--dp-border-light);
  border-radius: 9px;
  background: #f8fafc;
  color: var(--dp-text);
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}

.calendar-time-control:focus-within {
  border-color: var(--dp-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--dp-primary-light);
}

.calendar-time-control input {
  appearance: none;
  width: 30px;
  min-height: 36px;
  padding: 0 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-align: center;
  cursor: text;
}

.calendar-time-control input:hover {
  background: var(--dp-primary-light);
}

.calendar-time-control input:focus-visible,
.calendar-apply:focus-visible {
  outline: 2px solid var(--dp-primary);
  outline-offset: 1px;
}

.calendar-time-segment {
  display: flex;
  align-items: center;
}

.calendar-time-stepper {
  display: grid;
  gap: 1px;
  padding-right: 2px;
}

.calendar-time-stepper button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 17px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--dp-muted);
  cursor: pointer;
}

.calendar-time-stepper button:hover {
  background: var(--dp-primary-light);
  color: var(--dp-primary-dark);
}

.calendar-time-stepper button:focus-visible {
  outline: 2px solid var(--dp-primary);
  outline-offset: 1px;
}

.calendar-time-stepper svg {
  width: 8px;
  height: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calendar-time-control input[aria-invalid="true"] {
  color: #b42318;
}

.calendar-time-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  padding-top: 10px;
  border-top: 1px solid var(--dp-border-light);
}

.calendar-duration {
  min-width: 0;
  margin: 4px 0 10px;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--dp-border-light);
}

.calendar-duration legend {
  float: none;
  width: auto;
  margin: 0 0 8px;
  padding: 0;
  color: var(--dp-muted);
  font-size: 11px;
  line-height: 1.4;
}

.calendar-duration-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.calendar-duration-options button {
  min-height: 36px;
  padding: 4px 0;
  border: 1px solid var(--dp-border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--dp-text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.calendar-duration-options button span {
  font-size: 10px;
  font-weight: 500;
}

.calendar-duration-options button:hover {
  border-color: var(--dp-primary);
  background: var(--dp-primary-light);
}

.calendar-duration-options button[aria-pressed="true"] {
  border-color: var(--dp-primary);
  background: var(--dp-primary);
  color: #fff;
}

.calendar-duration-options button:focus-visible {
  outline: 2px solid var(--dp-primary);
  outline-offset: 2px;
}

.calendar-time-status {
  margin: 0;
  color: var(--dp-muted);
  font-size: 11px;
  line-height: 1.45;
}

.calendar-time-status.is-error {
  color: #b42318;
}

.calendar-apply {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--dp-primary);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.calendar-apply:hover:not(:disabled) {
  background: var(--dp-primary-dark);
}

.calendar-apply:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.calendar-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}

.calendar-intro strong,
.calendar-intro .calendar-intro-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dp-text);
}

.calendar-close {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dp-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}

.calendar-close:hover {
  background: #f1f5f9;
  color: var(--dp-text);
}

/* ── Month Navigation ── */
.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.calendar-navigation strong,
.calendar-navigation .calendar-month-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dp-text);
}

.calendar-navigation button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--dp-border-light);
  border-radius: 6px;
  background: #fff;
  color: var(--dp-text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}

.calendar-navigation button:hover:not(:disabled) {
  border-color: var(--dp-primary);
  background: var(--dp-primary-light);
  color: var(--dp-primary-dark);
}

.calendar-navigation button:disabled {
  color: var(--dp-disabled);
  border-color: #f8fafc;
  background: #f8fafc;
  cursor: default;
}

/* ── Days Grid & Weekdays ── */
.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.calendar-weekdays {
  gap: 4px;
  margin-bottom: 6px;
  color: var(--dp-muted);
  font-size: 11px;
  font-weight: 600;
}

.calendar-weekdays span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
}

.calendar-days {
  gap: 4px;
}

.calendar-day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--dp-text);
  font: inherit;
  font-size: 12px !important;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}

.calendar-day.in-range {
  border-radius: 4px;
  background: var(--dp-primary-light);
  color: var(--dp-primary-dark);
  font-weight: 600;
}

.calendar-day.is-today::after {
  position: absolute;
  bottom: 3px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: '';
}

.calendar-day:hover:not(:disabled) {
  background: var(--dp-hover);
}

.calendar-day.is-start,
.calendar-day.is-end,
.calendar-day.is-selected {
  background: var(--dp-primary) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 6px !important;
  box-shadow: 0 2px 6px rgba(8, 127, 140, 0.3);
}

.calendar-day:disabled {
  color: var(--dp-disabled);
  background: transparent;
  cursor: default;
}

/* ── Responsive Mobile ── */
@media (max-width: 600px) {
  .booking-calendar,
  .datepicker-calendar {
    position: static;
    margin-top: 8px;
    padding: 10px 12px;
    max-width: 100%;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  }

  .calendar-day {
    height: 34px;
  }

  .date-trigger {
    padding: 9px 11px;
  }

  .date-trigger strong,
  .date-trigger .date-trigger-display {
    font-size: 13.5px;
  }
}
