/* ================================================================
   QwikGlam — Header Patch v7.1
   APPEND THIS FILE after qg-global.css in functions.php
   Fixes:
     1. Announcement bar + header locked together as fixed unit
     2. City dropdown collapse/expand now works correctly
     3. Concierge button — round, golden, world-class luxury FAB
     4. Gold accent line on header scroll
     5. Body offset via CSS variable (auto-adjusts when bar dismissed)
   ================================================================ */


/* ── 1. HEADER GROUP WRAPPER ───────────────────────────────────
   Both the announcement bar and header live inside .qg-header-wrap.
   The wrapper is fixed. The children are position:relative inside it.
   This means bar + header ALWAYS move together — no gap on scroll.
   ────────────────────────────────────────────────────────────── */
.qg-header-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  /* No background — children carry their own backgrounds */
}

/* Override the old standalone fixed positioning */
.qg-header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  /* Glassmorphism bg only when scrolled — handled via .scrolled class */
}

/* CSS variable drives body offset — updated by JS when bar is dismissed */
:root {
  --qg-bar-h:    36px;
  --qg-hdr-h:    72px;
  --qg-offset:   calc(var(--qg-bar-h) + var(--qg-hdr-h)); /* 108px */
}

body {
  padding-top: var(--qg-offset);
  transition: padding-top .36s ease;
}

/* When bar is dismissed: JS sets --qg-bar-h to 0, padding auto-updates */
body.qg-bar-hidden {
  --qg-bar-h: 0px;
}

/* The old rule — neutralised; wrapper approach replaces it */
body.qg-bar-hidden .qg-header {
  top: auto !important;
}


/* ── 2. CITY DROPDOWN — CLASS-BASED TOGGLE ──────────────────────
   Root cause of "always expanded" bug:
   CSS `display: grid` on .qg-city-dropdown has higher specificity than
   the browser UA `[hidden] { display:none }`, so the hidden attribute
   was silently ignored.
   Fix: hide by default in CSS; show only when .is-open is added by JS.
   ────────────────────────────────────────────────────────────── */
.qg-city-dropdown {
  display: none !important;   /* hidden by default — overrides display:grid */
}

.qg-city-dropdown.is-open {
  display: grid !important;   /* shown only when JS adds .is-open */
  animation: qgDropIn .2s ease forwards;
}

@keyframes qgDropIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* City dropdown full layout (restored, now class-guarded) */
.qg-city-dropdown.is-open {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: linear-gradient(145deg, #200E3A 0%, #1C0A2E 100%);
  border: 1px solid rgba(212,175,106,.25);
  border-radius: 18px;
  padding: 10px;
  min-width: 280px;
  box-shadow:
    0 24px 64px rgba(10,4,22,.55),
    0 0 0 1px rgba(212,175,106,.08) inset;
  grid-template-columns: 1fr;
  gap: 0;
  z-index: 200;
}

.qg-city-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

/* Detect button — full width row above grid */
.qg-city-detect {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: rgba(212,175,106,.1);
  border: 1px solid rgba(212,175,106,.2);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--qg-gold);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 6px;
  transition: background .2s;
}

.qg-city-detect:hover {
  background: rgba(212,175,106,.18);
}

.qg-city-divider {
  display: none; /* detect button margin handles spacing */
}

.qg-city-footer {
  grid-column: 1 / -1;
  padding: 8px 12px 2px;
  color: rgba(255,255,255,.35);
  font-size: .7rem;
  display: flex;
  align-items: center;
  gap: 5px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 4px;
}

.qg-city-footer span {
  display: flex;
  align-items: center;
  gap: 5px;
}


/* ── 3. GOLD ACCENT LINE (scroll indicator) ─────────────────────
   A 2 px gold hairline appears at the bottom of the header
   once the user has scrolled — a subtle luxury detail.
   ────────────────────────────────────────────────────────────── */
.qg-header__accent-line {
  position: absolute;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--qg-gold), transparent);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.qg-header.scrolled .qg-header__accent-line {
  opacity: .35;
}


/* ── 4. HEADER — always dark; glassmorphism enhances on scroll ──
   ROOT CAUSE FIX (transparent header on page load):
   Header had NO background initially — on the light/beige hero image
   white text became invisible. Fix: permanent dark base always.
   Scrolled state adds blur + stronger shadow on top of the base.
   ────────────────────────────────────────────────────────────── */
.qg-header {
  background: rgba(22, 8, 40, 0.97) !important;
}

.qg-header.scrolled {
  background: rgba(18, 6, 34, 0.98) !important;
  backdrop-filter: blur(28px) saturate(1.8) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.8) !important;
  box-shadow:
    0 4px 32px rgba(10,4,22,.55),
    0 1px 0 rgba(212,175,106,.12) inset !important;
}

/* Gold hairline intensifies once scrolled */
.qg-header.scrolled .qg-header__accent-line {
  opacity: .5;
}

/* ── Hero: full-bleed — header overlays the image, not stacked below it.
   On homepage, undo the body padding-top push for the hero section only,
   so the hero fills the full viewport edge-to-edge behind the header.
   ────────────────────────────────────────────────────────────── */
body.home .qg-hero,
body.page-template-home-qwikglam .qg-hero {
  margin-top: calc(-1 * var(--qg-offset));
  padding-top: var(--qg-offset);
  min-height: 100svh;
  box-sizing: border-box;
}


/* ── 5. CONCIERGE BUTTON — ROUND · GOLDEN · WORLD-CLASS FAB ─────
   A perfect 60px gold circle. Pulsing glow. Diamond icon.
   No text label — icon alone reads perfectly at this scale.
   ────────────────────────────────────────────────────────────── */
.qg-concierge {
  /* Layout */
  position: fixed;
  bottom: 32px;
  right: 28px;
  z-index: 9975;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0;
  border: none;
  outline: none;

  /* Gold gradient — Hermès-level richness */
  background:
    radial-gradient(circle at 35% 35%, #F0D898 0%, #D4AF6A 45%, #B8860B 100%);

  /* Layered shadow: depth + gold halo */
  box-shadow:
    0 8px 28px rgba(212,175,106,.60),
    0 2px 8px  rgba(10,4,22,.30),
    0 0 0 0 rgba(212,175,106,.30);

  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  /* Subtle border ring — acts as a second halo ring */
  outline: 2px solid rgba(240,216,152,.25);
  outline-offset: 3px;

  /* Transitions */
  transition:
    transform .3s cubic-bezier(.34,1.56,.64,1),
    box-shadow .3s ease,
    outline-color .3s ease;

  /* Pulse animation — draws attention gently */
  animation: qgConciergeFloat 4s ease-in-out infinite,
             qgConciergePulse 3.5s ease-in-out infinite;
}

/* Subtle floating */
@keyframes qgConciergeFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* Gold pulse ring */
@keyframes qgConciergePulse {
  0%, 100% {
    box-shadow:
      0 8px 28px rgba(212,175,106,.60),
      0 2px 8px  rgba(10,4,22,.30),
      0 0 0 0   rgba(212,175,106,.35);
  }
  60% {
    box-shadow:
      0 8px 28px rgba(212,175,106,.60),
      0 2px 8px  rgba(10,4,22,.30),
      0 0 0 14px rgba(212,175,106,.0);
  }
}

.qg-concierge:hover {
  transform: scale(1.14) translateY(-5px) !important;
  box-shadow:
    0 16px 48px rgba(212,175,106,.75),
    0 4px 16px  rgba(10,4,22,.35),
    0 0 0 0 rgba(212,175,106,0);
  outline-color: rgba(240,216,152,.55);
  animation-play-state: paused; /* pause float on hover */
}

.qg-concierge:active {
  transform: scale(.96) !important;
  transition: transform .1s ease;
}

/* Inner ✦ diamond icon — deep plum on gold */
.qg-concierge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1C0A2E;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 1px 2px rgba(10,4,22,.2));
}

.qg-concierge__icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.6;
}

/* Hide text label — round button, icon speaks alone */
.qg-concierge__label {
  display: none;
}

/* ── Tooltip on hover ── */
.qg-concierge::before {
  content: "Concierge";
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: linear-gradient(135deg, #1C0A2E, #2E1650);
  color: var(--qg-gold);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(212,175,106,.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 4px 16px rgba(10,4,22,.3);
}

.qg-concierge:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .qg-concierge {
    bottom: 80px;  /* above mobile bottom nav */
    right: 16px;
    width: 52px;
    height: 52px;
  }
  .qg-concierge__icon { width: 22px; height: 22px; }
  .qg-concierge__icon svg { width: 18px; height: 18px; }
  .qg-concierge::before { display: none; } /* no tooltip on touch */
}

@media (max-width: 480px) {
  .qg-concierge { bottom: 88px; right: 12px; width: 48px; height: 48px; }
}

/* ── OVERLAP FIX: Back-to-top button sits above the concierge FAB ──
   Concierge: bottom 32px, height 60px → top edge at 92px from bottom.
   Back-to-top: place at bottom: 104px so there's 12px breathing room.
   ────────────────────────────────────────────────────────────────── */
#qgBackToTop {
  bottom: 104px !important;
  right: 28px !important;
}

@media (max-width: 900px) {
  /* Concierge moves to 80px on mobile → back-to-top above it */
  #qgBackToTop { bottom: 148px !important; right: 16px !important; }
}

@media (max-width: 480px) {
  #qgBackToTop { bottom: 152px !important; right: 12px !important; }
}


/* ── 6. ANNOUNCEMENT BAR — small upgrades ─────────────────────── */
.qg-announcement-bar {
  /* Richer gradient instead of flat plum */
  background: linear-gradient(90deg, #150826 0%, #1C0A2E 40%, #220D36 100%);
  border-bottom: 1px solid rgba(212,175,106,.12);
}

/* Hide bar via max-height (already in global), just ensure smooth */
.qg-announcement-bar.hidden {
  max-height: 0 !important;
  overflow: hidden;
  border-bottom-width: 0;
}


/* ── 7. HEADER HIDE/SHOW — smoother transition ─────────────────── */
.qg-header.hide  {
  transform: translateY(-110%);
  transition: transform .4s cubic-bezier(.4,0,1,1);
}
.qg-header.show  {
  transform: translateY(0);
  transition: transform .35s cubic-bezier(0,0,.2,1);
}


/* ── 9. NAV — SINGLE LINE FIX ───────────────────────────────────
   Problem: "MY-BOOKINGS", "CUSTOMER LOGIN", "ARTIST LOGIN" wrap
   to 2 lines because uppercase + wide padding fills the header.
   Fix: white-space:nowrap on links + tighter font/spacing
   ────────────────────────────────────────────────────────────── */

/* Tighten the header inner row */
.qg-header__inner {
  gap: 1.2rem !important;
  padding: 0 clamp(.9rem, 2vw, 1.6rem) !important;
}

/* Nav takes only the space it needs */
.qg-nav { margin-left: 0 !important; flex-shrink: 0; }

/* All nav links — one line, tighter text */
.qg-nav__menu li a {
  white-space: nowrap !important;
  font-size: .75rem !important;
  letter-spacing: .025em !important;
  padding: 8px 10px !important;
}

/* Artist Login link — a subtle gold pill to distinguish it */
.qg-nav__item--artist a,
.qg-nav__menu li a[href*="artist-login"] {
  color: var(--qg-gold) !important;
  border: 1px solid rgba(212,175,106,.25);
  border-radius: 99px;
  padding: 6px 12px !important;
  transition: background .2s, border-color .2s;
}
.qg-nav__item--artist a:hover,
.qg-nav__menu li a[href*="artist-login"]:hover {
  background: rgba(212,175,106,.1);
  border-color: rgba(212,175,106,.5);
  color: var(--qg-champagne) !important;
}

/* City selector — slightly smaller */
.qg-city-btn {
  font-size: .74rem !important;
  padding: 5px 10px !important;
}

/* Login ghost button — tighter */
.qg-btn--glow {
  padding: 8px 16px !important;
  font-size: .78rem !important;
  border-radius: 10px !important;
  white-space: nowrap;
}


/* ── 10. BOOK NOW BUTTON — WORLD-CLASS REDESIGN ─────────────────
   Solid deep plum bg + Hermès gold text + gold border + calendar icon.
   Pill shape. Inner glow on hover. Subtle shimmer sweep animation.
   ────────────────────────────────────────────────────────────── */
.qg-btn--book-now {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  padding: 10px 22px !important;
  border-radius: 99px !important;       /* pill — more premium than rect */
  background: var(--qg-gold) !important;
  border: none !important;
  color: var(--qg-plum) !important;     /* deep plum text on gold */
  font-size: .8rem !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  overflow: hidden;
  box-shadow:
    0 4px 20px rgba(212,175,106,.45),
    0 1px 0 rgba(255,255,255,.15) inset;
  transition:
    background .25s ease,
    box-shadow .25s ease,
    transform .2s cubic-bezier(.34,1.56,.64,1);
}

/* Shimmer sweep — luxury micro-animation */
.qg-btn--book-now::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg,
    transparent 35%,
    rgba(255,255,255,.28) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  transition: transform .55s ease;
}

.qg-btn--book-now:hover::after {
  transform: translateX(100%);
}

.qg-btn--book-now:hover {
  background: var(--qg-champagne) !important;
  box-shadow:
    0 8px 32px rgba(212,175,106,.65),
    0 1px 0 rgba(255,255,255,.2) inset;
  transform: translateY(-2px) scale(1.03);
}

.qg-btn--book-now:active {
  transform: translateY(0) scale(.98);
  transition: transform .1s ease;
}

/* Calendar icon inside button — inherits plum color */
.qg-btn--book-now svg {
  flex-shrink: 0;
  color: var(--qg-plum) !important;
  opacity: .85;
}


/* ── 11. HEADER INNER: live booking count badge ─────────────────── */
.qg-header-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37,211,102,.12);
  border: 1px solid rgba(37,211,102,.25);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: .68rem;
  font-weight: 600;
  color: #2DDA6F;
  letter-spacing: .03em;
  white-space: nowrap;
}

.qg-header-live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2DDA6F;
  flex-shrink: 0;
  animation: qgLiveDot 1.8s ease-in-out infinite;
}

@keyframes qgLiveDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}

/* ── 12. GAP FIX — COMPLETE REWRITE ─────────────────────────────
   ROOT CAUSE: Line 29 sets .qg-header { position:relative !important;
   top:auto !important } — this works only if .qg-header-wrap exists
   in the HTML. Without the wrapper, position:relative + top:auto means
   the header just flows in the document and ignores every top value.
   body padding-top stays 108px while actual bar+header on mobile is
   only 88px → 20px ivory gap showing through between bar and header.

   FIX: Force both bar and header to position:fixed and sync tops.
   ────────────────────────────────────────────────────────────── */

/* Pin announcement bar as fixed — it was position:relative before */
.qg-announcement-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 9991 !important;
}

/* Restore header as fixed directly below bar, overrides relative+auto */
.qg-header {
  position: fixed !important;
  top: 36px !important;
  left: 0 !important;
  right: 0 !important;
}

body.qg-bar-hidden .qg-header { top: 0 !important; }

/* Re-sync body offset to actual fixed heights */
body { padding-top: calc(36px + 72px) !important; }
body.qg-bar-hidden { padding-top: 72px !important; }

/* Mobile: bar shrinks to 32px in qg-global.css — match header top */
@media (max-width: 768px) {
  :root { --qg-bar-h: 32px; }
  .qg-header { top: 32px !important; }
  body { padding-top: calc(32px + 56px) !important; }
  body.qg-bar-hidden { padding-top: 56px !important; }
}

/* Small phone: bar shrinks to 28px */
@media (max-width: 430px) {
  :root { --qg-bar-h: 28px; }
  .qg-header { top: 28px !important; }
  body { padding-top: calc(28px + 52px) !important; }
  body.qg-bar-hidden { padding-top: 52px !important; }
}