/**
 * Hotel detail — refaktor sekcie "Aktuálne dostupné ponuky".
 * Karta per izba (collapsible) + sub-card per rate plan + detail modal.
 *
 * Renderuje JS (public/assets/js/hotel-offers.js) do #hotel-cal-results.
 */

/* ───────── Karta per izba ───────── */
.hotel-offer-room {
  background: #fff;
  border: 1px solid rgba(7, 21, 50, 0.10);
  border-radius: var(--radius, 14px);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.hotel-offer-room:hover {
  box-shadow: 0 6px 22px rgba(7, 21, 50, 0.07);
  border-color: rgba(7, 21, 50, 0.16);
}

.hotel-offer-room__header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  padding: 18px 22px;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.hotel-offer-room__title {
  min-width: 0;
}
.hotel-offer-room__title h3 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.18rem;
  line-height: 1.25;
  margin: 0 0 4px;
  color: var(--primary, #071532);
}
.hotel-offer-room__meta {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-soft, #6a7185);
  margin: 0;
}

.hotel-offer-room__price {
  text-align: right;
  white-space: nowrap;
}
.hotel-offer-room__from-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #6a7185);
  display: block;
}
.hotel-offer-room__from-price {
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--primary, #071532);
  display: block;
  line-height: 1.1;
}
.hotel-offer-room__nights {
  display: block;
  font-size: 12px;
  color: var(--ink-soft, #6a7185);
}

.hotel-offer-room__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(7, 21, 50, 0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--primary, #071532);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.hotel-offer-room__toggle:hover {
  background: var(--bg-muted, #f4f6fb);
  border-color: rgba(7, 21, 50, 0.30);
}
.hotel-offer-room__toggle .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s ease;
}
.hotel-offer-room[data-collapsed="false"] .hotel-offer-room__toggle .chevron {
  transform: rotate(180deg);
}

.hotel-offer-room__list {
  border-top: 1px solid rgba(7, 21, 50, 0.06);
  padding: 12px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hotel-offer-room__list[hidden] {
  display: none;
}

/* ───────── Sub-card per rate plan ───────── */
.hotel-offer-rate {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 14px 16px;
  background: rgba(7, 21, 50, 0.025);
  border: 1px solid rgba(7, 21, 50, 0.05);
  border-radius: 10px;
  align-items: center;
}
.hotel-offer-rate--blocked {
  opacity: 0.78;
  border-style: dashed;
  background: rgba(7, 21, 50, 0.015);
}

.hotel-offer-rate__body {
  min-width: 0;
}
.hotel-offer-rate__name {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--primary, #071532);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.35;
}
.hotel-offer-rate__name-text {
  word-break: break-word;
}

.hotel-offer-rate__sub {
  font-size: 12px;
  color: var(--ink-soft, #6a7185);
  margin: 0 0 6px;
}

.hotel-offer-rate__detail-btn {
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--accent, #2c5fff);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
}
.hotel-offer-rate__detail-btn:hover {
  text-decoration: underline;
}
.hotel-offer-rate__detail-btn svg {
  width: 14px;
  height: 14px;
}

.hotel-offer-rate__restrict {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #8a4a00;
  margin-top: 6px;
}

.hotel-offer-rate__action {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}
.hotel-offer-rate__price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary, #071532);
}
.hotel-offer-rate__price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
  white-space: normal;
}
.hotel-offer-rate__breakdown {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-soft, #6a7185);
  max-width: 220px;
}
.hotel-rate-modal__breakdown-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft, #6a7185);
  margin: 10px 0 0;
}
.hotel-offer-rate--blocked .hotel-offer-rate__price {
  text-decoration: line-through;
  color: var(--ink-soft, #6a7185);
}
.hotel-offer-rate__cta {
  flex-shrink: 0;
}

/* ───────── Cancel badge (inline pill) ───────── */
.cancel-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.3;
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cancel-badge--free {
  background: rgba(34, 197, 94, 0.13);
  color: #16803c;
}
/* Bezplatné storno s dátumom / flexibilná tarifa — zelený rám, kontrastný text (WCAG) */
.cancel-badge--free.hotel-offer-rate__badge--free-cancel {
  background: #f7fdf9;
  color: #14532d;
  border: 1px solid #15803d38;
  box-shadow: none;
}
.cancel-badge--strict {
  background: rgba(172, 133, 16, 0.20);
  color: #8a4a00;
}
.cancel-badge--nonref {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}

/* ───────── Modal ───────── */
.hotel-rate-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
}
.hotel-rate-modal[hidden] {
  display: none;
}

.hotel-rate-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 21, 50, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.hotel-rate-modal__panel {
  position: relative;
  background: #fff;
  border-radius: 18px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(7, 21, 50, 0.30);
  overflow: hidden;
}

.hotel-rate-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 26px 14px;
  border-bottom: 1px solid rgba(7, 21, 50, 0.06);
  gap: 12px;
}
.hotel-rate-modal__title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.32rem;
  line-height: 1.28;
  margin: 0;
  color: var(--primary, #071532);
  flex: 1;
  min-width: 0;
}
.hotel-rate-modal__subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft, #6a7185);
  margin: 4px 0 0;
}

.hotel-rate-modal__close {
  background: rgba(7, 21, 50, 0.06);
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--primary, #071532);
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.hotel-rate-modal__close:hover {
  background: rgba(7, 21, 50, 0.13);
}
.hotel-rate-modal__close svg {
  width: 18px;
  height: 18px;
}

.hotel-rate-modal__body {
  padding: 18px 26px;
  overflow-y: auto;
  flex: 1;
}

.hotel-rate-modal__section {
  margin-bottom: 22px;
}
.hotel-rate-modal__section:last-child {
  margin-bottom: 0;
}
.hotel-rate-modal__section h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #6a7185);
  margin: 0 0 8px;
}

.hotel-rate-modal__desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--primary, #071532);
}
.hotel-rate-modal__desc p { margin: 0 0 8px; }
.hotel-rate-modal__desc p:last-child { margin-bottom: 0; }
.hotel-rate-modal__desc ul { padding-left: 20px; margin: 0 0 8px; }

.hotel-rate-modal__inclusions {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hotel-rate-modal__inclusions li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.4;
}
.hotel-rate-modal__inclusions li::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2316803c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}

.hotel-rate-modal__cancel {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(7, 21, 50, 0.04);
  border-left: 3px solid var(--accent, #2c5fff);
  font-size: 14px;
  line-height: 1.5;
  color: var(--primary, #071532);
}
.hotel-rate-modal__cancel--free {
  background: rgba(34, 197, 94, 0.08);
  border-left-color: #16803c;
}
.hotel-rate-modal__cancel--nonref {
  background: rgba(220, 38, 38, 0.06);
  border-left-color: #b91c1c;
}

.hotel-rate-modal__breakdown {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 16px;
  font-size: 14px;
  color: var(--primary, #071532);
}
.hotel-rate-modal__breakdown dt {
  margin: 0;
  color: var(--ink-soft, #6a7185);
  font-weight: 500;
}
.hotel-rate-modal__breakdown dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}
.hotel-rate-modal__breakdown .hotel-rate-modal__total-row dt,
.hotel-rate-modal__breakdown .hotel-rate-modal__total-row dd {
  border-top: 1px solid rgba(7, 21, 50, 0.08);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--primary, #071532);
}

.hotel-rate-modal__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px 22px;
  border-top: 1px solid rgba(7, 21, 50, 0.06);
  gap: 14px;
  background: #fff;
  flex-wrap: wrap;
}
.hotel-rate-modal__price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hotel-rate-modal__price-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft, #6a7185);
}
.hotel-rate-modal__price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary, #071532);
  line-height: 1.1;
}

/* ───────── Mobile ───────── */
@media (max-width: 640px) {
  .hotel-offer-room__header {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 18px;
  }
  .hotel-offer-room__price {
    text-align: left;
  }
  .hotel-offer-room__toggle {
    justify-content: center;
    width: 100%;
  }
  .hotel-offer-room__list {
    padding: 10px 18px 16px;
  }
  .hotel-offer-rate {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .hotel-offer-rate__action {
    justify-content: space-between;
    width: 100%;
  }
  .hotel-rate-modal {
    padding: 0;
    place-items: stretch;
  }
  .hotel-rate-modal__panel {
    border-radius: 0;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
  }
  .hotel-rate-modal__header { padding: 18px 18px 12px; }
  .hotel-rate-modal__body { padding: 14px 18px; }
  .hotel-rate-modal__footer { padding: 14px 18px 18px; }
}
