/* =========================================================================
   Javis Booking Pro — v5.10.8 UX Polish + New Display Modes
   ---------------------------------------------------------------------------
   Loaded ALONGSIDE assets/css/public.css on the public booking form. Touches
   only NEW selectors (rbp-slot-pill-* and rbp-svc-hero-card) plus a focused
   polish layer on the existing modes (hover elevation, focus ring, ARIA
   visible-selection). Does not delete or override CRITICAL existing rules —
   site owners running on the legacy 4 modes (button / card / card_long / box)
   continue to render identically except for nicer hover and focus.
   ========================================================================= */

/* ───────────────────────────────────────────────────────────────────────────
   §1. Polish layer — keyboard-focus rings + hover elevation for ALL modes.
   Color follows the user's --rbp-slot-primary brand var with a translucent ring.
   ─────────────────────────────────────────────────────────────────────────── */
.rbp-slot-btn,
.rbp-slot-card,
.rbp-slot-card-long,
.rbp-slot-box,
.rbp-svc-card,
.rbp-svc-luxury-card {
  transition:
    transform .18s cubic-bezier(.2,.7,.3,1),
    box-shadow .18s ease-out,
    border-color .18s ease-out,
    background-color .18s ease-out !important;
  outline: none;
}
.rbp-slot-btn:focus-visible,
.rbp-slot-card:focus-visible,
.rbp-slot-card-long:focus-visible,
.rbp-slot-box:focus-visible,
.rbp-svc-card:focus-visible,
.rbp-svc-luxury-card:focus-visible {
  outline: 2px solid var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(192, 57, 43, .15);
}
.rbp-slot-card:not(.rbp-slot-full):hover,
.rbp-slot-card-long:not(.rbp-slot-full):hover,
.rbp-slot-box:not(.rbp-slot-full):hover,
.rbp-svc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

/* Selected-state checkmark animation on service cards. The .rbp-svc-selected-tick
   element already exists in the markup (line 1242 of booking-form.php) — we just
   give it a graceful enter animation. */
.rbp-svc-luxury-card.rbp-svc-selected .rbp-svc-selected-tick,
.rbp-svc-luxury-card.rbp-svc-luxury-card-selected .rbp-svc-selected-tick {
  animation: rbpTickIn .26s cubic-bezier(.2,.7,.3,1.4);
}
@keyframes rbpTickIn {
  0%   { transform: scale(0)   rotate(-45deg); opacity: 0;   }
  60%  { transform: scale(1.2) rotate( 8deg);  opacity: 1;   }
  100% { transform: scale(1)   rotate( 0);     opacity: 1;   }
}

/* Skeleton loading state used while availability is being fetched.
   Added by JS as `.rbp-slot-loading` class on the grid container. */
.rbp-slot-grid.rbp-slot-loading {
  pointer-events: none;
  position: relative;
}
.rbp-slot-grid.rbp-slot-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.5) 50%, rgba(255,255,255,0) 100%);
  animation: rbpSkeletonSlide 1.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes rbpSkeletonSlide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%);  }
}

/* ───────────────────────────────────────────────────────────────────────────
   §2. NEW — Slot 'pill' mode (OpenTable / Resy style).
   Horizontal scannable time pills, optionally grouped by period of day.
   ─────────────────────────────────────────────────────────────────────────── */
/* v5.11.2 CRITICAL FIX — the slot grid carries BOTH classes on the SAME element
   (`class="rbp-slot-grid rbp-slot-mode-pill"`, set in booking-form.js). The v5.11.1
   rule used a DESCENDANT selector (`.rbp-slot-mode-pill .rbp-slot-grid`) which
   requires the mode class to be an ANCESTOR — so it never matched, the grid stayed
   `display:grid` (auto-fill minmax cols), and the period groups + arrival-time panel
   flowed into narrow grid cells (the "side panel" bug). The compound selector below
   (no space) correctly targets the grid itself. */
.rbp-slot-grid.rbp-slot-mode-pill {
  display: block !important;          /* override base .rbp-slot-grid grid columns */
  grid-template-columns: none !important;
  background: transparent;
}
.rbp-slot-pill-group {
  margin-bottom: 18px;
}
/* v5.11.3: Day-part tab bar (Booking.com style) — shown when a period has >6 slots. */
.rbp-slot-pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eef0f2;
  padding-bottom: 12px;
}
.rbp-slot-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s ease-out;
}
.rbp-slot-pill-tab:hover {
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
}
.rbp-slot-pill-tab.active {
  background: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  color: #fff;
}
.rbp-slot-pill-tab-count {
  font-size: 11px;
  font-weight: 700;
  opacity: .7;
  background: rgba(0,0,0,.06);
  border-radius: 8px;
  padding: 0 6px;
}
.rbp-slot-pill-tab.active .rbp-slot-pill-tab-count {
  background: rgba(255,255,255,.22);
  opacity: 1;
}
.rbp-slot-pill-group:last-child { margin-bottom: 0; }
.rbp-slot-pill-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6b7280;
}
.rbp-slot-pill-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(0,0,0,.08), rgba(0,0,0,0));
  margin-left: 4px;
}
.rbp-slot-pill-group-icon { font-size: 14px; }
.rbp-slot-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Pill = single time button */
.rbp-slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
  min-width: 76px;
  justify-content: center;
}
.rbp-slot-pill .sl-time {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.rbp-slot-pill .sl-name {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  margin-left: 4px;
}
.rbp-slot-pill .sl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;       /* green = available */
  flex-shrink: 0;
}
.rbp-slot-pill.rbp-slot-warning .sl-dot { background: #f59e0b; }  /* amber = few left */
.rbp-slot-pill:hover:not(.rbp-slot-full) {
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(192, 57, 43, .12);
}
.rbp-slot-pill.selected {
  background: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  color: #fff;
}
.rbp-slot-pill.selected .sl-name { color: rgba(255,255,255,.85); }
.rbp-slot-pill.selected .sl-dot  { background: #fff; }
.rbp-slot-pill.rbp-slot-full {
  background: #f9fafb;
  border-color: #e5e7eb;
  border-style: dashed;
  color: #9ca3af;
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.rbp-slot-pill.rbp-slot-full .sl-dot { background: #d1d5db; }
.rbp-slot-pill .sl-badge {
  position: absolute;
  top: -6px;
  right: -2px;
  background: var(--rbp-slot-badge-bg, #c0392b);
  color: var(--rbp-slot-badge-txt, #fff);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: .04em;
  white-space: nowrap;
}
/* v5.11.3: inline scarcity nudge ("Only N left") — amber, sits after the time. */
.rbp-slot-pill .sl-few {
  font-size: 10px;
  font-weight: 700;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 2px;
  white-space: nowrap;
}
.rbp-slot-pill.selected .sl-few {
  color: #fff;
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.45);
}

@media (max-width: 480px) {
  .rbp-slot-pill { font-size: 13px; padding: 8px 12px; min-width: 70px; }
  .rbp-slot-pill .sl-name { display: none; }   /* compact on mobile */
}

/* ───────────────────────────────────────────────────────────────────────────
   §2b. v5.11.1 FIX — Pill-mode arrival-time panel.
   The inline arrival-time picker is rendered in a dedicated full-width panel
   BELOW the pill rows (never inside a round pill), eliminating the "green blob"
   bug. Styled as a clean Resy / OpenTable refinement panel.
   ─────────────────────────────────────────────────────────────────────────── */
.rbp-slot-pill-timepanel:empty { display: none; }
.rbp-slot-pill-timepanel {
  display: block;
  width: 100%;
  grid-column: 1 / -1;               /* belt-and-suspenders: span full row if ever in a grid */
  margin-top: 16px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  animation: rbpTimePanelIn .22s cubic-bezier(.2,.7,.3,1);
}
@keyframes rbpTimePanelIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rbp-slot-pill-timepanel .rbp-inline-times {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.rbp-slot-pill-timepanel .rbp-it-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6b7280;
  text-align: left;
  margin-bottom: 10px;
}
.rbp-slot-pill-timepanel .rbp-it-btns {
  justify-content: flex-start;
  gap: 8px;
}
.rbp-slot-pill-timepanel .rbp-it-btn {
  border-radius: 999px;
  min-width: 64px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid #e5e7eb;
}
.rbp-slot-pill-timepanel .rbp-it-btn:hover {
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  background: #fff;
}
.rbp-slot-pill-timepanel .rbp-it-btn.rbp-it-active {
  background: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  color: #fff;
}

/* Defensive: a selected pill stays a pill — never grows to wrap block content. */
.rbp-slot-mode-pill .rbp-slot-pill { overflow: visible; }

/* ───────────────────────────────────────────────────────────────────────────
   §3. NEW — Service 'hero' mode (Airbnb listing style).
   Full-width image on top, content below with generous spacing.
   ─────────────────────────────────────────────────────────────────────────── */
.rbp-svc-luxury-grid.rbp-svc-style-hero {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 22px !important;
}
@media (max-width: 660px) {
  .rbp-svc-luxury-grid.rbp-svc-style-hero {
    grid-template-columns: 1fr !important;
  }
}

.rbp-svc-style-hero .rbp-svc-luxury-card {
  display: block;
  text-align: left;
  padding: 0;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.rbp-svc-style-hero .rbp-svc-img-wrap {
  width: 100%;
  height: 220px;
  position: relative;
  overflow: hidden;
  margin: 0;
}
.rbp-svc-style-hero .rbp-svc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s cubic-bezier(.2,.7,.3,1);
}
.rbp-svc-style-hero .rbp-svc-luxury-card:hover .rbp-svc-img { transform: scale(1.04); }
.rbp-svc-style-hero .rbp-svc-color-bar {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rbp-svc-style-hero .rbp-svc-color-bar-icon { font-size: 56px; opacity: .9; }
.rbp-svc-style-hero .rbp-svc-body {
  padding: 18px 20px 20px;
}
/* v5.11.3: hero showcase polish (Trip.com / GetYourGuide feel) — additive only.
   A soft hover lift and a subtle bottom scrim on the image for depth. Does not
   touch card structure, selection state, or the tick animation. */
.rbp-svc-style-hero .rbp-svc-luxury-card {
  transition: transform .18s cubic-bezier(.2,.7,.3,1), box-shadow .18s ease-out, border-color .18s ease-out;
}
.rbp-svc-style-hero .rbp-svc-luxury-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
}
.rbp-svc-style-hero .rbp-svc-img-overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 38%;
  background: linear-gradient(to top, rgba(0,0,0,.28), rgba(0,0,0,0));
  pointer-events: none;
}
.rbp-svc-style-hero .rbp-svc-badges {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.rbp-svc-style-hero .rbp-svc-badge {
  background: #f3f4f6;
  color: #374151;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.rbp-svc-style-hero .rbp-svc-badge-perpax { background: #ecfdf5; color: #047857; }
.rbp-svc-style-hero .rbp-svc-badge-from   { background: #fef3c7; color: #92400e; }
.rbp-svc-style-hero .rbp-svc-badge-fixed  { background: #ede9fe; color: #6d28d9; }
.rbp-svc-style-hero .rbp-svc-badge-time   { background: #f1f5f9; color: #475569; }
.rbp-svc-style-hero .rbp-svc-name {
  display: block;
  font-size: 19px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
  margin: 0 0 6px;
}
.rbp-svc-style-hero .rbp-svc-desc,
.rbp-svc-style-hero .rbp-svc-meta-dl {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.55;
  margin: 0 0 14px;
}
.rbp-svc-style-hero .rbp-svc-meta-dl { display: grid; gap: 4px; }
.rbp-svc-style-hero .rbp-svc-meta-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 8px;
}
.rbp-svc-style-hero .rbp-svc-meta-key { color: #9ca3af; font-weight: 500; }
.rbp-svc-style-hero .rbp-svc-meta-val { color: #374151; font-weight: 600; }
.rbp-svc-style-hero .rbp-svc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
  margin-top: 6px;
}
.rbp-svc-style-hero .rbp-svc-price {
  font-size: 18px;
  font-weight: 800;
}
.rbp-svc-style-hero .rbp-svc-select-btn {
  background: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .15s;
}
.rbp-svc-style-hero .rbp-svc-luxury-card:hover .rbp-svc-select-btn {
  background: #a02d22;
}
.rbp-svc-style-hero .rbp-svc-luxury-card.rbp-svc-luxury-card-selected,
.rbp-svc-style-hero .rbp-svc-luxury-card.rbp-svc-selected {
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  box-shadow: 0 4px 18px rgba(192, 57, 43, .18);
}
.rbp-svc-style-hero .rbp-svc-selected-tick {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
}
.rbp-svc-style-hero .rbp-svc-luxury-card-selected .rbp-svc-selected-tick,
.rbp-svc-style-hero .rbp-svc-selected .rbp-svc-selected-tick {
  opacity: 1;
  animation: rbpTickIn .26s cubic-bezier(.2,.7,.3,1.4);
}

/* ───────────────────────────────────────────────────────────────────────────
   §7. v5.11.3 — Package "Most popular" highlight (auto best-value, display-only).
   Highlights the middle priced tier with a ribbon + accent border, the way
   pricing pages (Trip.com rate plans, SaaS tiers) anchor the recommended choice.
   Purely presentational — selection + pricing logic untouched.
   ─────────────────────────────────────────────────────────────────────────── */
.rbp-pkg-card.rbp-pkg-popular {
  border-color: var(--rbp-slot-primary, var(--rbp-primary, #c0392b)) !important;
  box-shadow: 0 6px 22px rgba(192,57,43,.14);
}
.rbp-pkg-popular-ribbon {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--rbp-slot-primary, var(--rbp-primary, #c0392b));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
