/* ============================================================================
   OVERCROSS - the tour page's one action under the thumb.

   Characteristic 9 of docs/design/mobile-concept.md: a thin bottom bar holding
   price plus Anfrage, with the call slot beside it and quieter.  An action,
   never navigation.

   THE SPLIT, and it is the whole point of this file.  The tour page already
   carries a sticky bar at the TOP (`#tour-sticky-header`, `.tsh-*`, declared
   in tours/tour/book_form.blade.php).  On a desktop that is the right place;
   on a phone the action belongs under the thumb.  So:

     below 900   the bottom bar is on duty, the .tsh- top bar never appears
     900 and up  nothing changes: the .tsh- top bar behaves as it always has
                 and this bar is not displayed at all

   There is ONE signal for both, and the booking panel's existing observer in
   book_form.blade.php produces it: `oc-tour-past-panel` on <html> once
   `.booking-panel` has scrolled past the top of the viewport.  Which bar that
   means is decided here, by width, and nowhere else.  No second observer, no
   matchMedia number mirroring a rung in JavaScript.

   Mobile first on 600 / 900 / 1200 and no other width - `php artisan css:ladder`
   is the gate.  Loaded from Us_cluster::frontend.tours.detail only, which is
   why the page-level rules below (body padding) are safe to write here.
   ========================================================================= */


/* --- 1. The page has to end above the bar --------------------------------
   "Never covering the last section."  The shell renders the footer after the
   content, so the room has to be taken at the page level, not inside the
   content column.  base.css's `* { padding: 0 }` is a lower specificity than
   this, and neither app_r.css nor app_r_min.css touches body padding.  */

body {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}


/* --- 2. Which bar is on duty ---------------------------------------------
   These beat the `#tour-sticky-header { display: none }` in book_form's own
   <style> block on specificity (id + class + element), whichever order the
   two land in the document.  */

#tour-action-bar {
  display: none;
}

/* The hero, not the booking panel: below 900 the panel sits under the
   overview and the gallery, and a bar that waited for it would arrive near
   the foot of the page. */
html.oc-tour-past-hero #tour-action-bar {
  display: block;
}

/* The top bar is the desktop's, so on a phone it stays down whatever either
   observer says. */
#tour-sticky-header,
html.oc-tour-past-panel #tour-sticky-header {
  display: none;
}

/* "Hiding inside a form."  Set by the partial's own script while the enquiry
   sheet, the consultation sheet or the booking panel's form has the reader. */
html.oc-tour-form-open #tour-action-bar {
  display: none;
}

/* The phone's side menu is a full-screen overlay (body.menu-open, header_m):
   an action bar floating over it would be the one thing worse than no bar. */
body.menu-open #tour-action-bar {
  display: none;
}


/* --- 3. The bar ----------------------------------------------------------
   z-index 3900: over the tour content (1000) and the mobile header (3000/3001),
   under the enquiry sheet (4000) and the consultation sheet (99999), so a
   failed hide still cannot put the bar on top of the form it belongs to.  */

#tour-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3900;
  background: var(--oc-ink, #111214);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, .38);
  animation: tabSlideUp .22s ease;
}

@keyframes tabSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* 48px targets with 8px between them, and the safe area under the last row. */
.tab-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--oc-touch-gap, 8px);
  padding: 8px var(--oc-gutter, 20px);
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}


/* --- 4. The price --------------------------------------------------------
   The figure the page was opened for, in the same shape the booking panel
   prints it (UsPriceHelper::format).  */

.tab-bar__price {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  margin-right: auto;
  line-height: 1.15;
}

.tab-bar__from {
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--oc-eyebrow-track, .18em);
  text-transform: uppercase;
}

.tab-bar__amount {
  color: var(--oc-white, #fff);
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  margin-top: 2px;
}


/* --- 5. The call slot, quieter -------------------------------------------
   Outline, not fill: orange is the primary CTA and nothing else.  */

.tab-bar__slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--oc-touch, 48px);
  height: var(--oc-touch, 48px);
  border: 1px solid rgba(237, 227, 213, .38);
  border-radius: 6px;
  background: transparent;
  color: var(--oc-milk, #EDE3D5);
  text-decoration: none;
  transition: border-color .18s, color .18s;
}

.tab-bar__slot:hover,
.tab-bar__slot:focus {
  border-color: var(--oc-milk, #EDE3D5);
  color: var(--oc-milk, #EDE3D5);
  text-decoration: none;
}

.tab-bar__slot svg {
  width: 20px;
  height: 20px;
  display: block;
}


/* --- 6. Anfrage ----------------------------------------------------------- */

.tab-bar__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  height: var(--oc-touch, 48px);
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--oc-orange, #FF6A00);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s;
}

.tab-bar__cta:hover,
.tab-bar__cta:focus {
  background: #e05c00;
  color: #fff;
}


/* --- 7. From 600: a little more room ------------------------------------- */

@media (min-width: 600px) {
  .tab-bar__amount { font-size: 18px; }
  .tab-bar__cta    { padding: 0 28px; font-size: 14px; }
}


/* --- 8. From 900: the top bar takes the job back -------------------------
   Everything above is undone, so the desktop render is exactly what it was
   before this file existed.  */

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }

  #tour-action-bar,
  html.oc-tour-past-hero #tour-action-bar {
    display: none;
  }

  html.oc-tour-past-panel #tour-sticky-header {
    display: block;
  }

  /* What the observer used to write as an inline style on #site-header. */
  html.oc-tour-past-panel #site-header {
    display: none;
  }
}
