/*
Theme Name: California Mechanical HVAC
Theme URI: https://californiamech.com
Author: California Mechanical HVAC Inc.
Description: Premium bilingual (EN/ES) WordPress theme for California Mechanical HVAC Inc. Residential, commercial, HOA, and storage facility services across California. C-20 License #1008598.
Version: 2.3.3
Requires at least: 6.0
Requires PHP: 8.0
License: Proprietary
Text Domain: camech
*/

/* ============================================
   1. DESIGN TOKENS — Brand colors, typography, spacing
   ============================================ */
:root {
  /* Brand colors — pulled directly from the California Mechanical logo */
  --cm-blue: #1E5BB8;
  --cm-blue-dark: #133E7C;
  --cm-blue-darker: #0A2350;
  --cm-red: #DC2626;
  --cm-red-dark: #B91C1C;
  --cm-gold: #F5B800;
  --cm-gold-dark: #D49B00;

  /* Neutrals */
  --cm-black: #0A0A0A;
  --cm-charcoal: #1F1F1F;
  --cm-graphite: #2D2D2D;
  --cm-slate: #5C5C5C;
  --cm-mist: #9CA3AF;
  --cm-cloud: #E5E7EB;
  --cm-fog: #F3F4F6;
  --cm-snow: #FAFAFA;
  --cm-white: #FFFFFF;

  /* Semantic mappings */
  --color-primary: var(--cm-blue-darker);
  --color-primary-mid: var(--cm-blue);
  --color-accent: var(--cm-red);
  --color-highlight: var(--cm-gold);
  --color-text: var(--cm-charcoal);
  --color-text-light: var(--cm-slate);
  --color-text-mute: var(--cm-mist);
  --color-bg: var(--cm-white);
  --color-bg-alt: var(--cm-snow);
  --color-bg-card: var(--cm-white);
  --color-border: var(--cm-cloud);
  --color-border-strong: var(--cm-mist);

  /* Typography */
  --font-display: "Archivo", "Archivo Black", "Helvetica Neue", Helvetica, sans-serif;
  --font-body: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, monospace;

  /* Type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3.5rem;
  --text-6xl: 4.5rem;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 880px;
  --header-height: 88px;
  --header-height-scrolled: 72px;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10, 35, 80, 0.04), 0 1px 3px rgba(10, 35, 80, 0.06);
  --shadow-md: 0 4px 6px rgba(10, 35, 80, 0.05), 0 10px 15px rgba(10, 35, 80, 0.08);
  --shadow-lg: 0 10px 15px rgba(10, 35, 80, 0.08), 0 20px 40px rgba(10, 35, 80, 0.12);
  --shadow-xl: 0 25px 50px rgba(10, 35, 80, 0.18);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ============================================
   2. RESET + BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-primary);
}

h1 { font-size: clamp(2.25rem, 5vw, var(--text-6xl)); font-weight: 900; }
h2 { font-size: clamp(1.875rem, 3.5vw, var(--text-5xl)); }
h3 { font-size: clamp(1.5rem, 2.5vw, var(--text-3xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { line-height: 1.65; }
strong, b { font-weight: 700; color: var(--color-primary); }

.text-accent { color: var(--color-accent); }
.text-highlight { color: var(--color-highlight); }
.text-light { color: var(--color-text-light); }
.text-white { color: var(--cm-white); }

/* Display text — for hero headlines */
.display {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: none;
}

/* Eyebrow text — small label above headlines */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.eyebrow-light { color: var(--cm-gold); }

/* ============================================
   4. LAYOUT — Container, sections
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

.section-sm { padding: var(--space-16) 0; }
.section-lg { padding: var(--space-32) 0; }

.section-dark {
  background: var(--color-primary);
  color: var(--cm-white);
}
.section-dark h1, .section-dark h2, .section-dark h3,
.section-dark h4, .section-dark h5, .section-dark h6 { color: var(--cm-white); }

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

/* ============================================
   5. HEADER + NAVIGATION
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: all 0.3s var(--ease);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-6);
}

.header.scrolled .nav-container { height: var(--header-height-scrolled); }

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s var(--ease);
}
.logo-link:hover { opacity: 0.85; }

.logo-img {
  height: 56px;
  width: auto;
  display: block;
}

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

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex: 1;
  justify-content: flex-end;
}

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

.nav-link {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease);
  position: relative;
}

.nav-link:hover { color: var(--color-accent); }

.nav-link.active {
  color: var(--color-accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  background: var(--color-accent);
  border-radius: var(--radius-pill);
}

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

.lang-toggle {
  display: inline-flex;
  background: var(--color-bg-alt);
  border-radius: var(--radius-pill);
  padding: 3px;
  border: 1px solid var(--color-border);
}

.lang-toggle button {
  padding: 6px 12px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text-light);
  border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease);
}

.lang-toggle button.active {
  background: var(--color-primary);
  color: var(--cm-white);
}

.header-phones {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-phone-sep {
  color: var(--color-border-strong);
  font-weight: 700;
  margin: 0 2px;
  user-select: none;
}

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  border-radius: var(--radius-pill);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}

.header-phone:hover {
  background: var(--color-accent);
  color: var(--cm-white);
}

.header-phone i {
  color: var(--color-accent);
  font-size: var(--text-base);
}

.header-phone:hover i { color: var(--cm-white); }

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 24px;
  border-radius: var(--radius-md);
}

.mobile-toggle:hover { background: var(--color-bg-alt); }

/* ============================================
   6. BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--cm-white);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--cm-red-dark);
  border-color: var(--cm-red-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-primary);
  color: var(--cm-white);
  border-color: var(--color-primary);
}
.btn-secondary:hover {
  background: var(--cm-blue-darker);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-border-strong);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: var(--cm-white);
  border-color: var(--color-primary);
}

.btn-outline-light {
  background: transparent;
  color: var(--cm-white);
  border-color: rgba(255, 255, 255, 0.4);
}
.btn-outline-light:hover {
  background: var(--cm-white);
  color: var(--color-primary);
  border-color: var(--cm-white);
}

.btn-gold {
  background: var(--color-highlight);
  color: var(--cm-charcoal);
  border-color: var(--color-highlight);
}
.btn-gold:hover {
  background: var(--cm-gold-dark);
  border-color: var(--cm-gold-dark);
  transform: translateY(-1px);
}

.btn-lg { padding: 18px 36px; font-size: var(--text-base); }
.btn-sm { padding: 10px 20px; font-size: var(--text-xs); }

.btn-block { display: flex; width: 100%; }

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ============================================
   7. HERO SECTIONS
   ============================================ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--header-height) + var(--space-12));
  padding-bottom: var(--space-16);
  overflow: hidden;
  background: var(--color-primary);
  color: var(--cm-white);
}

.hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(10, 35, 80, 0.88) 0%, rgba(10, 35, 80, 0.62) 50%, rgba(10, 35, 80, 0.78) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero h1 {
  color: var(--cm-white);
  margin-bottom: var(--space-6);
  max-width: 880px;
}

.hero h1 .accent {
  display: block;
  color: var(--color-highlight);
}

.hero-lede {
  font-size: var(--text-xl);
  line-height: 1.5;
  max-width: 640px;
  margin-bottom: var(--space-8);
  color: rgba(255, 255, 255, 0.92);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hero-meta-label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-highlight);
}

.hero-meta-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--cm-white);
}

/* Inner page hero — shorter than homepage */
.hero-inner {
  min-height: 60vh;
  padding-top: calc(var(--header-height) + var(--space-10));
  padding-bottom: var(--space-12);
}

.hero-inner h1 { font-size: clamp(2rem, 4.5vw, 4rem); }

/* ============================================
   8. CARDS + GRIDS
   ============================================ */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all 0.3s var(--ease);
  height: 100%;
}

.card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: var(--space-6);
  background: var(--color-primary);
  color: var(--cm-white);
  border-radius: var(--radius-md);
  font-size: 28px;
}

.card-icon-accent { background: var(--color-accent); }
.card-icon-gold { background: var(--color-highlight); color: var(--cm-charcoal); }

.card h3 {
  margin-bottom: var(--space-3);
  font-size: var(--text-2xl);
}

.card-price {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 4px 10px;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--color-accent);
  background: rgba(220, 38, 38, 0.08);
  border-radius: var(--radius-sm);
}

.card-list {
  list-style: none;
  padding: 0;
  margin: var(--space-4) 0 0;
}

.card-list li {
  position: relative;
  padding-left: var(--space-6);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text);
}

.card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 14px;
  height: 2px;
  background: var(--color-accent);
}

/* ============================================
   9. FEATURES LIST
   ============================================ */
.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.features-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.features-list i {
  color: var(--color-accent);
  font-size: var(--text-xl);
  flex-shrink: 0;
  margin-top: 2px;
}

.features-list p { margin: 0; line-height: 1.55; }

/* ============================================
   10. STATS BAR
   ============================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-6);
  padding: var(--space-12) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.stat-item {
  text-align: center;
  padding: 0 var(--space-4);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, var(--text-5xl));
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
}

.stat-label {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.stats-dark .stat-value { color: var(--cm-white); }
.stats-dark .stat-label { color: var(--color-highlight); }

/* ============================================
   11. SPLIT SECTIONS — Two-column layouts
   ============================================ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.split-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.split-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.split-content h2 { margin-bottom: var(--space-4); }
.split-content p { margin-bottom: var(--space-4); color: var(--color-text-light); }

/* ============================================
   12. CTA BLOCKS
   ============================================ */
.cta-block {
  background: var(--color-primary);
  color: var(--cm-white);
  padding: var(--space-16) var(--space-8);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-block::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 184, 0, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.cta-block h2 {
  color: var(--cm-white);
  margin-bottom: var(--space-4);
  position: relative;
}

.cta-block p {
  font-size: var(--text-lg);
  max-width: 640px;
  margin: 0 auto var(--space-8);
  color: rgba(255, 255, 255, 0.92);
  position: relative;
}

.cta-block .btn-group {
  justify-content: center;
  position: relative;
}

/* ============================================
   13. FORMS
   ============================================ */
.form-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
}

.form-card h3 {
  margin-bottom: var(--space-6);
  font-size: var(--text-2xl);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

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

.form-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--cm-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.2s var(--ease);
  font-family: var(--font-body);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

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

.form-helper {
  font-size: var(--text-xs);
  color: var(--color-text-light);
  margin-top: var(--space-2);
}

.form-success, .form-error {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.form-success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #064e3b;
}

.form-error {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #7f1d1d;
}

/* ============================================
   14. FOOTER
   ============================================ */
.footer {
  background: var(--cm-blue-darker);
  color: var(--cm-cloud);
  padding: var(--space-20) 0 var(--space-6);
  margin-top: var(--space-24);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand img {
  width: 220px;
  margin-bottom: var(--space-5);
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}

.footer-license {
  display: inline-block;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--color-highlight);
  border: 1px solid rgba(245, 184, 0, 0.4);
  border-radius: var(--radius-sm);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-highlight);
  margin-bottom: var(--space-5);
}

.footer-list { display: flex; flex-direction: column; gap: var(--space-2); }

.footer-list a {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s var(--ease);
}

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

.footer-list i {
  color: var(--color-highlight);
  margin-right: 6px;
  font-size: var(--text-base);
  vertical-align: middle;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   15. CHATBOT
   ============================================ */
.chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: var(--color-accent);
  color: var(--cm-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  cursor: pointer;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  transition: all 0.2s var(--ease);
  border: none;
}

.chat-launcher:hover { transform: scale(1.05); background: var(--cm-red-dark); }

.chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 48px);
  max-height: 540px;
  background: var(--cm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 91;
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.chat-window.active { display: flex; }

.chat-header {
  background: var(--color-primary);
  color: var(--cm-white);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.chat-header-title {
  font-weight: 700;
  font-size: var(--text-base);
}

.chat-header-subtitle {
  font-size: var(--text-xs);
  color: var(--color-highlight);
  margin-top: 2px;
}

.chat-close {
  color: var(--cm-white);
  font-size: var(--text-xl);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.chat-close:hover { background: rgba(255, 255, 255, 0.15); }

.chat-messages {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
  background: var(--color-bg-alt);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat-bubble {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.45;
  animation: chatBubbleIn 0.25s var(--ease-out);
}

@keyframes chatBubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble.bot {
  background: var(--cm-white);
  color: var(--color-text);
  align-self: flex-start;
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.chat-bubble.user {
  background: var(--color-primary);
  color: var(--cm-white);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-options {
  padding: var(--space-3) var(--space-4);
  background: var(--cm-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex-shrink: 0;
}

.chat-option-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.chat-option-btn:hover {
  background: var(--color-primary);
  color: var(--cm-white);
  border-color: var(--color-primary);
}

.chat-input-row {
  display: flex;
  gap: var(--space-2);
}

.chat-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.chat-send {
  width: 40px;
  background: var(--color-accent);
  color: var(--cm-white);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
}

/* ============================================
   16. LANGUAGE TOGGLE BEHAVIOR
   ============================================ */
.lang-en, .lang-es { display: none; }
html[lang="en"] .lang-en { display: inline; }
html[lang="es"] .lang-es { display: inline; }

/* For block-level language elements */
.lang-block-en, .lang-block-es { display: none; }
html[lang="en"] .lang-block-en { display: block; }
html[lang="es"] .lang-block-es { display: block; }

/* ============================================
   17. UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* ============================================
   COMMON MISTAKES / Q&A SECTION
   Editorial single-column layout. Each item is a Q&A pair with a
   numbered red accent and clear typographic hierarchy.
   ============================================ */
.mistakes-intro {
  max-width: 720px;
  margin: 0 auto var(--space-12);
  text-align: center;
}

.mistakes-intro h2 {
  margin-bottom: var(--space-5);
}

.mistakes-lede {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-text-light);
}

.mistakes-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 760px;
  margin: 0 auto;
}

.mistake-item {
  position: relative;
  background: var(--cm-white);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-8) var(--space-8) calc(var(--space-8) + var(--space-12));
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-accent);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.mistake-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.mistake-num {
  position: absolute;
  left: var(--space-6);
  top: var(--space-8);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-accent);
  color: var(--cm-white);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 900;
  letter-spacing: 0.04em;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.mistake-question {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2.2vw, var(--text-2xl));
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-4);
}

.mistake-answer {
  color: var(--color-text);
  font-size: var(--text-base);
}

.mistake-answer p {
  line-height: 1.7;
  margin: 0;
}

.mistake-answer strong {
  color: var(--color-primary);
  font-weight: 700;
}

@media (max-width: 640px) {
  .mistake-item {
    padding: var(--space-6);
    padding-top: calc(var(--space-6) + var(--space-12) + var(--space-2));
  }
  .mistake-num {
    left: var(--space-6);
    top: var(--space-6);
    width: 36px;
    height: 36px;
    font-size: var(--text-xs);
  }
  .mistake-question {
    font-size: var(--text-lg);
  }
}

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }

.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-8) 0;
}

.divider-light { background: rgba(255, 255, 255, 0.18); }

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-6);
}

.badge-pill-light {
  color: var(--color-highlight);
  background: rgba(245, 184, 0, 0.12);
  border-color: rgba(245, 184, 0, 0.3);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* ============================================
   17.5. BLOG / INSIGHTS — post grid, single post, video, prose, Q&A, pagination
   ============================================ */

/* Post grid (used on home, archive, related posts) */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-8);
}

/* Insight card */
.insight-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s var(--ease);
  height: 100%;
}

.insight-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.insight-card-link {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.insight-card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.insight-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

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

.insight-card-video-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cm-white);
  background: var(--color-accent);
  border-radius: var(--radius-pill);
  z-index: 2;
}

.insight-card-video-badge i { font-size: var(--text-base); }

.insight-card-cat {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-pill);
  z-index: 2;
}

.insight-card-body {
  padding: var(--space-6);
}

.insight-card-title {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: color 0.2s var(--ease);
}

.insight-card:hover .insight-card-title {
  color: var(--color-accent);
}

.insight-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  line-height: 1.55;
  margin-bottom: var(--space-4);
}

.insight-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-text-light);
  letter-spacing: 0.04em;
}

.insight-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.insight-card-meta i {
  font-size: var(--text-base);
  color: var(--color-accent);
}

/* Single post hero meta bar */
.post-hero h1 {
  margin-bottom: var(--space-6);
  max-width: 920px;
}

.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.post-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.post-meta-item i {
  font-size: var(--text-lg);
  color: var(--color-highlight);
}

/* Single post body — prose typography */
.post-body-section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.post-content {
  font-size: var(--text-lg);
  line-height: 1.75;
  color: var(--color-text);
}

.post-content > * + * { margin-top: var(--space-6); }

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  scroll-margin-top: calc(var(--header-height) + 24px);
}

.post-content h2 {
  font-size: clamp(1.75rem, 3vw, var(--text-4xl));
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-10);
}

.post-content h3 {
  font-size: var(--text-2xl);
}

.post-content h4 {
  font-size: var(--text-xl);
  color: var(--color-accent);
}

.post-content p {
  font-size: inherit;
  line-height: inherit;
  margin: 0;
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease);
}

.post-content a:hover {
  color: var(--cm-red-dark);
}

.post-content strong {
  color: var(--color-primary);
  font-weight: 700;
}

.post-content blockquote {
  border-left: 4px solid var(--color-accent);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  font-size: var(--text-xl);
  font-style: italic;
  color: var(--color-text-light);
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.post-content blockquote p:first-child { margin-top: 0; }

.post-content ul,
.post-content ol {
  padding-left: var(--space-6);
}

.post-content ul li,
.post-content ol li {
  margin-bottom: var(--space-3);
  padding-left: var(--space-2);
  line-height: 1.65;
}

.post-content ul li::marker { color: var(--color-accent); }
.post-content ol li::marker { color: var(--color-accent); font-weight: 700; }

.post-content img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.post-content figure {
  margin: var(--space-10) 0;
}

.post-content figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  text-align: center;
  margin-top: var(--space-3);
  font-style: italic;
}

.post-content code {
  background: var(--color-bg-alt);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--color-accent);
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-10) 0;
}

/* Responsive video container (YouTube/Vimeo) */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: var(--cm-black);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-10) 0;
  box-shadow: var(--shadow-lg);
}

.video-container iframe,
.video-container embed,
.video-container object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Q&A — for <details>/<summary> blocks (and Rank Math FAQ block) */
.post-content details,
.wp-block-rank-math-faq-block .rank-math-faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5) var(--space-6);
  margin-top: var(--space-3);
  background: var(--cm-white);
  transition: all 0.2s var(--ease);
}

.post-content details[open],
.wp-block-rank-math-faq-block .rank-math-faq-item[open] {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.post-content details summary {
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: var(--space-8);
  font-size: var(--text-lg);
}

.post-content details summary::-webkit-details-marker { display: none; }

.post-content details summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 1.5em;
  font-weight: 800;
  color: var(--color-accent);
  transition: transform 0.2s var(--ease);
}

.post-content details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.post-content details summary + * {
  margin-top: var(--space-3);
}

/* Tags */
.post-tags {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.post-tags-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
  margin-right: var(--space-2);
}

.post-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-bg-alt);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.post-tag:hover {
  background: var(--color-primary);
  color: var(--cm-white);
}

/* Pagination */
.pagination {
  margin-top: var(--space-12);
  display: flex;
  justify-content: center;
}

.pagination-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}

.pagination-item .page-numbers,
.pagination-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.pagination-item .page-numbers:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pagination-item .page-numbers.current {
  background: var(--color-primary);
  color: var(--cm-white);
  border-color: var(--color-primary);
}

.pagination-item .page-numbers.dots {
  border: none;
  background: transparent;
}


@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; gap: var(--space-10); }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  :root { --header-height: 72px; --header-height-scrolled: 64px; }

  .mobile-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--cm-white);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-6);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-6);
    box-shadow: var(--shadow-lg);
    transform: translateY(-110%);
    transition: transform 0.3s var(--ease);
    z-index: 99;
  }

  .nav-menu.open { transform: translateY(0); }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-4);
  }

  .nav-link {
    display: block;
    padding: var(--space-3);
    font-size: var(--text-base);
    border-radius: var(--radius-md);
  }

  .nav-link:hover { background: var(--color-bg-alt); }

  .nav-link.active::after { display: none; }

  .nav-actions {
    flex-direction: column;
    gap: var(--space-3);
    align-items: stretch;
  }

  .header-phones {
    flex-direction: column;
    gap: var(--space-2);
    width: 100%;
    align-items: stretch;
  }

  .header-phone-sep { display: none; }

  .header-phone {
    justify-content: center;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border-strong);
  }

  .lang-toggle {
    align-self: center;
  }

  .hero { min-height: 80vh; }
  .hero-meta { gap: var(--space-4); }
  .hero-meta-item { flex: 1 1 45%; }

  .section { padding: var(--space-16) 0; }
  .section-lg { padding: var(--space-20) 0; }

  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); }
  .footer-brand img { width: 180px; }

  .stats-bar { grid-template-columns: 1fr 1fr; gap: var(--space-4); padding: var(--space-8) 0; }

  .chat-window {
    bottom: 90px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    max-height: 70vh;
  }

  .chat-launcher { right: 16px; bottom: 16px; }
}

@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .btn-group { flex-direction: column; align-items: stretch; }
  .btn-group .btn { width: 100%; }

  .stats-bar { grid-template-columns: 1fr; }

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

  .container { padding: 0 var(--space-4); }

  .card { padding: var(--space-6); }
  .form-card { padding: var(--space-6); }
}
