/* =====================================================================
   SERVICE CARD — qgc  (services page grid)

   Markup: renderCards() in assets/js/qg-services.js.

   Why a namespace: qg-services.css, qg-services-additions.css and
   qg-services-mobile-master.css carry ~45 rules on .qg-ultra-* (most of them
   !important, several at mobile-only breakpoints). Every inner element here
   uses its own qgc- class, so none of those rules reach it. Only two old
   classes remain, because JS depends on them:
     • .qg-ultra-card     — the card root (booking popup, wishlist, keyboard)
     • .qg-card-wish-btn  — the wishlist toggle
   Both are reset from an `html body #qgServicesGrid` selector, which outranks
   every earlier !important rule (the strongest is 1-3-1) regardless of the
   order LiteSpeed emits the stylesheets in.

   Layout adapts to the card's own width (container queries), not the
   viewport — so the 3-up desktop grid, the 2-up tablet grid, the 2-up phone
   grid and the phone list view each get the right composition.
   ===================================================================== */

html body #qgServicesGrid .qg-ultra-card.qgc {
  --qgc-ink:    #231019;
  --qgc-ink-2:  #5E4854;
  --qgc-ink-3:  #8F7A86;
  --qgc-rose:   #B83A66;
  --qgc-rose-2: #D4547A;
  --qgc-gold:   #9A6F2E;
  --qgc-line:   rgba(35,16,25,.08);
  --qgc-ease:   cubic-bezier(.2,.8,.2,1);

  container-type: inline-size;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  isolation: isolate;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-align: left !important;
  background: #fff !important;
  border: 1px solid var(--qgc-line) !important;
  border-radius: 22px !important;
  box-shadow: 0 1px 2px rgba(35,16,25,.04), 0 8px 24px -12px rgba(35,16,25,.14) !important;
  transform: none;
  animation: none !important;
  transition: transform .5s var(--qgc-ease), box-shadow .5s var(--qgc-ease), border-color .3s ease !important;
  cursor: pointer !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--qgc-ink);
}
html body #qgServicesGrid .qg-ultra-card.qgc::before,
html body #qgServicesGrid .qg-ultra-card.qgc::after { display: none !important; content: none !important; }

@media (hover: hover) {
  html body #qgServicesGrid .qg-ultra-card.qgc:hover {
    transform: translateY(-4px) !important;
    border-color: rgba(35,16,25,.12) !important;
    box-shadow: 0 2px 4px rgba(35,16,25,.04), 0 22px 44px -18px rgba(35,16,25,.28) !important;
  }
  html body #qgServicesGrid .qgc:hover .qgc-img { transform: scale(1.045); }
  html body #qgServicesGrid .qgc:hover .qgc-cta { background: var(--qgc-rose); }
  html body #qgServicesGrid .qgc:hover .qgc-cta svg { transform: translateX(2px); }
}
html body #qgServicesGrid .qg-ultra-card.qgc:focus-visible {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--qgc-rose-2) !important;
}
html body #qgServicesGrid .qg-ultra-card.qgc:active { transform: scale(.992) !important; }

/* ── Media ─────────────────────────────────────────────────────────── */
html body #qgServicesGrid .qgc .qgc-media {
  position: relative;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #F6E7EC, #EFDCE3);
}
html body #qgServicesGrid .qgc .qgc-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 18%;
  display: block; margin: 0; max-width: none;
  transition: transform 1.1s var(--qgc-ease);
}
html body #qgServicesGrid .qgc .qgc-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(20,6,14,.28) 0%, rgba(20,6,14,0) 26%),
    linear-gradient(0deg,  rgba(20,6,14,.42) 0%, rgba(20,6,14,0) 34%);
}

/* glass pill shared by chip + duration */
html body #qgServicesGrid .qgc .qgc-chip,
html body #qgServicesGrid .qgc .qgc-dur {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em; line-height: 1;
  color: #fff; white-space: nowrap;
  background: rgba(24,8,17,.38);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
html body #qgServicesGrid .qgc .qgc-chip {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  max-width: calc(100% - 70px); overflow: hidden; text-overflow: ellipsis;
}
html body #qgServicesGrid .qgc .qgc-dur svg { width: 12px; height: 12px; flex-shrink: 0; }

html body #qgServicesGrid .qgc .qgc-tags {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
html body #qgServicesGrid .qgc .qgc-tags .qgc-dur { margin-left: auto; }
html body #qgServicesGrid .qgc .qgc-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px;
  border-radius: 999px; background: #fff; color: var(--qgc-ink);
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(20,6,14,.18);
}
html body #qgServicesGrid .qgc .qgc-badge--save { background: #1F7A4D; color: #fff; }

/* Wishlist — keeps .qg-card-wish-btn for the JS toggle */
html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish {
  position: absolute !important; top: 10px !important; right: 10px !important;
  left: auto !important; bottom: auto !important; z-index: 3 !important;
  width: 36px !important; height: 36px !important;
  min-width: 36px !important; min-height: 36px !important; max-width: none !important; max-height: none !important;
  flex: none !important; margin: 0 !important; padding: 0 !important;
  display: grid !important; place-items: center !important;
  border: 0 !important; border-radius: 50% !important;
  background: rgba(255,255,255,.86) !important;
  -webkit-backdrop-filter: saturate(160%) blur(12px) !important;
  backdrop-filter: saturate(160%) blur(12px) !important;
  box-shadow: 0 2px 10px rgba(20,6,14,.16) !important;
  opacity: 1 !important; cursor: pointer !important;
  transition: transform .25s var(--qgc-ease), background .2s ease !important;
}
html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish:hover { background: #fff !important; transform: scale(1.06) !important; }
html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish:active { transform: scale(.9) !important; }
html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish:focus-visible { outline: 2px solid var(--qgc-rose-2) !important; outline-offset: 2px !important; }
html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish svg {
  width: 17px !important; height: 17px !important; display: block !important;
  stroke: var(--qgc-ink) !important; fill: none !important;
  transition: fill .2s ease, stroke .2s ease, transform .35s var(--qgc-ease) !important;
}
html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish.is-wished svg {
  stroke: var(--qgc-rose-2) !important; fill: var(--qgc-rose-2) !important;
  animation: qgcPop .4s var(--qgc-ease);
}
@keyframes qgcPop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }

/* ── Body ──────────────────────────────────────────────────────────── */
html body #qgServicesGrid .qgc .qgc-body {
  display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0;
  padding: 16px 18px 18px;
}
html body #qgServicesGrid .qgc .qgc-eyebrow {
  display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 0 0 8px;
}
html body #qgServicesGrid .qgc .qgc-new {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; background: #FBEAF0; color: var(--qgc-rose);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
html body #qgServicesGrid .qgc .qgc-new svg { width: 10px; height: 10px; }
/* min-height:0 — a site-wide mobile rule gives every button 48px, which
   pushed a rated card's title 26px below its unrated neighbour's. */
html body #qgServicesGrid .qgc .qgc-rating {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; min-height: 0 !important; padding: 0; margin: 0;
  border: 0; background: none; cursor: pointer; font: inherit; color: var(--qgc-ink);
  font-size: .8rem;
}
html body #qgServicesGrid .qgc .qgc-rating svg { width: 13px; height: 13px; fill: #E3A33A; }
html body #qgServicesGrid .qgc .qgc-rating b { font-weight: 700; }
html body #qgServicesGrid .qgc .qgc-rating span { color: var(--qgc-ink-3); }
html body #qgServicesGrid .qgc .qgc-rating:hover span { text-decoration: underline; }
html body #qgServicesGrid .qgc .qgc-surge {
  display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 600; color: #B4541F;
}
html body #qgServicesGrid .qgc .qgc-surge svg { width: 11px; height: 11px; }
html body #qgServicesGrid .qgc .qgc-where {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto;
  font-size: .76rem; font-weight: 500; color: var(--qgc-ink-3); white-space: nowrap;
}
html body #qgServicesGrid .qgc .qgc-where svg { width: 13px; height: 13px; }

html body #qgServicesGrid .qgc .qgc-title {
  margin: 0; padding: 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1.3rem; font-weight: 600; line-height: 1.22; letter-spacing: -.005em;
  color: var(--qgc-ink); text-align: left;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: balance;
}
html body #qgServicesGrid .qgc .qgc-desc {
  margin: 6px 0 0; font-size: .86rem; line-height: 1.5; color: var(--qgc-ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
html body #qgServicesGrid .qgc .qgc-perks {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
html body #qgServicesGrid .qgc .qgc-perks li {
  display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 0;
  font-size: .78rem; font-weight: 500; color: var(--qgc-ink-2); line-height: 1.3;
}
html body #qgServicesGrid .qgc .qgc-perks li::before { content: none; }
html body #qgServicesGrid .qgc .qgc-perks svg { width: 13px; height: 13px; color: #1F7A4D; flex-shrink: 0; }
html body #qgServicesGrid .qgc .qgc-proof { margin: 8px 0 0; font-size: .76rem; color: var(--qgc-ink-3); }

/* ── Footer: price + CTA ───────────────────────────────────────────── */
html body #qgServicesGrid .qgc .qgc-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: auto; padding-top: 16px;
}
/* Hairline above the price. The gap comes from the perks' margin-bottom so
   the footer keeps margin-top:auto and prices line up across a row. */
html body #qgServicesGrid .qgc .qgc-foot { border-top: 1px solid var(--qgc-line); }
html body #qgServicesGrid .qgc .qgc-perks { margin-bottom: 16px; }
html body #qgServicesGrid .qgc .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

html body #qgServicesGrid .qgc .qgc-price { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
html body #qgServicesGrid .qgc .qgc-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
html body #qgServicesGrid .qgc .qgc-from { font-size: .74rem; font-weight: 500; color: var(--qgc-ink-3); }
html body #qgServicesGrid .qgc .qgc-amt {
  font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.05;
  color: var(--qgc-ink); font-variant-numeric: tabular-nums;
}
html body #qgServicesGrid .qgc .qgc-was {
  font-size: .8rem; font-weight: 500; color: var(--qgc-ink-3); text-decoration: line-through;
  text-decoration-color: rgba(143,122,134,.7);
}
html body #qgServicesGrid .qgc .qgc-pts {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .74rem; font-weight: 600; color: var(--qgc-gold); white-space: nowrap;
}
html body #qgServicesGrid .qgc .qgc-pts svg { width: 12px; height: 12px; }

html body #qgServicesGrid .qgc .qgc-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex-shrink: 0; height: 44px; min-height: 0 !important; padding: 0 18px 0 20px; margin: 0;
  border: 0; border-radius: 999px;
  background: var(--qgc-ink); color: #fff;
  font-family: inherit; font-size: .9rem; font-weight: 600; letter-spacing: .01em; line-height: 1;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(35,16,25,.45);
  transition: background .3s ease, transform .2s var(--qgc-ease);
}
html body #qgServicesGrid .qgc .qgc-cta svg { width: 15px; height: 15px; transition: transform .3s var(--qgc-ease); }
html body #qgServicesGrid .qgc .qgc-cta:active { transform: scale(.96); }
html body #qgServicesGrid .qgc .qgc-cta:focus-visible { outline: 2px solid var(--qgc-rose-2); outline-offset: 3px; }

/* ── Narrow card: 2-up phone grid (~160–250px) ─────────────────────── */
@container (max-width: 260px) {
  html body #qgServicesGrid .qgc .qgc-media { aspect-ratio: 1 / 1; }
  html body #qgServicesGrid .qgc .qgc-chip { display: none; }
  html body #qgServicesGrid .qgc .qgc-tags { left: 8px; right: 8px; bottom: 8px; }
  html body #qgServicesGrid .qgc .qgc-dur { height: 22px; padding: 0 8px; font-size: .66rem; }
  html body #qgServicesGrid .qgc .qgc-badge { height: 20px; padding: 0 7px; font-size: .6rem; }
  html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish {
    top: 8px !important; right: 8px !important;
    width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 32px !important;
  }
  html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish svg { width: 15px !important; height: 15px !important; }
  html body #qgServicesGrid .qgc .qgc-body { padding: 11px 12px 12px; }
  html body #qgServicesGrid .qgc .qgc-eyebrow { margin-bottom: 5px; min-height: 20px; }
  html body #qgServicesGrid .qgc .qgc-where,
  html body #qgServicesGrid .qgc .qgc-surge,
  html body #qgServicesGrid .qgc .qgc-desc,
  html body #qgServicesGrid .qgc .qgc-perks,
  html body #qgServicesGrid .qgc .qgc-proof { display: none; }
  html body #qgServicesGrid .qgc .qgc-title { font-size: .98rem; line-height: 1.25; }
  html body #qgServicesGrid .qgc .qgc-foot { flex-direction: column; align-items: stretch; gap: 10px; padding-top: 10px; border-top: 0; }
  html body #qgServicesGrid .qgc .qgc-amt { font-size: 1.1rem; }
  html body #qgServicesGrid .qgc .qgc-pts { font-size: .66rem; }
  html body #qgServicesGrid .qgc .qgc-cta { width: 100%; height: 42px; font-size: .84rem; padding: 0 12px; }
}

/* ── Medium card: tablet 2-up / small desktop (260–340px) ──────────── */
@container (min-width: 261px) and (max-width: 340px) {
  html body #qgServicesGrid .qgc .qgc-body { padding: 14px 15px 15px; }
  html body #qgServicesGrid .qgc .qgc-title { font-size: 1.12rem; }
  html body #qgServicesGrid .qgc .qgc-amt { font-size: 1.2rem; }
  html body #qgServicesGrid .qgc .qgc-cta { height: 40px; padding: 0 14px 0 16px; font-size: .84rem; }
}

/* ── Phone list view (toggle in the hero) ──────────────────────────── */
html body #qgServicesGrid.list-view .qg-ultra-card.qgc {
  flex-direction: row !important; align-items: stretch !important;
  height: auto !important; min-height: 0 !important; border-radius: 18px !important;
}
html body #qgServicesGrid.list-view .qgc .qgc-media {
  width: 34%; max-width: 132px; aspect-ratio: auto; min-height: 132px; align-self: stretch;
}
html body #qgServicesGrid.list-view .qgc .qgc-chip { display: none; }
html body #qgServicesGrid.list-view .qgc .qg-card-wish-btn.qgc-wish {
  top: 6px !important; right: 6px !important;
  width: 30px !important; height: 30px !important; min-width: 30px !important; min-height: 30px !important;
}
html body #qgServicesGrid.list-view .qgc .qg-card-wish-btn.qgc-wish svg { width: 14px !important; height: 14px !important; }
html body #qgServicesGrid.list-view .qgc .qgc-tags { left: 6px; right: 6px; bottom: 6px; }
html body #qgServicesGrid.list-view .qgc .qgc-badge { display: none; }
html body #qgServicesGrid.list-view .qgc .qgc-dur { height: 22px; padding: 0 7px; font-size: .64rem; margin: 0 auto; }
html body #qgServicesGrid.list-view .qgc .qgc-body { padding: 12px 14px; }
html body #qgServicesGrid.list-view .qgc .qgc-where,
html body #qgServicesGrid.list-view .qgc .qgc-desc,
html body #qgServicesGrid.list-view .qgc .qgc-proof { display: none; }
html body #qgServicesGrid.list-view .qgc .qgc-title { font-size: 1.02rem; -webkit-line-clamp: 2; }
html body #qgServicesGrid.list-view .qgc .qgc-perks { margin: 6px 0 10px; gap: 4px 10px; }
html body #qgServicesGrid.list-view .qgc .qgc-perks li { font-size: .7rem; }
html body #qgServicesGrid.list-view .qgc .qgc-foot { padding-top: 0; border-top: 0; margin-top: auto; align-items: center; }
html body #qgServicesGrid.list-view .qgc .qgc-amt { font-size: 1.08rem; }
html body #qgServicesGrid.list-view .qgc .qgc-cta { height: 36px; padding: 0 14px; font-size: .8rem; }

@media (prefers-reduced-motion: reduce) {
  html body #qgServicesGrid .qg-ultra-card.qgc,
  html body #qgServicesGrid .qgc .qgc-img,
  html body #qgServicesGrid .qgc .qgc-cta,
  html body #qgServicesGrid .qgc .qgc-cta svg { transition: none !important; }
  html body #qgServicesGrid .qg-ultra-card.qgc:hover,
  html body #qgServicesGrid .qg-ultra-card.qgc:active { transform: none !important; }
  html body #qgServicesGrid .qgc:hover .qgc-img { transform: none; }
  html body #qgServicesGrid .qgc .qg-card-wish-btn.qgc-wish.is-wished svg { animation: none; }
}

/* ── Rendering budget: skip off-screen cards ────────────────────────────
   The grid holds ~99 cards. content-visibility:auto lets the browser skip
   layout and paint for cards far from the viewport, which matters most on
   Android while scrolling. `auto` in contain-intrinsic-size remembers each
   card's real height once rendered, so the scrollbar does not jump. */
html body #qgServicesGrid .qg-ultra-card.qgc {
  content-visibility: auto;
  contain-intrinsic-size: auto 548px;
}
@media (max-width: 768px) {
  html body #qgServicesGrid .qg-ultra-card.qgc { contain-intrinsic-size: auto 370px; }
}
