.hbr-unit-with-gallery {
  position: relative;
  cursor: pointer;
}

.hbr-unit-with-gallery::after {
  content: "Lihat foto & butiran  →";
  position: absolute;
  right: 22px;
  bottom: 18px;
  color: #a95f38;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  pointer-events: none;
}

.hbr-gallery-lock {
  overflow: hidden !important;
}

.hbr-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 28px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .22s ease, visibility .22s ease;
}

.hbr-gallery-modal.is-open {
  visibility: visible;
  opacity: 1;
}

.hbr-gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 35, 28, .76);
  backdrop-filter: blur(8px);
}

.hbr-gallery-dialog {
  position: relative;
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 30px;
  background: #fffdf8;
  box-shadow: 0 30px 90px rgba(5, 24, 18, .35);
}

.hbr-gallery-close {
  position: absolute;
  z-index: 3;
  top: 18px;
  right: 18px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(31, 73, 58, .14);
  border-radius: 50%;
  background: rgba(255, 253, 248, .94);
  color: #183c30;
  font: 400 30px/1 Arial, sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 45, 35, .15);
}

.hbr-gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(350px, .82fr);
  min-height: 650px;
}

.hbr-gallery-visual {
  min-width: 0;
  padding: 18px;
  background: #e9eee8;
  border-radius: 28px 0 0 28px;
}

.hbr-gallery-stage {
  position: relative;
  height: 540px;
  overflow: hidden;
  border-radius: 20px;
  background: #dbe4dc;
}

.hbr-gallery-main {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hbr-gallery-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 50%;
  background: rgba(24, 60, 48, .82);
  color: white;
  font: 300 34px/1 Arial, sans-serif;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

.hbr-gallery-prev { left: 16px; }
.hbr-gallery-next { right: 16px; }

.hbr-gallery-count {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(17, 48, 38, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}

.hbr-gallery-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scrollbar-width: thin;
}

.hbr-gallery-thumb {
  flex: 0 0 82px;
  height: 64px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #dbe4dc;
  opacity: .68;
  cursor: pointer;
  transition: opacity .15s ease, border-color .15s ease, transform .15s ease;
}

.hbr-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hbr-gallery-thumb:hover,
.hbr-gallery-thumb.is-active {
  border-color: #a95f38;
  opacity: 1;
  transform: translateY(-1px);
}

.hbr-gallery-copy {
  padding: 66px 42px 36px;
  color: #263b33;
}

.hbr-gallery-eyebrow {
  margin: 0 0 12px;
  color: #a95f38;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hbr-gallery-copy h2 {
  margin: 0;
  color: #183c30;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 4vw, 54px);
  line-height: .98;
  letter-spacing: -.035em;
}

.hbr-gallery-price {
  margin: 10px 0 0;
  color: #c27a4a;
  font-size: 20px;
  font-weight: 800;
}

.hbr-gallery-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 20px;
}

.hbr-gallery-facts span {
  padding: 8px 11px;
  border-radius: 999px;
  background: #edf2ec;
  color: #244d3f;
  font-size: 12px;
  font-weight: 750;
}

.hbr-gallery-summary {
  margin: 0 0 26px;
  color: #53635d;
  font-size: 15px;
  line-height: 1.75;
}

.hbr-gallery-copy h3 {
  margin: 0 0 13px;
  color: #183c30;
  font-size: 15px;
}

.hbr-gallery-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hbr-gallery-features li {
  position: relative;
  padding-left: 19px;
  color: #485c54;
  font-size: 13px;
  line-height: 1.45;
}

.hbr-gallery-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #a95f38;
  font-weight: 900;
}

.hbr-gallery-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
}

.hbr-gallery-continue {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: #214d3e;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 860px) {
  .hbr-gallery-modal { padding: 0; align-items: end; }
  .hbr-gallery-dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 26px 26px 0 0;
  }
  .hbr-gallery-layout { display: block; min-height: 0; }
  .hbr-gallery-visual { padding: 10px; border-radius: 24px 24px 0 0; }
  .hbr-gallery-stage { height: min(54vh, 430px); border-radius: 18px; }
  .hbr-gallery-copy { padding: 32px 22px 34px; }
  .hbr-gallery-copy h2 { font-size: 40px; }
  .hbr-gallery-close { top: 14px; right: 14px; }
}

@media (max-width: 560px) {
  .hbr-unit-with-gallery::after { right: 16px; bottom: 12px; font-size: 10px; }
  .hbr-gallery-stage { height: 42vh; min-height: 280px; }
  .hbr-gallery-arrow { width: 40px; height: 40px; }
  .hbr-gallery-thumb { flex-basis: 70px; height: 54px; }
  .hbr-gallery-features { grid-template-columns: 1fr; gap: 8px; }
  .hbr-gallery-actions { align-items: stretch; flex-direction: column; }
  .hbr-gallery-continue { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .hbr-gallery-modal,
  .hbr-gallery-thumb { transition: none; }
}

/* Hide the "Borang tempahan rasmi" badge and the check-out turnover note */
.secure-note,
.turnover-note {
  display: none !important;
}

/* Footer: centered, two lines (block flow so <br> works) */
footer {
  display: block !important;
  text-align: center !important;
  line-height: 1.7;
}
footer .photo-credit {
  font-size: inherit;
}

/* Hide the "Pilih jenis homestay untuk membuka kalendar" placeholder */
.calendar-placeholder {
  display: none !important;
}

/* "Perlu bantuan?" contact phone links */
.summary-note .help-tel {
  display: block;
  color: inherit;
  text-decoration: none;
}
.summary-note .help-tel:hover {
  text-decoration: underline;
}

/* Hero: auto-crossfading photo slideshow with a softer overlay */
.hero {
  background: #0f251e !important;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.hero-slide {
  position: absolute;
  inset: 0;
  background-position: 50% 45%;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  will-change: opacity;
}
.hero-slide.is-active {
  opacity: 1;
}
.hero-ovl {
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, rgba(15,37,30,0.90) 0%, rgba(21,48,41,0.72) 50%, rgba(36,68,56,0.42) 100%);
}

/* Payment / bank details card (injected in step 3) — hidden for now */
.hbr-pay-card {
  display: none;
  margin: 18px 0 50px;
  border: 1px solid rgba(36,68,56,0.18);
  border-radius: 14px;
  background: #fff;
  padding: 15px 17px;
  box-shadow: 0 12px 30px rgba(23,61,50,0.07);
}
.hbr-pay-head {
  font-weight: 800;
  color: var(--forest, #244438);
  letter-spacing: .02em;
  margin-bottom: 8px;
  font-size: 13px;
}
.hbr-pay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px solid rgba(36,68,56,0.10);
  flex-wrap: wrap;
}
.hbr-pay-row:first-of-type { border-top: 0; }
.hbr-pay-k { color: var(--muted, #6b7b73); font-size: 13px; }
.hbr-pay-v { font-weight: 600; color: #16261f; text-align: right; }
.hbr-pay-acc { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.hbr-pay-num {
  font-weight: 800; font-size: 16px; letter-spacing: .04em; color: #16261f;
  font-variant-numeric: tabular-nums;
}
.hbr-pay-copy {
  border: 0; cursor: pointer;
  background: var(--forest, #244438); color: #fff;
  font-weight: 700; font-size: 11px; letter-spacing: .03em;
  padding: 7px 13px; border-radius: 999px;
  transition: background .15s ease, transform .1s ease;
}
.hbr-pay-copy:hover { background: #1b3429; }
.hbr-pay-copy:active { transform: scale(.96); }
.hbr-pay-copy.is-copied { background: #2e7d55; }

.hbr-pay-logo {
  display: block;
  height: 24px;
  width: auto;
  max-width: 170px;
}

/* Hide only the green "Tarikh tersedia" confirmation (keep the unavailable/error warnings) */
.availability-message.available {
  display: none !important;
}

/* Visually merge the Kembali/Teruskan button row into the bottom of the
   active form-card, on both desktop and mobile. In the compiled app
   .form-actions is a plain sibling after all 4 .form-card sections (not
   nested inside them), so it floats on the page background below the white
   card. This gives it matching background/border/radius/shadow and removes
   the gap so it reads as one continuous card.
   Scoped to ".form-card + .form-actions" (immediate sibling) rather than
   ".form-actions" alone: when a validation error is showing, .error-message
   sits between the card and the button row instead, and that already has
   its own self-contained card styling + spacing that shouldn't be squashed.
   Split by breakpoint because the compiled app treats .form-actions very
   differently below 641px — a deliberate position:sticky/bottom:0 bar so
   the button stays reachable while scrolling. The mobile rule below keeps
   that sticky behavior (position/bottom/z-index are left untouched) and
   only overrides the visual styling to match the card. */
.form-card {
  border-radius: 22px 22px 0 0;
  border-bottom: none;
  padding-bottom: 12px;
  box-shadow: none;
}
@media (min-width: 641px) {
  .form-card + .form-actions {
    margin-top: 0;
    background: var(--paper, #fffdf8);
    border: 1px solid #173d3214;
    border-top: none;
    border-radius: 0 0 22px 22px;
    padding: 20px clamp(28px, 5vw, 52px) clamp(28px, 5vw, 52px);
    box-shadow: 0 16px 44px #122f2612;
  }
}
/* Mobile: same merged look, but keep the compiled app's own
   position:sticky/bottom:0/z-index (not overridden here) so the button
   row still stays reachable while scrolling — it just also matches the
   card's background/radius/shadow instead of floating with a gap, and
   drops the negative-margin full-bleed + frosted blur so its edges line
   up with the card above it. */
@media (max-width: 640px) {
  .form-card + .form-actions {
    margin: 0;
    background: var(--paper, #fffdf8);
    border: 1px solid #173d3214;
    border-top: none;
    border-radius: 0 0 22px 22px;
    padding: 16px 20px 20px;
    box-shadow: 0 16px 44px #122f2612;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Hero rotating highlighted phrase */
.hbr-rotate {
  display: inline-block;
  margin-top: .12em;
  padding: .04em .3em;
  border-radius: 12px;
  background: #c27a4a;
  color: #fff;
  line-height: 1.06;
  overflow: hidden;
  vertical-align: bottom;
}
.hbr-rotate-inner {
  display: inline-block;
  transition: opacity .38s ease, transform .38s ease;
}
.hbr-rotate-inner.is-out { opacity: 0; transform: translateY(-.28em); }
.hbr-rotate-inner.is-in  { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .hbr-rotate-inner { transition: none; }
}

/* Upload-card icons: camera for selfie/IC, paperclip for payment (replaces the "+") */
.upload-field .upload-mark {
  color: transparent !important;
  font-size: 0 !important;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}
.upload-field:has(#selfie_ic) .upload-mark,
.upload-field:has(#ic_front) .upload-mark {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23244438' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/><circle cx='12' cy='13' r='4'/></svg>");
}
.upload-field:has(#payment_receipt) .upload-mark {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23244438' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48'/></svg>");
}

/* Brand seal: house icon instead of "HBR" text */
.brand-seal {
  color: transparent !important;
  font-size: 0 !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 9.5L12 3l9 6.5'/><path d='M5 10v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V10'/><path d='M9.5 21v-5.5h5V21'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 52%;
}

/* Show the Tempahan summary card on mobile too (static, not sticky) */
@media (max-width: 640px) {
  .booking-summary { display: block !important; position: static !important; }
}

/* Hide the "Perlu bantuan?" box in the booking summary (to be relocated later) */
.summary-note { display: none !important; }
