/* Casa Arequipa direct booking. CSS-only integration contract:
 * MAIN supplies PHP/JS and real copy; native dates/select work before enhancement.
 * Honor [hidden]. The calendar is a native showModal() dialog, not a div overlay.
 * Hero/WhatsApp changes below are limited to the booking-enabled home body.
 */
body.casa-booking-home #section-113-10 {
  position: relative;
}

body.casa-booking-home #section-113-10 #carrusel-hero [data-id='div_block-19-10'] {
  box-sizing: border-box;
  padding-top: 135px;
  padding-bottom: 170px;
}

#casa-direct-booking.casa-booking {
  --casa-booking-cream: #faf7f2;
  --casa-booking-plum: #8a346c;
  --casa-booking-gold: #d1a869;
  --casa-booking-ink: #302631;
  --casa-booking-muted: #655860;
  --casa-booking-line: #d8cdd1;
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: calc(100% - 64px);
  max-width: 1120px;
  margin: 0;
  padding: 22px 28px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--casa-booking-cream);
  box-shadow: 0 12px 40px rgba(27, 15, 24, .24);
  color: var(--casa-booking-ink);
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
}

#casa-direct-booking,
#casa-direct-booking *,
#casa-direct-booking *::before,
#casa-direct-booking *::after,
body.casa-booking-home .casa-booking__mobile-bar,
body.casa-booking-home .casa-booking__mobile-bar * {
  box-sizing: border-box;
}

#casa-direct-booking [hidden],
body.casa-booking-home .casa-booking__mobile-bar[hidden] {
  display: none !important;
}

#casa-direct-booking :where(h2, h3, h4, p, form) {
  margin: 0;
  color: inherit;
}

#casa-direct-booking :where(h2, h3, h4, p, label, button, output) {
  overflow-wrap: anywhere;
}

#casa-direct-booking :where(button, input, select) {
  margin: 0;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
}

#casa-direct-booking button {
  cursor: pointer;
}

#casa-direct-booking svg {
  display: inline-block;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

#casa-direct-booking .casa-booking__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 16px;
}

#casa-direct-booking #casa-booking-title {
  margin: 0;
  color: var(--casa-booking-ink);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.02em;
}

#casa-direct-booking .casa-booking__heading p {
  max-width: 48ch;
  color: var(--casa-booking-muted);
  font-size: 15px;
  line-height: 1.4;
}

#casa-direct-booking #casa-booking-form {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
}

#casa-direct-booking .casa-booking__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(150px, .85fr) minmax(160px, 1fr);
  align-items: end;
  gap: 16px;
}

#casa-direct-booking .casa-booking__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#casa-direct-booking .casa-booking__field > label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  color: var(--casa-booking-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

#casa-direct-booking :where(.casa-booking__native-date, .casa-booking__date-trigger, .casa-booking__guest-select) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--casa-booking-line);
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
  color: var(--casa-booking-ink);
  font-size: 16px;
  line-height: 24px;
  text-align: left;
  color-scheme: light;
}

#casa-direct-booking .casa-booking__native-date {
  appearance: auto;
  font-variant-numeric: tabular-nums;
}

#casa-direct-booking .casa-booking__native-date::-webkit-date-and-time-value {
  min-height: 24px;
  text-align: left;
}

#casa-direct-booking .casa-booking__native-date::-webkit-datetime-edit {
  padding: 0;
}

#casa-direct-booking .casa-booking__date-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#casa-direct-booking .casa-booking__date-trigger [data-date-label] {
  min-width: 0;
}

#casa-direct-booking .casa-booking__date-trigger svg {
  width: 16px;
  height: 16px;
  color: var(--casa-booking-plum);
}

#casa-direct-booking .casa-booking__guest-select {
  appearance: auto;
}

#casa-direct-booking .casa-booking__guest-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 1px;
  border: 1px solid var(--casa-booking-line);
  border-radius: 6px;
  background: #fff;
}

#casa-direct-booking .casa-booking__guest-stepper button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--casa-booking-plum);
  font-size: 22px;
  line-height: 1;
}

#casa-direct-booking .casa-booking__guest-stepper output {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 2px;
  color: var(--casa-booking-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#casa-direct-booking :where(.casa-booking__submit, .casa-date__apply) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--casa-booking-plum);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  text-decoration: none;
}

#casa-direct-booking .casa-booking__submit {
  width: 100%;
  align-self: end;
}

#casa-direct-booking :where(.casa-booking__submit, .casa-date__apply):hover:not(:disabled) {
  background: #702655;
  color: #fff;
}

#casa-direct-booking :where(.casa-booking__date-trigger, .casa-booking__guest-stepper button):hover:not(:disabled) {
  background: #f2e8ee;
}

#casa-direct-booking .casa-booking__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 20px;
  margin-top: 12px;
  color: var(--casa-booking-muted);
  font-size: 14px;
  line-height: 1.4;
}

#casa-direct-booking :where(.casa-booking__summary, .casa-booking__provider) {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

#casa-direct-booking .casa-booking__summary {
  color: var(--casa-booking-ink);
}

#casa-direct-booking .casa-booking__provider {
  color: var(--casa-booking-muted);
}

#casa-direct-booking .casa-booking__error {
  margin-top: 10px;
  color: #9b233c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

#casa-direct-booking [aria-invalid='true'] {
  border-color: #9b233c;
}

#casa-direct-booking :where(button, input, select, a, [tabindex]):focus-visible,
body.casa-booking-home .casa-booking__mobile-bar :where(button, a):focus-visible {
  outline: 3px solid #8a346c;
  outline-offset: 3px;
}

#casa-direct-booking :where(.casa-booking__submit, .casa-date__apply):focus-visible,
body.casa-booking-home .casa-booking__mobile-bar :where(button, a):focus-visible {
  outline-color: #d1a869;
}

#casa-direct-booking button:disabled {
  cursor: not-allowed;
}

#casa-direct-booking :where(.casa-booking__submit, .casa-date__apply):disabled {
  background: #74626e;
  color: #fff;
}

#casa-direct-booking .casa-booking__guest-stepper button:disabled {
  color: #8b7d85;
}

#casa-direct-booking .casa-booking__sr-only,
#casa-booking-calendar .casa-date__status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Native modal: [open] alone controls visibility, including SSR/no-JS state. */
#casa-booking-calendar.casa-date {
  position: fixed;
  inset: 0;
  width: min(740px, calc(100% - 32px));
  max-width: none;
  height: fit-content;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 16px;
  background: #faf7f2;
  box-shadow: 0 20px 64px rgba(27, 15, 24, .28);
  color: #302631;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  color-scheme: light;
  scrollbar-width: thin;
  scrollbar-color: #8a346c #eee5e9;
}

#casa-booking-calendar.casa-date:not([open]) {
  display: none !important;
}

#casa-booking-calendar.casa-date[open] {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
}

#casa-booking-calendar.casa-date::backdrop {
  background: rgba(24, 16, 23, .25);
}

#casa-booking-calendar .casa-date__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
}

#casa-booking-calendar .casa-date__header h3 {
  margin: 0;
  color: #302631;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.02em;
}

#casa-booking-calendar :where(.casa-date__close, .casa-date__navigation button) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #d8cdd1;
  border-radius: 6px;
  background: #fff;
  color: #8a346c;
  line-height: 1;
}

#casa-booking-calendar :where(.casa-date__close, .casa-date__navigation button):hover:not(:disabled) {
  background: #f2e8ee;
}

#casa-booking-calendar .casa-date__hint {
  margin: 8px 0 16px;
  color: #655860;
  font-size: 15px;
  line-height: 1.4;
}

#casa-booking-calendar .casa-date__range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

#casa-booking-calendar .casa-date__range button {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid #d8cdd1;
  border-radius: 6px;
  background: #fff;
  color: #302631;
  text-align: left;
}

#casa-booking-calendar .casa-date__range button span {
  color: #655860;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}

#casa-booking-calendar .casa-date__range button strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

#casa-booking-calendar .casa-date__range button.is-active {
  border-color: #8a346c;
  background: #f2e8ee;
  box-shadow: inset 0 0 0 1px #8a346c;
}

#casa-booking-calendar .casa-date__navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#casa-booking-calendar [data-view-label] {
  min-width: 0;
  color: #302631;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

#casa-booking-calendar .casa-date__months {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 24px;
  min-width: 0;
}

#casa-booking-calendar .casa-date__month {
  min-width: 0;
  margin: 0;
  padding: 0;
}

#casa-booking-calendar .casa-date__month h4 {
  margin: 0 0 12px;
  color: #302631;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
}

#casa-booking-calendar .casa-date__table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  table-layout: fixed;
  color: #302631;
  font-variant-numeric: tabular-nums;
}

#casa-booking-calendar .casa-date__table :where(th, td) {
  width: calc(100% / 7);
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  vertical-align: middle;
}

#casa-booking-calendar .casa-date__table th {
  height: 32px;
  color: #655860;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

#casa-booking-calendar .casa-date__table td {
  height: 44px;
}

#casa-booking-calendar .casa-date__day {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #302631;
  font-family: 'Roboto Condensed', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#casa-booking-calendar .casa-date__day.is-in-range,
#casa-booking-calendar td.is-in-range .casa-date__day {
  background: rgba(138, 52, 108, .10);
  color: #60234b;
}

#casa-booking-calendar .casa-date__day.is-preview,
#casa-booking-calendar td.is-preview .casa-date__day {
  background: rgba(138, 52, 108, .10);
  color: #60234b;
  box-shadow: inset 0 -2px 0 #8a346c;
}

#casa-booking-calendar .casa-date__day.is-today,
#casa-booking-calendar td.is-today .casa-date__day {
  outline: 1px solid #8a346c;
  outline-offset: -4px;
}

#casa-booking-calendar .casa-date__day:hover:not(:disabled):not(.is-start):not(.is-end) {
  background: #e7d3df;
  color: #60234b;
}

#casa-booking-calendar .casa-date__day:is(.is-start, .is-end),
#casa-booking-calendar td:is(.is-start, .is-end) .casa-date__day {
  border-radius: 6px;
  background: #8a346c;
  color: #fff;
  font-weight: 700;
  box-shadow: none;
}

#casa-booking-calendar .casa-date__day:disabled {
  background: transparent;
  color: #9a8e96;
  text-decoration: none;
  cursor: not-allowed;
}

#casa-booking-calendar .casa-date__day:focus-visible {
  z-index: 1;
  outline: 3px solid #8a346c;
  outline-offset: -3px;
}

#casa-booking-calendar .casa-date__day:is(.is-start, .is-end):focus-visible,
#casa-booking-calendar td:is(.is-start, .is-end) .casa-date__day:focus-visible {
  outline-color: #d1a869;
}

#casa-booking-calendar .casa-date__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #d8cdd1;
}

#casa-booking-calendar [data-calendar-summary] {
  flex: 1 1 220px;
  margin: 0;
  color: #655860;
  font-size: 14px;
  line-height: 1.4;
}

#casa-booking-calendar .casa-date__apply {
  flex: 0 1 auto;
}

#casa-direct-booking ::selection {
  background: #8a346c;
  color: #fff;
}

/* JS controls [hidden]; outside the form is supported without global selectors. */
body.casa-booking-home .casa-booking__mobile-bar {
  display: none;
}

body.casa-booking-home.casa-booking-widget-visible .wa__btn_popup {
  bottom: 260px !important;
}

#casa-booking-calendar .casa-date__months {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

@media (min-width: 768px) and (max-height: 700px) {
  body.casa-booking-home #section-113-10 #carrusel-hero [data-id='div_block-19-10'] {
    padding-bottom: 230px;
  }
}

@media (max-width: 767px) {
  body.casa-booking-home #section-113-10 #carrusel-hero [data-id='div_block-19-10'] {
    padding-top: 70px;
    padding-bottom: 270px;
  }

  body.casa-booking-home #section-113-10 #carrusel-hero [data-id='div_block-51-10'] {
    box-sizing: border-box;
    max-width: 100%;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  body.casa-booking-home #section-113-10 #carrusel-hero [data-id='div_block-40-10'] h2,
  body.casa-booking-home #section-113-10 #carrusel-hero [data-id='div_block-40-10'] .ct-headline {
    max-width: 100%;
    font-size: 32px;
    line-height: 1.12;
    overflow-wrap: normal;
  }

  #casa-direct-booking.casa-booking {
    bottom: 16px;
    width: calc(100% - 32px);
    padding: 16px;
    border-radius: 12px;
  }

  #casa-direct-booking .casa-booking__heading {
    display: block;
    margin-bottom: 10px;
  }

  #casa-direct-booking #casa-booking-title {
    font-size: 24px;
    line-height: 1.2;
  }

  #casa-direct-booking .casa-booking__heading p,
  #casa-direct-booking .casa-booking__provider {
    display: none;
  }

  #casa-direct-booking .casa-booking__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  #casa-direct-booking .casa-booking__field {
    gap: 4px;
  }

  #casa-direct-booking .casa-booking__field > label {
    font-size: 13px;
    line-height: 20px;
  }

  #casa-direct-booking .casa-booking__field > label svg {
    width: 20px;
    height: 20px;
  }

  #casa-direct-booking :where(.casa-booking__native-date, .casa-booking__date-trigger, .casa-booking__guest-select) {
    min-height: 44px;
    padding: 9px 8px;
    line-height: 24px;
  }

  #casa-direct-booking .casa-booking__guest-stepper {
    min-height: 44px;
    padding: 0;
  }

  #casa-direct-booking .casa-booking__submit {
    min-height: 44px;
    padding: 10px 8px;
    font-size: 16px;
    line-height: 24px;
  }

  #casa-direct-booking .casa-booking__footer {
    margin-top: 10px;
  }

  body.casa-booking-home .casa-booking__mobile-bar {
    position: fixed;
    z-index: 99990;
    left: 16px;
    right: 16px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    display: block;
    margin: 0;
    padding: 0;
    font-family: 'Roboto Condensed', sans-serif;
  }

  body.casa-booking-home .casa-booking__mobile-bar :where(button, a) {
    appearance: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 8px;
    background: #8a346c;
    box-shadow: 0 6px 22px rgba(27, 15, 24, .24);
    color: #fff;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }

  body.casa-booking-home .casa-booking__mobile-bar :where(button, a):hover {
    background: #702655;
    color: #fff;
  }

  body.casa-booking-home .casa-booking__mobile-bar button > span,
  body.casa-booking-home .casa-booking__mobile-bar button > small {
    grid-column: 1;
    text-align: left;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.casa-booking-home .casa-booking__mobile-bar button > small {
    font-size: 13px;
    font-weight: 400;
  }

  body.casa-booking-home .casa-booking__mobile-bar button > svg {
    grid-column: 2;
    grid-row: 1 / 3;
    width: 20px;
    height: 20px;
  }

  body.casa-booking-home.casa-booking-widget-visible .wa__btn_popup {
    bottom: calc(290px + env(safe-area-inset-bottom, 0px)) !important;
    right: 16px !important;
  }

  body.casa-booking-home .wa__btn_popup_txt {
    display: none !important;
  }

  body.casa-booking-home.casa-booking-sticky-visible .wa__btn_popup {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.casa-booking-home.casa-booking-sticky-visible .wa__btn_popup_txt {
    display: none !important;
  }

  #casa-booking-calendar.casa-date {
    inset: 0;
    width: 100%;
    width: 100dvw;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    padding: 16px 12px 0;
    border-radius: 0;
    overflow: hidden;
  }

  #casa-booking-calendar.casa-date[open] {
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
    align-content: stretch;
  }

  #casa-booking-calendar .casa-date__header h3 {
    font-size: 24px;
  }

  #casa-booking-calendar .casa-date__hint {
    margin: 6px 0 12px;
    font-size: 14px;
  }

  #casa-booking-calendar .casa-date__range {
    gap: 10px;
    margin-bottom: 12px;
  }

  #casa-booking-calendar .casa-date__range button {
    min-height: 60px;
    padding: 8px 10px;
  }

  #casa-booking-calendar .casa-date__navigation {
    margin-bottom: 8px;
  }

  #casa-booking-calendar .casa-date__months {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 28px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 4px 0 20px;
    scrollbar-width: thin;
    scrollbar-color: #8a346c #eee5e9;
    scroll-padding-block: 8px;
  }

  #casa-booking-calendar .casa-date__footer {
    position: sticky;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    background: #faf7f2;
  }

  #casa-booking-calendar [data-calendar-summary] {
    font-size: 14px;
  }

  #casa-booking-calendar .casa-date__apply {
    min-height: 48px;
    padding: 12px;
    font-size: 16px;
  }
}

/* Seven 44px day targets still fit a 320px-wide full-screen sheet. */
@media (max-width: 360px) {
  /* Existing Oxygen menu extends 3-8px past the screen at 320px. Relative
   * offset preserves its viewport-fixed dropdown (unlike a transform). */
  body.casa-booking-home #section-2-8 #menu-movil {
    position: relative;
    left: -12px;
  }

  #casa-booking-calendar.casa-date {
    padding-left: 6px;
    padding-right: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #casa-direct-booking,
  #casa-direct-booking *,
  body.casa-booking-home .casa-booking__mobile-bar * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
