/* ================================================================
   SEGO FLOORING & RENOVATIONS — Design System
   Brand Colors: Deep Red (#8B2332) + Tan/Off-White (#F5EDE0)
   ================================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Colors */
  --red-900: #6B1A27;
  --red-800: #7A1E2D;
  --red-700: #8B2332;
  --red-600: #9C2838;
  --red-500: #B03040;
  --red-400: #C44155;
  --red-300: #D4697A;
  --red-200: #E49AA6;
  --red-100: #F2CDD4;
  --red-50:  #FAE8EB;

  --tan-900: #5C5041;
  --tan-800: #7A6B56;
  --tan-700: #98866C;
  --tan-600: #B0A08A;
  --tan-500: #C8B9A5;
  --tan-400: #D6CCBB;
  --tan-300: #E4DDD2;
  --tan-200: #EDE8DF;
  --tan-100: #F5EDE0;
  --tan-50:  #FAF6F0;

  --charcoal-900: #1A1A1A;
  --charcoal-800: #2D2D2D;
  --charcoal-700: #3D3D3D;
  --charcoal-600: #525252;
  --charcoal-500: #6B6B6B;
  --charcoal-400: #8A8A8A;
  --charcoal-300: #ABABAB;
  --charcoal-200: #D4D4D4;
  --charcoal-100: #EBEBEB;

  --white: #FFFFFF;
  --black: #000000;

  /* Semantic Colors */
  --color-primary: var(--red-700);
  --color-primary-hover: var(--red-800);
  --color-primary-active: var(--red-900);
  --color-primary-light: var(--red-50);
  --color-bg: var(--tan-50);
  --color-bg-alt: var(--tan-100);
  --color-bg-card: var(--white);
  --color-text: var(--charcoal-900);
  --color-text-secondary: var(--charcoal-600);
  --color-text-muted: var(--charcoal-400);
  --color-border: var(--tan-300);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(26, 26, 26, 0.06), 0 1px 2px rgba(26, 26, 26, 0.04);
  --shadow-md: 0 4px 12px rgba(26, 26, 26, 0.08), 0 2px 4px rgba(26, 26, 26, 0.04);
  --shadow-lg: 0 12px 32px rgba(26, 26, 26, 0.1), 0 4px 8px rgba(26, 26, 26, 0.06);
  --shadow-xl: 0 20px 48px rgba(26, 26, 26, 0.12), 0 8px 16px rgba(26, 26, 26, 0.06);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 960px;
  --header-height: 80px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Premium Cursor — hide native, show custom dot */
@media (hover: hover) and (pointer: fine) {
  *, *::before, *::after {
    cursor: none !important;
  }
}

.custom-cursor {
  position: fixed;
  top: -8px;
  left: -8px;
  width: 16px;
  height: 16px;
  background-color: var(--color-primary);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  will-change: transform;
}

.custom-cursor.cursor-hover {
  width: 22px;
  height: 22px;
  top: -11px;
  left: -11px;
  opacity: 0.8;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-text);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.6rem); }
h4 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); }

p {
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.section-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-label::before {
  content: '';
  width: 32px;
  height: 2px;
  background: var(--color-primary);
  display: inline-block;
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.container--narrow {
  max-width: var(--container-narrow);
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-5xl) 0;
  scroll-margin-top: 80px;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section--dark {
  background-color: var(--charcoal-900);
  color: var(--white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--white);
}

.section--dark p,
.section--dark .section-subtitle {
  color: var(--charcoal-300);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  margin-bottom: var(--space-md);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background-color: var(--color-primary);
  color: var(--white);
  border: 2px solid var(--color-primary);
}

.btn--primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 35, 50, 0.3);
}

.btn--outline {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn--outline:hover {
  background-color: var(--white);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn--outline-dark {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline-dark:hover {
  background-color: var(--color-primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn--large {
  padding: 18px 40px;
  font-size: 1.05rem;
}

.btn--icon svg {
  width: 18px;
  height: 18px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: all var(--transition-base);
  background: transparent;
}

.site-header.scrolled {
  background: rgba(250, 246, 240, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

.site-header.scrolled .nav-link {
  color: var(--color-text);
}

.site-header.scrolled .header-phone {
  color: var(--color-text);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  z-index: 1001;
}

.header-logo img {
  height: 48px;
  width: auto;
}

.header-logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--white);
  line-height: 1.1;
  transition: color var(--transition-base);
}

.site-header.scrolled .header-logo-text {
  color: var(--color-text);
}

.header-logo-text span {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.8;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--white);
  transition: color var(--transition-base);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-link:hover::after {
  width: 100%;
}

.header-phone {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: color var(--transition-base);
}

.header-phone svg {
  width: 16px;
  height: 16px;
}

.header-cta {
  display: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  z-index: 1001;
}

.menu-toggle span {
  width: 26px;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition-base);
}

.site-header.scrolled .menu-toggle span {
  background: var(--color-text);
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- GSAP Video Scrub Hero ---------- */
.video-scroll-wrapper {
  position: relative;
  width: 100%;
  height: 250vh; /* Giving enough scroll length for smooth playback */
  background-color: var(--charcoal-900);
}

.video-container {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  pointer-events: none;
  z-index: 1;
  will-change: transform;
}

.hero-overlay-text {
  position: absolute;
  z-index: 5;
  text-align: center;
  width: 100%;
  max-width: 800px;
  padding: 0 var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Start invisible for GSAP */
  opacity: 0;
  visibility: hidden;
  /* Add text shadow for heavy contrast over video */
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}

.hero-overlay-text h1,
.hero-overlay-text h2 {
  color: var(--white);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.hero-overlay-text p {
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.5;
  max-width: 600px;
}

/* Ensure 'Before' text starts visible */
.text-before {
  opacity: 1;
  visibility: visible;
}

.video-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20vh;
  z-index: 4;
  background: linear-gradient(to top, var(--color-bg) 0%, rgba(245, 240, 232, 0) 100%);
  pointer-events: none;
}


/* ---------- Service Cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.service-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  transition: all var(--transition-base);
  border: 1px solid var(--color-border);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  transform-origin: left;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--red-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
  transition: all var(--transition-base);
}

.service-card:hover .service-card-icon {
  background: var(--color-primary);
}

.service-card-icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
  transition: color var(--transition-base);
}

.service-card:hover .service-card-icon svg {
  color: var(--white);
}

.service-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.2rem;
}

.service-card p {
  font-size: 0.92rem;
  margin-bottom: var(--space-md);
}

.service-card-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition-base);
}

.service-card:hover .service-card-link {
  gap: 10px;
}

.service-card-link svg {
  width: 14px;
  height: 14px;
}

/* ---------- Process / Timeline ---------- */
.process-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: var(--color-border);
  z-index: 0;
  border-radius: 2px;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, var(--color-primary), var(--red-200));
  transition: height 0.1s ease-out;
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  margin-bottom: 60px;
  width: 100%;
  z-index: 1;
  display: flex;
  opacity: 0.3;
  transition: opacity 0.4s ease;
}

.timeline-item.active {
  opacity: 1;
}

.timeline-item.left {
  justify-content: flex-start;
  padding-right: 50%;
}

.timeline-item.right {
  justify-content: flex-end;
  padding-left: 50%;
}

.timeline-dot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--charcoal-300);
  border: 4px solid var(--white);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.4s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.timeline-item.active .timeline-dot {
  background: var(--color-primary);
  transform: translateX(-50%) scale(1.15);
  box-shadow: 0 4px 16px rgba(144, 27, 27, 0.4);
}

.timeline-content {
  width: calc(100% - 60px);
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.timeline-item.active .timeline-content {
  border-color: var(--red-100);
  box-shadow: var(--shadow-md);
}

.timeline-item.left .timeline-content {
  margin-right: 60px;
  text-align: right;
}

.timeline-item.right .timeline-content {
  margin-left: 60px;
  text-align: left;
}

.timeline-content h4 {
  margin-bottom: var(--space-xs);
  color: var(--color-text);
  font-size: 1.2rem;
}

.timeline-content p {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

@media (max-width: 768px) {
  .process-timeline {
    padding: 20px 0;
  }
  .timeline-line {
    left: 24px;
    transform: none;
  }
  .timeline-item.left, 
  .timeline-item.right {
    justify-content: flex-start;
    padding-left: 70px;
    padding-right: 0;
  }
  .timeline-item.left .timeline-content,
  .timeline-item.right .timeline-content {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    text-align: left;
  }
  .timeline-dot {
    left: 24px;
    transform: translateX(-50%);
  }
  .timeline-item.active .timeline-dot {
    transform: translateX(-50%) scale(1.1);
  }
}

.process-bottom {
  text-align: center;
  margin-top: var(--space-3xl);
}

.process-bottom p {
  font-size: 1.1rem;
  margin-bottom: var(--space-lg);
  font-style: italic;
  color: var(--color-text-secondary);
}

/* ---------- Gallery Grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item:nth-child(1) {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery-item-label {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-base);
}

.gallery-item:hover .gallery-item-label {
  opacity: 1;
  transform: translateY(0);
}

/* Full Gallery (Contact/Gallery Page) */
.gallery-full {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.gallery-full .gallery-item {
  aspect-ratio: 1;
}

.gallery-full .gallery-item:nth-child(1),
.gallery-full .gallery-item:nth-child(6),
.gallery-full .gallery-item:nth-child(11) {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

/* ---------- Before & After Pairs ---------- */
.ba-grid {
  column-count: 2;
  column-gap: var(--space-2xl);
  margin-bottom: var(--space-4xl);
}

@media (max-width: 900px) {
  .ba-grid {
    column-count: 1;
  }
}

.ba-pair {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: var(--space-2xl);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

.ba-pair:hover {
  box-shadow: var(--shadow-lg);
}

.ba-label-row {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--tan-50), var(--tan-100));
}

.ba-project-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

/* Image Comparison Slider */
.ba-slider-container {
  position: relative;
  overflow: hidden;
  background: var(--charcoal-900);
  user-select: none;
}

.ba-slider-container img {
  width: 100%;
  height: auto;
  display: block;
}

.slider-image-before-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  clip-path: inset(0 50% 0 0);
  pointer-events: none;
}

.slider-image-before-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ba-slider {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 30;
  margin: 0;
}

.slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: rgba(255, 255, 255, 0.9);
  z-index: 20;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: var(--color-primary);
  border: 3px solid var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: var(--shadow-md);
  transition: background var(--transition-fast);
}

.ba-slider-container:hover .slider-button {
  background: var(--color-primary-hover);
}

.slider-button svg {
  width: 24px;
  height: 24px;
}

/* Static Side-by-side Layout (fallback/standard) */
.ba-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.ba-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.ba-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.ba-image:hover img {
  transform: scale(1.04);
}

.ba-tag {
  position: absolute;
  top: var(--space-md);
  z-index: 2;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ba-tag--before {
  left: var(--space-md);
  background: var(--charcoal-800);
  color: var(--white);
}

.ba-tag--after {
  right: var(--space-md);
  left: auto;
  background: var(--color-primary);
  color: var(--white);
}

.ba-before {
  border-right: 2px solid var(--color-border);
}

/* ---------- Gallery Category Headers ---------- */
.gallery-category {
  margin-bottom: var(--space-xl);
}

.gallery-category-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary);
}

.gallery-category-title svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ---------- Gallery Showcase Grid ---------- */
.gallery-showcase {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.gallery-showcase .gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.gallery-showcase .gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-showcase .gallery-item:hover img {
  transform: scale(1.06);
}

.gallery-showcase .gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26, 26, 26, 0.5) 0%, transparent 50%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-showcase .gallery-item:hover::after {
  opacity: 1;
}

.gallery-showcase .gallery-item .gallery-item-label {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transition-base);
}

.gallery-showcase .gallery-item:hover .gallery-item-label {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Testimonials ---------- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.testimonial-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  border: 1px solid var(--color-border);
  position: relative;
}

.testimonial-card::before {
  content: '"';
  font-family: Georgia, serif;
  font-size: 5rem;
  color: var(--red-100);
  position: absolute;
  top: 8px;
  left: 20px;
  line-height: 1;
}

.testimonial-stars {
  display: flex;
  gap: 3px;
  margin-bottom: var(--space-md);
}

.testimonial-stars svg {
  width: 18px;
  height: 18px;
  color: #F59E0B;
  fill: #F59E0B;
}

.testimonial-card blockquote {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
  position: relative;
  z-index: 1;
}

.testimonial-author {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

/* ---------- Service Areas ---------- */
.service-areas {
  text-align: center;
}

.areas-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.area-tag {
  padding: 10px 24px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  transition: all var(--transition-base);
}

.area-tag:hover {
  background: var(--color-primary);
  color: var(--white);
  border-color: var(--color-primary);
}

/* ---------- Services Page: Detail Sections ---------- */
.service-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--color-border);
}

.service-detail:last-child {
  border-bottom: none;
}

.service-detail.reversed {
  direction: rtl;
}

.service-detail.reversed > * {
  direction: ltr;
}

.service-detail-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.service-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.service-detail-image:hover img {
  transform: scale(1.04);
}

.service-detail-content h3 {
  font-size: 1.6rem;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.service-detail-content p {
  font-size: 1rem;
  line-height: 1.8;
}

.service-detail-number {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 3rem;
  color: var(--red-100);
  margin-bottom: var(--space-sm);
  line-height: 1;
}

/* ---------- CTA Section ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--red-800) 0%, var(--red-700) 50%, var(--red-900) 100%);
  padding: var(--space-4xl) 0;
  text-align: center;
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.cta-section .cta-phone {
  color: var(--white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.cta-section .cta-phone svg {
  width: 22px;
  height: 22px;
}

/* ---------- Contact Section ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-3xl);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.form-group label .required {
  color: var(--color-primary);
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-card);
  color: var(--color-text);
  transition: all var(--transition-base);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--red-50);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.file-upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--tan-50);
}

.file-upload:hover {
  border-color: var(--color-primary);
  background: var(--red-50);
}

.file-upload svg {
  width: 36px;
  height: 36px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.file-upload p {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.file-upload p span {
  color: var(--color-primary);
  font-weight: 600;
}

.contact-info-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  border: 1px solid var(--color-border);
}

.contact-info-item {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.contact-info-item:last-child {
  margin-bottom: 0;
}

.contact-info-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--red-50);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-info-icon svg {
  width: 22px;
  height: 22px;
  color: var(--color-primary);
}

.contact-info-item h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.contact-info-item p {
  font-size: 0.9rem;
}

.contact-info-item a {
  color: var(--color-primary);
  font-weight: 500;
}

.contact-badge {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.contact-badge svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

.contact-badge span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

/* ---------- FAQ Accordion ---------- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  overflow: hidden;
  background: var(--color-bg-card);
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: var(--red-200);
}

.faq-question {
  width: 100%;
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  transition: all var(--transition-base);
}

.faq-question:hover {
  color: var(--color-primary);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
  color: var(--color-primary);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-answer p {
  padding: 0 var(--space-xl) var(--space-lg);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.faq-answer a {
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 500;
}

.faq-answer a:hover {
  color: var(--red-800);
}

.faq-item.open {
  border-color: var(--red-200);
  box-shadow: var(--shadow-sm);
}

.faq-item.open .faq-question {
  color: var(--color-primary);
}

/* ---------- About Section ---------- */
.about-content {
  max-width: 800px;
  margin: 0 auto;
}

.about-content p {
  margin-bottom: var(--space-lg);
  font-size: 1rem;
  line-height: 1.85;
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal-900);
  color: var(--white);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer-brand .header-logo-text {
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
}

.footer-brand .header-logo-text span {
  font-size: 0.75rem;
}

.footer-brand p {
  color: var(--charcoal-400);
  font-size: 0.9rem;
  margin-top: var(--space-md);
  line-height: 1.7;
}

.footer-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--white);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.5px;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: var(--charcoal-400);
  font-size: 0.9rem;
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  color: var(--charcoal-400);
  font-size: 0.9rem;
}

.footer-contact-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-primary);
}

.footer-contact-item a {
  color: var(--charcoal-400);
  transition: color var(--transition-base);
}

.footer-contact-item a:hover {
  color: var(--white);
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 8px 16px;
  background: rgba(139, 35, 50, 0.15);
  border: 1px solid rgba(139, 35, 50, 0.3);
  border-radius: var(--radius-full);
  margin-top: var(--space-lg);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--red-300);
}

.footer-badge svg {
  width: 16px;
  height: 16px;
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--charcoal-800);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.85rem;
  color: var(--charcoal-500);
}

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  cursor: pointer;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background var(--transition-base);
  border: none;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger children */
.stagger-children .fade-in:nth-child(1) { transition-delay: 0s; }
.stagger-children .fade-in:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .fade-in:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .fade-in:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .fade-in:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .fade-in:nth-child(6) { transition-delay: 0.3s; }
.stagger-children .fade-in:nth-child(7) { transition-delay: 0.35s; }
.stagger-children .fade-in:nth-child(8) { transition-delay: 0.4s; }

/* Page header entrance animation */
.page-header .fade-in:nth-child(1) { transition-delay: 0.1s; }
.page-header .fade-in:nth-child(2) { transition-delay: 0.25s; }
.page-header .fade-in:nth-child(3) { transition-delay: 0.4s; }

/* ---------- Mobile Nav Overlay ---------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.98);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.mobile-nav.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xl);
}

.mobile-nav-links a {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--white);
  transition: color var(--transition-base);
}

.mobile-nav-links a:hover {
  color: var(--red-300);
}

.mobile-nav-links .btn {
  margin-top: var(--space-lg);
}

/* ---------- Page Header (Interior) ---------- */
.page-header {
  background: linear-gradient(135deg, var(--tan-100) 0%, var(--tan-200) 100%);
  padding: calc(var(--header-height) + var(--space-4xl)) 0 var(--space-4xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--red-50) 0%, transparent 70%);
  border-radius: 50%;
}

.page-header h1 {
  margin-bottom: var(--space-md);
  position: relative;
}

.page-header p {
  font-size: 1.15rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.page-header .section-label {
  position: relative;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }



  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
    aspect-ratio: 16/9;
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid .testimonial-card:last-child {
    grid-column: span 2;
    max-width: 50%;
    justify-self: center;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .service-detail {
    gap: var(--space-xl);
  }

  .gallery-full {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-full .gallery-item:nth-child(1),
  .gallery-full .gallery-item:nth-child(6),
  .gallery-full .gallery-item:nth-child(11) {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 1;
  }

  .gallery-showcase {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --space-5xl: 5rem;
  }

  .menu-toggle {
    display: flex;
  }

  .header-nav {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }



  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item:nth-child(1) {
    grid-column: span 2;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .testimonials-grid .testimonial-card:last-child {
    grid-column: span 1;
    max-width: 100%;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }


  .footer-grid {
    grid-template-columns: 1fr;
  }

  .service-detail {
    grid-template-columns: 1fr;
  }

  .service-detail.reversed {
    direction: ltr;
  }

  .service-detail-image {
    aspect-ratio: 16/9;
  }

  .hero-content {
    padding-left: 0;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .areas-list {
    gap: var(--space-sm);
  }

  .area-tag {
    padding: 8px 18px;
    font-size: 0.85rem;
  }

  .gallery-full {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-showcase {
    grid-template-columns: repeat(2, 1fr);
  }

  .ba-images {
    grid-template-columns: 1fr;
  }

  .ba-before {
    border-right: none;
    border-bottom: 2px solid var(--color-border);
  }

  .ba-tag--after {
    left: var(--space-md);
    right: auto;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }


  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item:nth-child(1) {
    grid-column: span 1;
  }

  .gallery-showcase {
    grid-template-columns: 1fr;
  }

  .ba-project-name {
    font-size: 0.95rem;
  }

  .ba-tag {
    font-size: 0.7rem;
    padding: 4px 12px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
}

/* ============ QUOTE BUILDER ============ */
.quote-builder-wrapper {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-2xl);
  border: 1px solid var(--color-border);
}

.step-panel {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.step-panel.active {
  display: block;
}

.step-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.step-desc {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-xl);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.option-card input[type="radio"] {
  display: none;
}

.option-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--white);
}

.option-icon {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.option-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.option-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
}

.option-card input:checked + .option-content {
  border-color: var(--color-primary);
  background: var(--red-50);
  box-shadow: 0 4px 12px rgba(144, 27, 27, 0.1);
}

.option-card:hover .option-content {
  border-color: var(--red-200);
}

.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-2xl);
}

.step-actions.right {
  justify-content: flex-end;
}

.qb-progress {
  margin-top: var(--space-2xl);
  height: 6px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.qb-progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.4s ease;
}

/* Range Slider */
.sqft-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  outline: none;
}

.sqft-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(144, 27, 27, 0.4);
  transition: transform 0.1s;
}

.sqft-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

@media (max-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ FLOATING WIDGETS ============ */
.mobile-sticky-bar {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 56px;
  }
  
  .mobile-sticky-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
  }

  .sticky-call, .sticky-estimate {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--white);
    gap: 8px;
    letter-spacing: 0.5px;
  }

  .sticky-call {
    background: var(--charcoal-900);
  }

  .sticky-estimate {
    background: var(--color-primary);
  }

  .sticky-call svg {
    width: 18px;
    height: 18px;
  }
}

/* Chat Widget Base */
.chat-widget-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .chat-widget-container {
    bottom: 80px; /* Above the mobile sticky bar */
    right: 16px;
  }
}

.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--white);
  box-shadow: 0 4px 20px rgba(144, 27, 27, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
}

.chat-toggle:hover {
  transform: scale(1.05);
  background: var(--red-400);
}

.chat-toggle svg {
  width: 28px;
  height: 28px;
}

/* Chat Window */
.chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 340px;
  max-width: calc(100vw - 32px);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.chat-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.chat-header {
  background: var(--charcoal-900);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.chat-header h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0;
  line-height: 1.2;
}

.chat-header p {
  font-size: 0.75rem;
  opacity: 0.7;
  margin: 0;
}

.chat-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px; /* Enlarge clickable area */
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  pointer-events: auto;
}

.chat-close:hover {
  opacity: 1;
}

.chat-body {
  padding: 16px;
  height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--tan-50);
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-message p {
  margin: 0;
  color: inherit;
}

.chat-message.bot {
  background: var(--white);
  color: var(--charcoal-800);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  box-shadow: var(--shadow-sm);
}

.chat-message.user {
  background: var(--color-primary);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-message.user p {
  color: #ffffff;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.chat-sug {
  background: var(--white);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chat-sug:hover {
  border-color: var(--color-primary);
  background: var(--red-50);
}

.chat-footer {
  padding: 12px 16px;
  background: var(--white);
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 12px;
}

.chat-footer input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  font-family: var(--font-body);
}

.chat-footer input:focus {
  outline: none;
}

#chat-send {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
}

#chat-send svg {
  width: 24px;
  height: 24px;
}

/* ============ FOMO NOTIFICATIONS ============ */
.fomo-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.fomo-toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 320px;
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
  pointer-events: auto;
  cursor: pointer;
}

.fomo-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.fomo-icon {
  background: var(--red-50);
  color: var(--color-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fomo-content p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--color-text);
}

.fomo-content .fomo-time {
  display: block;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .fomo-container {
    bottom: 80px; /* above the mobile sticky bar */
    left: 12px;
    right: 12px;
  }
  .fomo-toast {
    width: auto;
  }
}

/* ---------- Keystone Credit Bar ---------- */
.keystone-credit {
  text-align: center;
  padding: 12px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #0a0a0a;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.keystone-credit a {
  color: #ffffff;
  opacity: 0.4;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.keystone-credit a:hover {
  opacity: 0.9;
}
