/* BUM layout refinement v1.0.0: preserve the original fonts, colors and geometry.
 * Provide breathing room for CTA groups and prevent buttons/tabs from colliding.
 */
:root { --bum-cta-gap: 14px; --bum-content-end-clearance: 70px; }

/* Keep page assets within their container without suppressing intentional menus. */
.entry-content, .wp-block-post-content, .bum-shop, .bum-booking,
.bum-reservations-page__inner, .bb-shell { min-width: 0; max-width: 100%; box-sizing: border-box; }
.entry-content :is(img, video, iframe, table),
.wp-block-post-content :is(img, video, iframe, table),
.bum-shop :is(img, video, iframe, table),
.bum-booking :is(img, video, iframe, table) { max-width: 100%; }
.entry-content :is(p, li, h1, h2, h3),
.wp-block-post-content :is(p, li, h1, h2, h3),
.bum-shop :is(p, h1, h2, h3), .bb-shell :is(p, h1, h2, h3) { overflow-wrap: anywhere; }

/* Buttons in static WordPress pages: the existing theme styles remain intact. */
body .wp-block-buttons,
body .wp-block-buttons.is-layout-flex { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bum-cta-gap) !important; margin-top: 24px; margin-bottom: 38px; min-width: 0; max-width: 100%; }
body .wp-block-buttons .wp-block-button { flex: 0 1 auto; min-width: 0; max-width: 100%; margin: 0 !important; }
body .wp-block-buttons .wp-block-button__link { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; text-align: center; max-width: 100%; min-height: 48px; white-space: normal; overflow-wrap: anywhere; line-height: 1.5; padding: 13px 20px; }
body .wp-block-buttons + .wp-block-separator { margin-top: 42px; }

/* Web shop's category and cart controls should wrap instead of covering each other. */
.bum-shop__topnav, .bum-shop__filter { box-sizing: border-box; max-width: 100%; column-gap: 12px; row-gap: 12px; }
.bum-shop__topnav a, .bum-shop__filter a { box-sizing: border-box; max-width: 100%; min-width: 0; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.bum-shop__grid, .bum-shop__product, .bum-shop__details { min-width: 0; }
.bum-shop__primary, .bum-shop button, .bum-shop input, .bum-shop select, .bum-shop textarea { box-sizing: border-box; max-width: 100%; }
.bum-shop__footer { margin-top: 35px; padding-top: 24px; padding-bottom: 28px; line-height: 1.8; }

/* Reservation flow: keep dates, time chips and submit content inside the screen. */
.bum-reservations-page { padding-bottom: max(95px, calc(80px + env(safe-area-inset-bottom, 0px))); }
.bum-booking { padding-bottom: 24px; }
.bum-booking__times > *, .bum-booking__calendar-grid > * { min-width: 0; }
.bum-booking__time, .bum-booking__calendar-day { box-sizing: border-box; white-space: normal; }
.bum-booking__end { padding-bottom: 30px; }
.bum-booking__end button { min-height: 50px; }

/* Roster: improve tab spacing and preserve horizontal scrolling when narrow. */
.bb-shell { padding-bottom: 100px; }
.bb-tabs { gap: 9px; padding: 0 0 10px; scroll-padding-inline: 12px; }
.bb-tab { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 44px; line-height: 1.4; }
.bb-date-form { column-gap: 14px; row-gap: 12px; }
.bb-day-jumps { gap: 12px; margin-bottom: 20px; padding-bottom: 10px; }
.bb-slot, .bb-booking, .bb-quick-grid, .bb-quick-cell, .bb-person-detail { min-width: 0; }
.bb-footer { padding-bottom: 25px; }

@media (max-width: 700px) {
  :root { --bum-cta-gap: 15px; --bum-content-end-clearance: 105px; }
  body .wp-block-buttons, body .wp-block-buttons.is-layout-flex { gap: 15px !important; margin-top: 27px; margin-bottom: 43px; }
  body .wp-block-buttons .wp-block-button__link { width: auto; max-width: 100%; min-height: 49px; padding: 13px 20px; }
  body .wp-block-buttons + .wp-block-separator { margin-top: 47px; }
  /* Keep the last CTA visibly apart from the footer and any bottom navigation. */
  body:not(.home) .entry-content, body:not(.home) .wp-block-post-content { padding-bottom: max(65px, env(safe-area-inset-bottom, 0px)); }
  .bum-shop { padding-bottom: max(90px, env(safe-area-inset-bottom, 0px)); }
  .bum-shop__topnav, .bum-shop__filter { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 11px; }
  .bum-shop__topnav a, .bum-shop__filter a { flex: 0 1 auto; margin: 0; padding-block: max(9px, .6em); }
  .bum-shop__grid { max-width: 100%; }
  .bum-shop__product { max-width: 100%; }
  .bum-shop__photo, .bum-shop__square-img { max-width: 100%; }
  .bum-reservations-page { padding-bottom: max(115px, calc(95px + env(safe-area-inset-bottom, 0px))); }
  .bum-booking { margin-bottom: 75px; }
  .bum-booking__times { gap: 13px; }
  .bum-booking__time { min-width: 0; padding-inline: 7px; }
  .bb-shell { padding-bottom: max(110px, calc(90px + env(safe-area-inset-bottom, 0px))); }
  .bb-tabs { gap: 8px; margin-bottom: 10px; }
  .bb-tab { padding: 12px 15px; min-height: 47px; }
  .bb-preview-switch { gap: 14px; margin-bottom: 23px; }
  .bb-day-jumps { gap: 10px; margin-bottom: 20px; }
  .bb-range-row, .bb-slot-heading { min-width: 0; }
  .bb-footer { margin-top: 45px; }
}

@media (max-width: 380px) {
  .bb-shell { padding-left: 13px; padding-right: 13px; }
  .bb-tab { padding: 11px 13px; }
  .bum-booking__calendar { padding-inline: 7px; }
  .bum-booking__calendar-weekdays, .bum-booking__calendar-grid { gap: 1px; }
  .bum-booking__calendar-status { font-size: 9px; }
  .bum-shop__topnav, .bum-shop__filter { column-gap: 10px; row-gap: 9px; }
}

/* Some themes have a fixed mobile bottom bar. Reserve its actual height below
 * the document, so a final CTA remains fully scrollable above that bar. */
@media (max-width: 850px) {
  body.bum-fixed-bottom-present { padding-bottom: var(--bum-fixed-nav-clearance, 0px) !important; }
}
