/* Zovya Travels — Planner gadget stylesheet (site-wide drawer).
   Floating edge tab (right-center) + side box sliding out from the trigger.
   Reuses hero-style.css planner field classes (.trip-planner-box,
   .planner-grid, .input-*, .ms-*, .btn-island-btn) with a single-column
   override below. Only chrome defined here: tab, drawer card, motion.
   Depends on header-style.css tokens + hero-style.css.
   Web Interface Guidelines: touch-action, tap highlight, overscroll contain,
   safe-area insets, :focus-visible rings, transform/opacity-only motion with
   reduced-motion cutoff. */

/* Floating tab: fixed right edge, vertically centered */
.pp-fab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transform-origin: right center;
  z-index: 80;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, #E2C87A 0%, #D4AF37 55%, #B89230 100%);
  color: #0B0F1A;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-right: none;
  border-radius: 14px 0 0 14px;
  padding: 16px 12px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: -6px 6px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(201, 168, 76, 0.4);
  transition: opacity 300ms ease, visibility 300ms ease, filter 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  animation: ppFabIn 600ms cubic-bezier(0.32, 0.72, 0, 1) 800ms backwards;
}
.pp-fab i { font-size: 18px; filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.4)); }
.pp-fab span {
  writing-mode: vertical-rl;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.pp-fab:hover { filter: brightness(1.07); box-shadow: -6px 6px 24px rgba(0, 0, 0, 0.45), 0 0 28px rgba(201, 168, 76, 0.55); transform: translateY(-50%) translateX(-3px); }
.pp-fab:active { transform: translateY(-50%) scale(0.97); }
.pp-fab:focus-visible { outline: 2px solid #0B0F1A; outline-offset: -4px; }
/* One-time entrance nudge (runs once, interruptible, off under reduced-motion) */
@keyframes ppFabIn {
  from { opacity: 0; transform: translateY(-50%) translateX(100%); }
  to { opacity: 1; transform: translateY(-50%) translateX(0); }
}
/* Tab hides while its own modal is open */
.pp-root.is-open .pp-fab { opacity: 0; visibility: hidden; pointer-events: none; }

/* Side box: docked right-center card sliding out from the trigger tab.
   Hidden state sits fully off-screen right; open state docks flush right.
   transform-origin keeps the motion anchored at the tab edge. */
.pp-panel {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%) translateX(110%);
  transform-origin: right center;
  z-index: 9000;
  width: min(400px, calc(100vw - 24px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  background: #FFFFFF;
  border: 1px solid rgba(201, 168, 76, 0.55);
  border-right: none;
  border-radius: 18px 0 0 18px;
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.45), 0 0 24px rgba(201, 168, 76, 0.25);
  transition: transform 350ms cubic-bezier(0.32, 0.72, 0, 1), visibility 350ms ease;
}
.pp-panel[hidden] { display: none; }
.pp-root.is-open .pp-panel { transform: translateY(-50%) translateX(0); visibility: visible; }

/* Single-column fields inside the narrow box (beats hero multi-col grids) */
.pp-panel .planner-grid { grid-template-columns: 1fr; }
.pp-panel .planner-search { grid-column: auto; }
.pp-panel .trip-planner-box { padding: 22px 18px; border-radius: 0; box-shadow: none; }
.pp-panel .planner-head { gap: 12px; margin-bottom: 18px; }
.pp-panel .planner-head::before, .pp-panel .planner-head::after { content: none; }
.pp-panel .planner-title { flex: 1; min-width: 0; text-wrap: balance; font-size: 22px; white-space: nowrap; }

/* Compulsory Type field (JS submit gate): required asterisk + error line.
   Error shows only after a failed submit (role=alert announces it); the
   trigger gets an aria-invalid red border + ring as the non-color cue. */
.pp-req { color: #B42318; font-weight: 800; }
.pp-err {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #B42318;
}
.pp-err[hidden] { display: none; }
.pp-err i { margin-top: 2px; font-size: 12px; flex-shrink: 0; }
.pp-panel .ms-btn[aria-invalid="true"] {
  border-color: #B42318;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.14);
}

/* Mobile fullscreen chrome (drawer mirrors): hidden on desktop */
.pp-mob-head, .pp-mob-foot { display: none; }
.pp-mob-scroll { display: contents; }
.pp-close {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border-light);
  background: #FFFFFF;
  color: var(--color-navy);
  font-size: 16px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.pp-close:hover { border-color: var(--color-gold); color: var(--color-gold-muted); transform: scale(1.06); }
.pp-close:active { transform: scale(0.96); }
.pp-close:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }

/* Gadget responsive: mobile opens fullscreen like the menu drawer —
   dark shell, logo header, centered form, Call/WhatsApp footer. */
@media (max-width: 768px) {
  .pp-fab { padding: 10px 6px; min-width: 34px; gap: 0; border-radius: 10px 0 0 10px; }
  .pp-fab i { display: none; }
  .pp-fab span { font-size: 10px; }
  .pp-panel {
    top: 0; bottom: 0; left: 0; right: 0;
    width: auto; max-height: none; height: 100vh; height: 100dvh;
    overflow: hidden;
    background: #0B0F1A;
    border: none; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column;
    padding: 24px 20px;
    padding-top: max(24px, env(safe-area-inset-top, 0px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    transform: translateX(102%);
  }
  .pp-root.is-open .pp-panel { transform: none; }
  .pp-mob-head { display: flex; }
  .pp-mob-scroll {
    display: flex; flex-direction: column; justify-content: center;
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch; padding: 16px 0;
  }
  .pp-mob-foot { display: flex; }
  .pp-panel .planner-head .pp-close { display: none; }
  .pp-panel .trip-planner-box { padding: 20px 16px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .pp-fab, .pp-panel, .pp-close { transition: none; animation: none; }
  .pp-fab:hover, .pp-fab:active { transform: translateY(-50%); }
  .pp-panel { transform: translateY(-50%); }
}
