/* ========================================
   GLOBAL COVER HEADER STYLES
   (Used by all pages via template-parts/cover-header.php)
   ======================================== */

/* Base header container */
.hb-page-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  margin-top: 0;
  min-height: 29em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

body .hb-page-header {
  margin-top: -156px;
  padding-top: 64px;
}

/* Cover background layer */
.hb-page-header__cover {
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0.7) 100%), var(--hb-cover-image, url('/wp-content/themes/solace-child/assets/img/ugBalabacSideTopView_v2.webp'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 480px;
  min-height: 30em;
  margin-top: 0;
}

/* Content wrapper */
.hb-page-header__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 16px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: inherit;
}

/* Page title */
.hb-page-header__title {
  color: #fef9f3 !important;
  margin: 0 0 0 0;
  font-family: 'Ovo', serif;
  font-weight: 400 !important;
  font-size: clamp(3rem, 6vw, 4.25rem) !important;
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
}

/* Optional subtitle */
.hb-page-header__subtitle {
  color: #fef9f3;
  margin: 0 0 0 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  opacity: 0.9;
}

/* Breadcrumb navigation (shared across all pages) */
.hb-breadcrumb {
  margin-top: 0;
  font-size: 14px;
  color: #fef9f3;
  letter-spacing: 0.5px;
}

.hb-breadcrumb a {
  color: #fef9f3;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.hb-breadcrumb a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ========================================
   SEARCH PAGE STYLES (Legacy - uses old class names)
   ======================================== */

.hb-search-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  margin-top: 0;
  min-height: 29em;
}

body .hb-search-header {
  margin-top: -156px;
  padding-top: 64px;
}

.hb-search-header__cover {
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.7) 60%, rgba(0, 0, 0, 0.7) 100%), var(--hb-search-cover, url('/wp-content/themes/solace-child/assets/img/ugBalabacSideTopView_v2.webp'));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 480px;
  min-height: 30em;
  margin-top: 0;
}

.hb-search-header__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  z-index: 1;
}

body.up-hotel-booking-page:not(.tp-themes-premium) .hb-search-header__title {
  color: #fef9f3 !important;
  margin: 0;
  font-family: 'Ovo', serif;
  font-weight: 400;
  font-size: clamp(3rem, 6vw, 4.25rem);
  line-height: 1.1;
  letter-spacing: 0;
  text-transform: none;
}

.hb-search-header {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hb-search-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: inherit;
  padding: 64px 16px;
  z-index: 1;
}

.hotel-booking-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
  /* trim or grow the space between form and results */
}

.hotel-booking-search {
  column-gap: 30px !important;
  justify-content: center !important;
}

/* Room section wrapper - THE KEY FIX */
#hotel-booking-results {
  max-width: 550px !important;
  width: 550px !important;
}

div.detail__booking-rooms {
  max-width: 550px !important;
}

/* header title "Book Now" */
.hb-search-header h1.hb-search-header__title {
  font-size: clamp(3rem, 6vw, 4.25rem) !important;
  font-weight: 400 !important;
  color: #fef9f3 !important;
  margin-bottom: 0 !important;
}

/* Breadcrumb navigation */
.hb-breadcrumb {
  margin-top: 0;
  font-size: 14px;
  color: #fef9f3;
  letter-spacing: 0.5px;
}

.hb-breadcrumb a {
  color: #fef9f3;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.hb-breadcrumb a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ========================================
   SINGLE ROOM PAGE STYLES
   ======================================== */

/* Force responsive containers on single room pages */
body.single-hb_room .site-content,
body.single-hb_room .ast-container,
body.single-hb_room .entry-content,
body.single-hb_room .hb_single_room {
  max-width: 1200px !important;
  width: 100% !important;
  overflow-x: hidden !important;
}

body.single-hb_room .hb_single_room {
  margin: 0 auto !important;
  padding: 0 1rem !important;
}

/* Fix .room-single-top section (plugin default template) */
/* Desktop: Title left, Price+Button right */
body.single-hb_room .room-single-top {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  gap: 1rem !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 1.5rem !important;
}

body.single-hb_room .room-single-top .title,
body.single-hb_room .room-single-top h1 {
  flex: 1 1 auto !important;
  margin: 0 !important;
  min-width: 200px !important;
}

body.single-hb_room .room-single-top .single-top-right {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 1rem !important;
  flex-shrink: 0 !important;
}

body.single-hb_room .room-single-top .price {
  margin: 0 !important;
  float: none !important;
  text-align: right !important;
}

body.single-hb_room .room-single-top .hb_button {
  display: inline-block !important;
  width: auto !important;
  white-space: nowrap !important;
  padding: 12px 24px !important;
}

/* Hero Section */
.hb-room-hero {
  position: relative;
  overflow: hidden;
  min-height: 400px;
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fef9f3;
}

.hb-room-hero__cover {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.6) 100%), var(--hb-room-cover);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hb-room-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Room Title */
.hb-room-hero__heading .title {
  margin: 0;
}

.hb-room-hero__heading .title h1 {
  margin: 0;
  font-family: 'Ovo', serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 400;
  line-height: 1.1;
  color: #fef9f3;
}

.hb-room-hero__heading .title h1 a {
  color: inherit;
  text-decoration: none;
}

/* Room Excerpt */
.hb-room-hero__excerpt {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.125rem);
  line-height: 1.6;
  opacity: 0.95;
}

/* Meta Section (Price + Button) */
.hb-room-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.hb-room-hero__price .price {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: inherit;
}

.hb-room-hero__price .price .title-price {
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.hb-room-hero__price .price .price_value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

.hb-room-hero__price .price .unit {
  font-size: 0.875rem;
  opacity: 0.85;
}

.hb-room-hero__actions .hb_button {
  display: inline-block;
  padding: 0.875rem 2rem;
  background: var(--hb-primary, #ffb606);
  color: #092224;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hb-room-hero__actions .hb_button:hover,
.hb-room-hero__actions .hb_button:focus {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Single Room Layout */
.hb-room-single {
  padding: 0 1.5rem 3rem;
}

.hb-room-single__layout {
  margin: 0 auto;
  max-width: 1200px;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

/* Room Media (Gallery) */
.hb-room-single__media {
  width: 100%;
  max-width: 100%;
}

.hb-room-single__media img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Room Details */
.hb-room-single__details {
  width: 100%;
  max-width: 100%;
}

.hb_single_room_details {
  padding: 2rem;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Ensure plugin content doesn't overflow */
.hb_single_room_details *,
.hb_single_room *,
.summary * {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hb_single_room_details img,
.hb_single_room img,
.summary img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Override any fixed widths from plugin */
body.single-hb_room .summary,
body.single-hb_room .hb_room_gallery,
body.single-hb_room #hb_room_images {
  max-width: 100% !important;
  width: 100% !important;
}

/* Make tables responsive */
body.single-hb_room table {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
}

/* ========================================
   RESPONSIVE MEDIA QUERIES
   ======================================== */

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .hb-room-hero {
    min-height: 350px;
  }

  .hb-room-hero__inner {
    padding: 2.5rem 1.5rem;
  }

  .hb-room-single__layout {
    gap: 2.5rem;
  }
}

/* Desktop */
@media (min-width: 1025px) {
  .hb-room-hero {
    min-height: 450px;
  }

  .hb-room-single__layout {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* Mobile */
@media (max-width: 768px) {

  /* Stack .room-single-top vertically on mobile */
  body.single-hb_room .room-single-top {
    flex-direction: column !important;
  }

  body.single-hb_room .room-single-top .title,
  body.single-hb_room .room-single-top h1 {
    width: 100% !important;
  }

  body.single-hb_room .room-single-top .single-top-right {
    width: 100% !important;
    align-items: flex-start !important;
  }

  body.single-hb_room .room-single-top .price {
    text-align: left !important;
  }

  body.single-hb_room .room-single-top .hb_button {
    width: 100% !important;
    text-align: center !important;
  }

  .hb-room-hero {
    min-height: 350px;
  }

  .hb-room-hero__inner {
    padding: 2rem 1rem;
    gap: 1.25rem;
  }

  .hb-room-hero__meta {
    flex-direction: column;
    gap: 1rem;
  }

  .hb-room-single {
    padding: 0 1rem 2rem;
  }

  .hb-room-single__layout {
    gap: 1.5rem;
  }

  .hb_single_room_details {
    padding: 1.5rem;
  }

  /* Ensure search results don't overflow on mobile */
  #hotel-booking-results {
    max-width: 100% !important;
    width: 100% !important;
  }
}

body.wp-hotel-booking-page {
  padding-left: 0px !important;
  padding-right: 0px !important;
}

/* Override CSS in beach-hut page */
.hb_single_room #hb_room_images img {
  object-fit: contain !important;
}

/* [START] Force the cover image of woocommerce cart and woocommerce checkout page to use full width. (2410252004) */
/* Step 1: Remove width constraint from Solace theme wrapper for cart */
.woocommerce-cart .boxes-content {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Step 2: Force cover header to full viewport width for cart */
.woocommerce-cart .hb-page-header {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: 100vw;
  width: 100vw;
}

/* Step 3: Remove the margin of .the-content so that the cover image will fully cover the Kamp Malaya logo */
.woocommerce-cart .the-content {
  margin-top: 0px !important;
}

/* Step 4: Keep cart table/form contained and centered for cart */
.woocommerce-cart .the-content>.woocommerce {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* Step 1: Remove width constraint from Solace theme wrapper for checkout */
.woocommerce-checkout .boxes-content {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Step 2: Force cover header to full viewport width for checkout */
.woocommerce-checkout .hb-page-header {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: 100vw;
  width: 100vw;
}

/* Step 3: Remove the margin of .the-content so that the cover image will fully cover the Kamp Malaya logo */
.woocommerce-checkout .the-content {
  margin-top: 0px !important;
}

/* Step 4: Keep table/form contained and centered for checkout */
.woocommerce-checkout .the-content>.woocommerce {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* Step 1: Remove width constraint from Solace theme wrapper for Pay for booking */
.woocommerce-order-pay .boxes-content {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Step 2: Force cover header to full viewport width for Pay for booking */
.woocommerce-order-pay .hb-page-header {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: 100vw;
  width: 100vw;
}

/* Step 3: Remove the margin of .the-content so that the cover image will fully cover the Kamp Malaya logo */
.woocommerce-order-pay .the-content {
  margin-top: 0px !important;
}

/* Step 4: Keep table/form contained and centered for Pay for booking */
.woocommerce-order-pay .the-content>.woocommerce {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

/* [END] Force the cover image of woocommerce cart and woocommerce checkout page to use full width. (2410252012) */
/* [START] Add background image of header section of order-pay page. (2510251906) */
.woocommerce-order-pay .site-header {
  background-image: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('/wp-content/themes/solace-child/assets/img/KampMalayaRoomHeroPagePhoto.webp');
  background-size: cover;
  background-position: center;
}

/* [END] Add background image of header section of order-pay page. (2510251906) */