/* =====================================================================
   The Logiq Lab — fx.css
   3D / INTERACTIVE LAYER. Loads AFTER styles.css so it wins the cascade.
   Purely additive visual treatment driven by js/fx.js. Uses only the
   existing brand tokens (amber / warm-graphite) — no new palette.
   All motion is gated behind prefers-reduced-motion + pointer queries.
   ===================================================================== */

:root {
  --fx-glow: rgba(245, 158, 11, .55);
  --fx-glow-soft: rgba(245, 158, 11, .14);
  --fx-glow-faint: rgba(245, 158, 11, .07);
  --fx-edge: rgba(252, 211, 77, .5);
  --fx-deep: rgba(146, 64, 14, .35);
  --fx-glass: rgba(22, 19, 17, .55);
  --fx-ease: cubic-bezier(.22, 1, .36, 1);
  --fx-rx: 0deg; --fx-ry: 0deg; --fx-mx: 50%; --fx-my: 50%;
  --fx-px: 0; --fx-py: 0;
}
[data-theme="light"], [data-mode="light"] {
  --fx-glow: rgba(217, 119, 6, .42);
  --fx-glow-soft: rgba(245, 158, 11, .16);
  --fx-glow-faint: rgba(245, 158, 11, .08);
  --fx-glass: rgba(255, 255, 255, .6);
}

/* ---------------------------------------------------------------------
   1. SCROLL PROGRESS — top hairline that fills as the page scrolls
   --------------------------------------------------------------------- */
.fx-scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-light));
  box-shadow: 0 0 14px var(--fx-glow);
  z-index: 1200;
  pointer-events: none;
  will-change: transform;
}

/* ---------------------------------------------------------------------
   3. SCROLL REVEAL — fade + rise + de-blur as elements enter
   --------------------------------------------------------------------- */
/* Uses the individual `translate`/`scale` properties (not the `transform`
   shorthand) so reveal composes with .fx-tilt's `transform` instead of
   overriding it. Falls back gracefully (opacity only) on old browsers. */
.fx-reveal {
  opacity: 0;
  translate: 0 26px;
  scale: .985;
  filter: blur(6px);
  transition:
    opacity .7s var(--fx-ease) var(--fx-delay, 0ms),
    translate .8s var(--fx-ease) var(--fx-delay, 0ms),
    scale .8s var(--fx-ease) var(--fx-delay, 0ms),
    filter .8s var(--fx-ease) var(--fx-delay, 0ms);
  will-change: opacity, translate, scale;
}
.fx-reveal.is-in {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  filter: none;
}

/* ---------------------------------------------------------------------
   4. HERO — immersive depth for .hero--home and .page-hero
   --------------------------------------------------------------------- */
.fx-hero { position: relative; isolation: isolate; overflow: hidden; }

/* Promote the simple service-landing .page-hero into a full hero stage */
.fx-hero--page {
  min-height: clamp(360px, 52vh, 560px);
  display: flex;
  align-items: center;
  padding-block: clamp(64px, 12vh, 140px);
  perspective: 1000px;
}
.fx-hero--page .section-container { position: relative; z-index: 2; max-width: 880px; }
.fx-hero--page h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--text) 0%, var(--text) 42%, var(--accent-light) 62%, var(--accent) 82%, var(--accent-deep) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: fxSheen 9s ease-in-out infinite;
}
.fx-hero--page p {
  font-size: clamp(1.02rem, 1.6vw, 1.28rem);
  max-width: 60ch;
  color: var(--text-secondary);
}

/* The injected layer stack */
.fx-hero-fx {
  position: absolute; inset: -10% -5% 0 -5%;
  z-index: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.fx-hero-aurora {
  position: absolute;
  width: 60vw; height: 60vw;
  max-width: 760px; max-height: 760px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}
.fx-hero-aurora--1 {
  top: -18%; right: -8%;
  background: radial-gradient(circle at 50% 50%, var(--fx-glow), transparent 68%);
  transform: translate3d(calc(var(--fx-px) * 24px), calc(var(--fx-py) * 24px), 0);
  animation: fxFloat 14s ease-in-out infinite;
}
.fx-hero-aurora--2 {
  bottom: -28%; left: -10%;
  background: radial-gradient(circle at 50% 50%, var(--fx-deep), transparent 70%);
  opacity: .5;
  transform: translate3d(calc(var(--fx-px) * -30px), calc(var(--fx-py) * -18px), 0);
  animation: fxFloat 18s ease-in-out infinite reverse;
}
.fx-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--fx-glow-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--fx-glow-faint) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 35%, transparent 78%);
  opacity: .6;
  transform: translate3d(calc(var(--fx-px) * 8px), calc(var(--fx-py) * 8px), 0);
}
/* Floating circuit chips (parallax via inline transform from JS) */
.fx-chip {
  position: absolute;
  color: var(--accent);
  opacity: .22;
  will-change: transform;
}
.fx-chip svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.fx-chip--1 { top: 16%; right: 12%; width: 64px; height: 64px; animation: fxFloat 11s ease-in-out infinite; }
.fx-chip--2 { bottom: 18%; right: 22%; width: 48px; height: 48px; opacity: .16; animation: fxFloat 13s ease-in-out infinite reverse; }
.fx-chip--3 { top: 60%; left: 9%; width: 90px; height: 56px; opacity: .14; color: var(--accent-light); animation: fxFloat 16s ease-in-out infinite; }

/* Home hero: amplify the existing title + decorative layers */
.hero--home.fx-hero .hero-title { position: relative; z-index: 2; }
.hero--home.fx-hero .gradient-text {
  background-size: 220% 100%;
  animation: fxSheen 8s ease-in-out infinite;
}
.hero--home.fx-hero .hero-content { position: relative; z-index: 2; }

/* ---------------------------------------------------------------------
   5. 3D TILT CARDS — pointer rotation + glare + depth lift
   --------------------------------------------------------------------- */
.fx-tilt {
  position: relative;
  transform-style: preserve-3d;
  transform:
    perspective(900px)
    rotateX(var(--fx-rx))
    rotateY(var(--fx-ry));
  transition: transform .5s var(--fx-ease), box-shadow .5s var(--fx-ease), border-color .5s var(--fx-ease);
  will-change: transform;
}
.fx-tilt.fx-tilt-active {
  transition: transform .08s linear, box-shadow .4s var(--fx-ease), border-color .4s var(--fx-ease);
  box-shadow:
    0 30px 60px -22px rgba(0,0,0,.6),
    0 0 0 1px var(--fx-glow-soft),
    0 0 38px -6px var(--fx-glow-soft);
  border-color: var(--border-hover);
  z-index: 5;
}
/* Glare follows the cursor */
.fx-tilt::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--fx-mx) var(--fx-my), var(--fx-glow-soft), transparent 42%);
  opacity: 0;
  transition: opacity .4s var(--fx-ease);
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}
.fx-tilt.fx-tilt-active::after { opacity: 1; }
[data-theme="light"] .fx-tilt::after, [data-mode="light"] .fx-tilt::after { mix-blend-mode: multiply; }

/* Lift inner content slightly toward the viewer for real parallax depth */
.fx-tilt:not(.fx-tilt-wide).fx-tilt-active > * { transform: translateZ(18px); }
.fx-tilt:not(.fx-tilt-wide) > * { transition: transform .5s var(--fx-ease); }

/* Wide elements (full-width panels / text blocks): glare + lift only, no
   rotation or child push, so layout stays flat and readable. */
.fx-tilt-wide {
  transform: none !important;
  transform-style: flat;
}
.fx-tilt-wide.fx-tilt-active {
  transform: translateY(-3px) !important;
}

/* Nav Sign In CTA: no sheen sweep, glow, or magnetic drift */
.btn-nav-cta {
  transform: none !important;
  box-shadow: none !important;
  transition: background .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease;
}
.btn-nav-cta::before { display: none !important; }
.btn-nav-cta:hover,
.btn-nav-cta:active {
  transform: none !important;
  box-shadow: none !important;
}
.btn-nav-cta:hover { opacity: .94; }

/* Track nav button: no scale, glow, or magnetic drift */
.track-btn {
  transform: none !important;
  box-shadow: none !important;
  transition: background .2s ease, border-color .2s ease, opacity .2s ease;
}
.track-btn:hover,
.track-btn:active {
  transform: none !important;
  box-shadow: none !important;
}
.track-btn:hover { opacity: .94; }

/* Primary/secondary CTAs: no sheen sweep, glow, or magnetic drift */
.btn-primary,
.btn-secondary {
  transform: none !important;
  box-shadow: none !important;
  transition: opacity .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn-primary::before,
.btn-secondary::before { display: none; }
.btn-primary:hover,
.btn-secondary:hover {
  transform: none !important;
  box-shadow: none !important;
}
.btn-primary:hover { opacity: .94; }

/* ---------------------------------------------------------------------
   7. NAV — deepen the glass, animate the active link, glow the mark
   --------------------------------------------------------------------- */
.navbar { transition: background .4s ease, backdrop-filter .4s ease, box-shadow .4s ease, border-color .4s ease; }
.navbar.scrolled { box-shadow: 0 10px 30px -16px rgba(0,0,0,.7), 0 1px 0 0 var(--fx-glow-faint); }
.nav-link { position: relative; }
.nav-link::after {
  content: "";
  position: absolute; left: 0; bottom: -4px;
  height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .4s var(--fx-ease);
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-mark { transition: filter .4s ease, transform .4s var(--fx-ease); }
.nav-logo:hover .nav-mark { filter: drop-shadow(0 0 10px var(--fx-glow)); transform: translateY(-1px) scale(1.04); }

/* ---------------------------------------------------------------------
   8. SECTION TITLES — animated gradient accent + kicker glow
   --------------------------------------------------------------------- */
.section-title .gradient-text,
.gradient-text {
  background-size: 200% 100%;
  animation: fxSheen 9s ease-in-out infinite;
}
.section-glow-edge { position: relative; }

/* ---------------------------------------------------------------------
   9. FOOTER — subtle top glow rule
   --------------------------------------------------------------------- */
.footer { position: relative; }
.footer::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--fx-glow), transparent);
  opacity: .5;
}

/* ---------------------------------------------------------------------
   9b. GOOGLE REVIEW CARDS (rendered live by js/reviews.js)
   --------------------------------------------------------------------- */
#googleReviews { margin-top: 22px; }
.gr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  text-align: left;
}
.gr-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 18px 20px;
  color: inherit;
  text-decoration: none;
}
a.gr-card:hover { border-color: var(--border); color: inherit; }
.trust-block--reviews .trust-block-inner,
.trust-block--reviews .gr-card {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}
.trust-block--reviews .fx-tilt::after { display: none !important; }

/* Homepage featured parts: no cursor-tracking glare or 3D tilt */
#featuredProducts .product-card,
#featuredProducts .part-row,
#featuredProducts .part-catalog-card {
  transform: none !important;
  box-shadow: none !important;
}
#featuredProducts .fx-tilt::after { display: none !important; }
#featuredProducts .product-card:hover,
#featuredProducts .part-row:hover,
#featuredProducts .part-catalog-card:hover {
  transform: none !important;
  box-shadow: none !important;
}
#featuredProducts .fx-tilt.fx-tilt-active > * { transform: none !important; }

.trust-block--reviews .btn-secondary::before,
.trust-block--reviews .btn-primary::before { display: none; }
.home-faq-teaser .btn-secondary {
  transform: none !important;
  transition: background .2s ease, border-color .2s ease;
}
.home-faq-teaser .btn-secondary:hover { transform: none !important; }
.home-faq-teaser .btn-secondary::before { display: none; }
.account-section .btn-primary,
.account-section .btn-secondary,
.booking-section .btn-primary,
.booking-section .btn-secondary {
  transform: none !important;
  transition: background .2s ease, border-color .2s ease;
}
.account-section .btn-primary:hover,
.account-section .btn-secondary:hover,
.booking-section .btn-primary:hover,
.booking-section .btn-secondary:hover { transform: none !important; }
.account-section .btn-primary::before,
.account-section .btn-secondary::before,
.booking-section .btn-primary::before,
.booking-section .btn-secondary::before { display: none; }
.booking-info-card {
  transform: none !important;
  transition: border-color .2s ease, background .2s ease;
}
.booking-info-card.fx-tilt::after { display: none !important; }
.gr-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.gr-avatar {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--gradient-main);
  color: var(--text-on-accent);
  font-weight: 700; font-size: .95rem;
  font-family: var(--font-display);
}
.gr-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gr-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gr-author {
  font-weight: 600; font-size: .92rem; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.gr-sub { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.gr-stars { color: var(--accent); letter-spacing: 1px; }
.gr-time { color: var(--text-muted); }
.gr-glyph { margin-left: auto; color: var(--text-muted); font-size: 1rem; }
.gr-text {
  margin: 0;
  font-size: .9rem; line-height: 1.6; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}
.gr-attrib {
  margin: 16px 0 0;
  text-align: center;
  font-size: .8rem; color: var(--text-muted);
}
.gr-attrib .fa-google { color: var(--accent); margin-right: 4px; }

/* Light-mode review card readability + section clarity */
[data-theme="light"] .trust-block--reviews .trust-block-inner,
[data-mode="light"] .trust-block--reviews .trust-block-inner {
  background: linear-gradient(135deg, rgba(245, 158, 11, .09), rgba(255, 255, 255, .98));
  border-color: rgba(217, 119, 6, .3);
}

[data-theme="light"] .gr-card,
[data-mode="light"] .gr-card {
  background: #ffffff;
  border-color: rgba(12, 10, 8, .12);
}

[data-theme="light"] .gr-author,
[data-mode="light"] .gr-author {
  color: #1f1a16;
}

[data-theme="light"] .gr-text,
[data-mode="light"] .gr-text {
  color: #453f38;
}

[data-theme="light"] .gr-time,
[data-theme="light"] .gr-glyph,
[data-mode="light"] .gr-time,
[data-mode="light"] .gr-glyph {
  color: #6f655c;
}

[data-theme="light"] .gr-attrib,
[data-mode="light"] .gr-attrib {
  color: #6f655c;
}

/* ---------------------------------------------------------------------
   9c. ADMIN — Reviews section (admin.html #adminReviews)
   --------------------------------------------------------------------- */
.rev-help { color: var(--text-secondary); font-size: .86rem; line-height: 1.6; margin: 0 0 16px; max-width: 760px; }
.rev-bookmarklet-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; max-width: 760px; }
.rev-bookmarklet {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  background: rgba(245, 158, 11, .14); border: 1px dashed rgba(245, 158, 11, .45);
  color: var(--accent-light); font-size: .84rem; font-weight: 600; text-decoration: none; cursor: grab;
}
.rev-bookmarklet:hover { background: rgba(245, 158, 11, .22); color: #fff; }
.rev-bookmarklet-note { font-size: .8rem; color: var(--text-secondary); line-height: 1.4; }
.rev-date-preview { font-size: .78rem; color: var(--text-muted); font-weight: 500; min-height: 1.1em; }
.rev-import { margin: 0 0 18px; max-width: 760px; }
.rev-import-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.rev-import-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.rev-import-input {
  flex: 1; min-width: 220px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary); font-size: .88rem;
}
.rev-import-status { font-size: .82rem; line-height: 1.5; margin: 8px 0 0; color: var(--text-secondary); }
.rev-import-status.is-ok { color: var(--accent-light); }
.rev-import-status.is-err { color: var(--status-error-muted); }
.rev-form {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 18px; margin-bottom: 18px;
}
.rev-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rev-form label, .rev-full { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; color: var(--text-secondary); font-weight: 600; }
.rev-full { margin-top: 12px; }
.rev-form input, .rev-form select, .rev-form textarea {
  background: var(--surface-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 11px; color: var(--text-primary); font: inherit; font-weight: 400;
}
.rev-form textarea { resize: vertical; }
.rev-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

.rev-status { font-size: .85rem; line-height: 1.5; padding: 10px 14px; border-radius: var(--radius-sm); margin: 0 0 12px; }
.rev-status-ok { background: rgba(245,158,11,.12); color: var(--accent-light); border: 1px solid var(--border-hover); }
.rev-status-err { background: rgba(146,64,14,.18); color: var(--status-error-muted); border: 1px solid var(--status-error); }
.rev-featured-count { font-size: .85rem; color: var(--text-secondary); margin: 0 0 12px; }
.rev-featured-count .fa-star { color: var(--accent); }
.rev-max { color: var(--status-warn); font-weight: 600; }

.rev-list { display: flex; flex-direction: column; gap: 10px; }
.rev-row {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
}
.rev-row.is-featured { border-color: var(--border-hover); box-shadow: inset 3px 0 0 var(--accent); }
.rev-row-main { flex: 1; min-width: 0; }
.rev-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rev-badge { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; }
.rev-badge-g { background: rgba(245,158,11,.14); color: var(--accent); }
.rev-badge-m { background: var(--surface-hover); color: var(--text-secondary); }
.rev-stars { color: var(--accent); letter-spacing: 1px; font-size: .9rem; }
.rev-author { color: var(--text-primary); font-size: .92rem; }
.rev-time { color: var(--text-muted); font-size: .78rem; }
.rev-body { color: var(--text-secondary); font-size: .88rem; line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rev-row-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.rev-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-secondary); cursor: pointer; user-select: none; }
.rev-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.rev-order { display: inline-flex; gap: 4px; }
.rev-icon-btn {
  background: var(--surface-hover); border: 1px solid var(--border); color: var(--text-secondary);
  width: 30px; height: 30px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.rev-icon-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--border-hover); }
.rev-icon-btn:disabled { opacity: .35; cursor: default; }
.rev-del:hover:not(:disabled) { color: var(--status-error); border-color: var(--status-error); }
.rev-empty { text-align: center; padding: 30px 16px; color: var(--text-secondary); font-size: .9rem; line-height: 1.7; }
.rev-empty .fa-inbox, .rev-empty .fa-triangle-exclamation { font-size: 1.6rem; display: block; margin-bottom: 8px; color: var(--text-muted); }
@media (max-width: 640px) {
  .rev-row { flex-direction: column; }
  .rev-row-actions { width: 100%; justify-content: space-between; }
}

/* ---------------------------------------------------------------------
   10. KEYFRAMES
   --------------------------------------------------------------------- */
@keyframes fxSheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes fxFloat {
  0%, 100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-14px) translateX(8px); }
  66% { transform: translateY(8px) translateX(-10px); }
}

/* ---------------------------------------------------------------------
   11. ACCESSIBILITY / FALLBACK GUARDS
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .fx-reveal { opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; transition: none !important; }
  .fx-tilt { transform: none !important; transition: none !important; }
  .fx-tilt::after { display: none; }
  .fx-hero-aurora, .fx-chip, .fx-hero-grid,
  .gradient-text, .fx-hero--page h1 { animation: none !important; }
  .fx-scroll-progress { display: none !important; }
  .btn-primary::before, .btn-secondary::before, .btn-nav-cta::before { display: none; }
}

/* Touch / coarse pointer: no tilt transforms, no sheen sweep weirdness */
@media (hover: none), (pointer: coarse) {
  .fx-tilt { transform: none !important; }
  .fx-tilt::after { display: none; }
}

/* Respect users who haven't loaded JS — heroes still look intentional */
.fx-hero--page:not(.fx-hero) { perspective: none; }
