/* Search results only. GoCruise keeps its own dates, prices and booking flow. */
.cruise-search-panel .ces-app .ces-search-results__container {
  display: grid;
  gap: 16px;
}
.cruise-search-panel .ces-app .ces-search-results__container .ces-cruise {
  display: grid;
  grid-template-columns: minmax(145px, 24%) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--cruise-line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 6px 20px #17365b0d;
}
.cruise-search-panel .ces-app .ces-cruise > .ces-cruise-map {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--cruise-soft);
  border-radius: 10px;
  overflow: hidden;
}
.cruise-search-panel .ces-app .ces-cruise > .ces-cruise-map img {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
}
.cruise-search-panel .ces-app .ces-cruise-container {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
}
.cruise-search-panel .ces-app .ces-cruise-container > .ces-cruise-row { width: auto; min-width: 0; margin: 0; }
.cruise-search-panel .ces-app .ces-cruise-container > .ces-cruise-row:first-child { order: 1; }
.cruise-search-panel .ces-app .ces-cruise-container > .ces-cruise-row:last-child { order: 2; }
.cruise-search-panel .ces-app .ces-cruise__title {
  flex-wrap: wrap;
  align-items: start;
  gap: 10px;
  margin: 0;
  font-size: clamp(18px, 2.2vw, 25px);
  line-height: 1.3;
  color: var(--cruise-ink);
  overflow-wrap: anywhere;
}
.cruise-search-panel .ces-app .ces-cruise__itinerary {
  margin: 7px 0 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cruise-muted);
  overflow-wrap: anywhere;
}
.cruise-search-panel .ces-app .ces-cruise__info { flex-wrap: wrap; gap: 6px; margin: 0; }
.cruise-search-panel .ces-app .ces-cruise-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 42px;
  height: auto;
  margin: 0;
  padding: 6px 10px !important;
  border: 1px solid var(--cruise-line);
  border-radius: 9px;
  color: var(--cruise-ink);
  background: #fff;
}
.cruise-search-panel .ces-app .ces-cruise-button .ces-icon { width: 16px; height: 16px; }
.cruise-search-panel .ces-app .ces-cruise-button__title { position: static !important; font-size: 13px; line-height: 1.2; }
.cruise-search-panel .ces-app .ces-cruise-button:hover { opacity: 1; background: var(--cruise-soft); }
.cruise-search-panel .ces-app .ces-cruise-details { display: flex; flex-direction: row !important; flex-wrap: wrap; gap: 6px; margin: 0; }
.cruise-search-panel .ces-app .ces-cruise-details__tag {
  width: auto;
  margin: 0;
  padding: 5px 9px;
  border-radius: 20px;
  background: #edf3fa;
  color: var(--cruise-ink);
  font-size: 12px;
  line-height: 1.4;
}
.cruise-search-panel .ces-app .ces-cruise-details__tag:first-child { width: auto; }
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px;
  margin: 0;
}
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tag { min-width: 0; margin: 0; }
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tag:first-child { display: none; } /* Duration is already in the badges. */
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tag:last-child { grid-column: 1 / -1; }
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tag__title { color: var(--cruise-muted); font-size: 12px; margin-bottom: 4px; }
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tag__value {
  justify-content: flex-start;
  gap: 6px;
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--cruise-ink);
  background: var(--cruise-soft);
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.cruise-search-panel .ces-app .ces-cruise-container .ces-cruise-tag__value_clickable:hover { background: #e4eef9; }

.cruise-search-panel .ces-app .ces-cruise-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, max-content);
  gap: 8px 14px;
  padding-top: 12px;
  border-top: 1px solid var(--cruise-line);
}
.cruise-search-panel .ces-app .ces-cruise-options__calendar { min-width: 0; margin: 0; }
.cruise-search-panel .ces-app .ces-card-date__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start;
  gap: 5px;
  margin-bottom: 6px;
}
.cruise-search-panel .ces-app .ces-card-date__title { width: auto; padding: 0; text-align: left; font-size: 13px; color: var(--cruise-muted); font-weight: 650; }
.cruise-search-panel .ces-app .ces-card-date__buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.cruise-search-panel .ces-app .ces-card-date__button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px !important;
  margin: 0;
  padding: 0 !important;
  border: 1px solid var(--cruise-line);
  border-radius: 9px;
  background: #fff;
  color: var(--cruise-ink);
  font-size: 14px;
  font-weight: 650;
}
.cruise-search-panel .ces-app .ces-card-date__button:hover { background: var(--cruise-soft); }
.cruise-search-panel .ces-app .ces-card-date__button--selected,
.cruise-search-panel .ces-app .ces-card-date__button--selected:hover { color: #fff; background: var(--cruise-ink); border-color: var(--cruise-ink); }
.cruise-search-panel .ces-app .ces-cruise-options__info { grid-row: 2; min-width: 0; color: var(--cruise-muted); font-size: 13px; }
.cruise-search-panel .ces-app .ces-cruise-options__info .ces-bold::before { display: none; }
.cruise-search-panel .ces-app .ces-cruise-options__price {
  grid-area: 1 / 2 / span 2;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--cruise-soft);
}
.cruise-search-panel .ces-app .ces-cruise-options__cabin { color: var(--cruise-muted); font-size: 13px; }
.cruise-search-panel .ces-app .ces-cruise-options__min-price { margin: 0 0 8px; color: var(--cruise-ink); font-size: clamp(18px, 2vw, 24px); font-weight: 750; }
.cruise-search-panel .ces-app .ces-cruise-options__price-list { display: inline-grid; place-items: center; min-height: 44px; padding: 8px 16px; border-radius: 9px; font-weight: 650; }
.cruise-search-panel .ces-app .ces-search-results__pagination button { min-height: 44px; padding: 8px 13px !important; }

/* GoCruise may mount its dialogs outside the widget container. */
.home-page .ces-modal.ces-modal {
  width: min(1060px, calc(100vw - 40px));
  max-width: 100%;
  min-width: 0;
  max-height: min(90dvh, 860px) !important;
  border-radius: 16px;
  overflow: hidden;
}
.home-page .ces-modal .ces-modal-header,
.home-page .ces-modal .ces-modal-footer { flex: 0 0 auto; align-items: center; gap: 10px; padding: 10px 16px; background: #fff; }
.home-page .ces-modal .ces-modal-header { font-size: clamp(17px, 2vw, 22px); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.home-page .ces-modal .ces-modal-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px !important;
  padding: 0 !important;
  border: 1px solid #d7e2ee;
  border-radius: 9px;
  background: #f2f6fb;
}
.home-page .ces-modal .ces-modal-close .ces-icon { width: 17px; height: 17px; }
.home-page .ces-modal .ces-modal-footer { flex-wrap: wrap; }
.home-page .ces-modal .ces-modal-footer__button { min-height: 44px !important; margin: 0; padding: 8px 14px !important; border: 1px solid #d7e2ee; border-radius: 9px; text-transform: none; }
.home-page .ces-modal .ces-modal-footer__button--close { background: #f2f6fb; }
.home-page .ces-modal .ces-modal-body { min-width: 0; min-height: 0; padding: 12px 16px; overflow: auto; overscroll-behavior: contain; }
.home-page .ces-modal :is(.ces-cruise-modal__overflow, .ces-cruise-modal__half) { min-width: 0; max-width: 100%; }
.home-page .ces-modal .ces-cruise-modal__overflow {
  overflow-x: auto;
  border: 1px solid #d7e2ee;
  border-radius: 9px;
}
.home-page .ces-modal .ces-cruise-modal__table { min-width: 550px; }
.home-page .ces-modal .ces-cruise-modal__table th { background: #eef4fb; }
.home-page .ces-modal .ces-cruise-modal__table :is(td, th) { font-size: 13px; padding: 11px 10px; }
.home-page .ces-modal .ces-cruise-modal__table :is(td, th):last-child { white-space: nowrap; }
.home-page .ces-modal .ces-cruise-tags { gap: 6px; }
.home-page .ces-modal .ces-cruise-tags .ces-cruise-tag { flex: 1 1 140px; width: auto; min-width: 0; }
.home-page .ces-modal .ces-cruise-tag__value { white-space: normal; overflow-wrap: anywhere; }
/* The two-column tariff list is separate from the fare table. */
.home-page .ces-modal .ces-cruise-modal__half:has(> .ces-cruise-fare) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 6px;
}
.home-page .ces-modal .ces-cruise-modal__half:has(> .ces-cruise-fare) > .ces-cruise-modal__title { grid-column: 1 / -1; }
.home-page .ces-modal .ces-cruise-fare__label {
  display: flex;
  align-items: center;
  min-height: 44px !important;
  height: 100%;
  margin: 0;
  padding: 6px 8px 6px 29px;
  border-color: #d7e2ee;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.home-page .ces-modal .ces-cruise-fare__label_selected { background: #eaf2fc; border-color: #7797bb; }
.home-page .ces-modal .ces-cruise-fare__label_selected::before { background-color: #315f93; }
.home-page .ces-modal .ces-cruise-tags .ces-cruise-tag__value {
  padding: 6px 8px;
  border-radius: 6px;
  background: #edf3fa;
  color: #17365b !important;
}
.home-page .ces-modal .ces-modal-footer__button { text-align: center; }
@media (min-width: 769px) {
  .home-page .ces-modal.ces-modal:has(.ces-book) { width: min(620px, calc(100vw - 40px)); }
}
.home-page .ces-modal .ces-book { width: 100%; min-width: 0; max-width: 100%; }
.home-page .ces-modal .ces-book__checkbox-wrapper { margin-left: 0; }
.home-page .ces-modal .ces-book__list { white-space: normal; }
.home-page .ces-modal .ces-book__list li { flex-wrap: wrap; }
.home-page .ces-modal .ces-book__list span { padding-left: 0; overflow-wrap: anywhere; }
.home-page .ces-modal .ces-book__label { font: 650 13px/1.35 Inter, sans-serif; white-space: normal; text-transform: none; }
.home-page .ces-modal .ces-book__control .ces-book__field { min-height: 44px !important; max-height: none !important; padding: 8px 10px !important; text-align: left !important; }
.home-page .ces-modal .ces-book__control :is(.ces-book__field, .ces-book__textarea) { font-size: 16px !important; border: 1px solid #d7e2ee !important; border-radius: 9px !important; box-shadow: none; }
.home-page .ces-modal .ces-book__checkbox-label { white-space: normal; }

@media (max-width: 768px) {
  .cruise-search-panel .ces-app .ces-search-results__container .ces-cruise { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; }
  .cruise-search-panel .ces-app .ces-cruise > .ces-cruise-map img { max-height: 142px; }
  .cruise-search-panel .ces-app .ces-cruise-container .ces-cruise__title { display: block; }
  .cruise-search-panel .ces-app .ces-cruise__info { margin-top: 8px; }
  .cruise-search-panel .ces-app .ces-cruise-options { grid-template-columns: minmax(0, 1fr); }
  .cruise-search-panel .ces-app .ces-cruise-options__info { grid-row: auto; }
  .cruise-search-panel .ces-app .ces-cruise-options__price { grid-area: auto; text-align: left; }
  .cruise-search-panel .ces-app .ces-cruise-options__price-list { display: grid; width: 100%; }
  .home-page .ces-modal.ces-modal {
    width: 100%;
    height: 100%;
    max-height: 100dvh !important;
    border-radius: 0;
  }
  .home-page .ces-modal .ces-modal-header { padding-top: max(6px, env(safe-area-inset-top)); }
  .home-page .ces-modal .ces-modal-body { flex: 1 1 auto; padding: 10px 12px; }
  .home-page .ces-modal .ces-modal-footer { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  /* Reflow the original fare rows without replacing their click handlers. */
  .home-page .ces-modal .ces-cruise-modal__overflow { border: 0; overflow: visible; }
  .home-page .ces-modal .ces-cruise-modal__table { display: block; min-width: 0; }
  .home-page .ces-modal .ces-cruise-modal__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody { display: grid; gap: 10px; }
  .home-page .ces-modal .ces-cruise-modal__table tbody tr {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    gap: 6px 8px;
    padding: 10px;
    border: 1px solid #d7e2ee;
    border-radius: 10px;
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody td {
    display: block;
    min-width: 0;
    padding: 5px;
    overflow-wrap: anywhere;
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody td::after { content: none; }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:nth-child(2) {
    font-weight: 650;
    padding-right: 26px;
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:nth-child(n+3) { grid-column: 1 / -1; }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:nth-child(3):nth-last-child(3)::before {
    content: 'Тариф: ';
    font-weight: 650;
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:nth-last-child(2) { min-height: 44px; padding-right: 26px; }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:nth-last-child(2)::before {
    content: 'Включено';
    display: block;
    margin-bottom: 4px;
    font-weight: 650;
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:last-child {
    min-height: 44px;
    padding: 7px 32px 7px 10px;
    border-radius: 8px;
    background: #fff0e5 !important;
    color: #8d3500 !important;
    font-size: 16px;
    font-weight: 750;
    white-space: normal;
  }
  .home-page .ces-modal .ces-cruise-modal__table tbody td:last-child::before {
    content: 'Выбрать каюту';
    display: block;
    font-size: 12px;
    font-weight: 650;
  }
}
