/**
 * Sticky Reservation & Quick-Action Bar
 * Theme: Hotel411 Child (Twenty Twenty-Five)
 */

:root {
  --h411-admin-bar-height: 0px;
}

/* 1. Account for logged-in WordPress Admin Bar */
body.admin-bar {
  --h411-admin-bar-height: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    --h411-admin-bar-height: 46px;
  }
}

/* 2. Core Sticky Container */
.hotel411-sticky-bar {
  position: -webkit-sticky;
  position: sticky;
  top: var(--h411-admin-bar-height);
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9999;
  background-color: var(--wp--preset--color--hotel-navy, #0A192F);
  color: var(--wp--preset--color--hotel-cream, #F8F6F0);
  border-bottom: 2px solid var(--wp--preset--color--hotel-gold, #D4AF37);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  box-sizing: border-box;
  transition: top 0.2s ease;
}

/* 3. Title & Price Meta */
.hotel411-sticky-bar .bar-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 16px;
  color: #FFFFFF;
}

.hotel411-sticky-bar .bar-title strong {
  color: var(--wp--preset--color--hotel-gold, #D4AF37);
  font-weight: 700;
}

/* 4. Action Button */
.hotel411-sticky-bar .book-btn {
  flex-shrink: 0;
  display: inline-block;
  background-color: var(--wp--preset--color--hotel-gold, #D4AF37);
  color: #0A192F !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 18px;
  border-radius: 4px;
  line-height: 1.2;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.hotel411-sticky-bar .book-btn:hover,
.hotel411-sticky-bar .book-btn:focus {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* 5. Mobile Optimization (Screens under 600px) */
@media screen and (max-width: 600px) {
  .hotel411-sticky-bar {
    padding: 8px 14px;
    gap: 10px;
  }

  .hotel411-sticky-bar .bar-title {
    font-size: 0.82rem;
    padding-right: 8px;
    line-height: 1.25;
  }

  .hotel411-sticky-bar .book-btn {
    font-size: 0.78rem;
    padding: 7px 12px;
  }
}

/* 6. Extra Small Screens (Under 380px) */
@media screen and (max-width: 380px) {
  .hotel411-sticky-bar .bar-title strong {
    display: none; /* Hides price to prevent title clipping on micro screens */
  }
}

/* 7. Ensure the TOC stretches to wide width across all post templates */
.entry-content .h411-toc-wrapper.alignwide,
.wp-block-post-content .h411-toc-wrapper.alignwide {
  max-width: var(--wp--style--global--wide-size, 1200px);
  width: 100%;
}


/* 8 .Prevent sticky header from covering anchor headings */
/* Bulletproof Anchor Offset Hack for Block Themes */
h2[id],
h3[id],
.entry-content h2[id],
.entry-content h3[id] {
  position: relative !important;
}

h2[id]::before,
h3[id]::before,
.entry-content h2[id]::before,
.entry-content h3[id]::before {
  content: "";
  display: block;
  height: calc(var(--h411-admin-bar-height, 0px) + 90px);
  margin-top: calc(-1 * (var(--h411-admin-bar-height, 0px) + 90px));
  visibility: hidden;
  pointer-events: none;
}