/* NSD Garage - Primary Stylesheet (Blue & White Theme) */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --font-main: 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Color Palette - Navy, Electric Blue & Crisp White */
  --primary-navy: #0B2545;
  --secondary-navy: #134074;
  --electric-blue: #2563EB;
  --blue-hover: #1D4ED8;
  --cyan-accent: #0284C7;
  --ice-blue: #F0F7FF;
  --ice-blue-alt: #E0F2FE;
  --white: #FFFFFF;
  
  --text-dark: #0F172A;
  --text-muted: #475569;
  --text-light: #94A3B8;
  --bg-light: #F8FAFC;
  --border-color: #E2E8F0;
  
  --green-success: #16A34A;
  --red-emergency: #DC2626;

  --shadow-sm: 0 2px 4px rgba(11, 37, 69, 0.04);
  --shadow-md: 0 6px 16px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 16px 36px rgba(11, 37, 69, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Form controls don't inherit the page font by default - without this the
   filter buttons and slider arrows fall back to the browser's system font. */
button, input, select, textarea {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: 94px; /* Space for fixed header on desktop */
  padding-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

ul {
  list-style: none;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-navy);
  font-weight: 700;
  line-height: 1.25;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--electric-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Keeps a Thai phrase on one line so it never splits mid-word */
.nowrap {
  white-space: nowrap;
}

.badge-emergency {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.2);
  color: #FFFFFF;
  border: 1px solid rgba(248, 113, 113, 0.45);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.25);
}

.badge-emergency i {
  color: #FBBF24;
  font-size: 0.95rem;
}

.badge-emergency::before {
  content: '';
  width: 8px;
  height: 8px;
  background-color: #FF4D4D;
  border-radius: 50%;
  box-shadow: 0 0 8px #FF4D4D;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.8); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(255, 77, 77, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

.badge-blue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--ice-blue);
  color: var(--electric-blue);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--ice-blue-alt);
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 70px 0;
}

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

.section-blue {
  background-color: var(--ice-blue);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 50px auto;
}

.section-header h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--electric-blue);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background-color: var(--blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-navy {
  background-color: var(--primary-navy);
  color: var(--white);
}

.btn-navy:hover {
  background-color: var(--secondary-navy);
  transform: translateY(-2px);
}

.btn-outline-blue {
  background-color: transparent;
  border-color: var(--electric-blue);
  color: var(--electric-blue);
}

.btn-outline-blue:hover {
  background-color: var(--electric-blue);
  color: var(--white);
}

.btn-line {
  background-color: #06C755;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(6, 199, 85, 0.3);
}

.btn-line:hover {
  background-color: #05B34C;
  transform: translateY(-2px);
}

.btn-phone {
  background-color: var(--red-emergency);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.btn-phone:hover {
  background-color: #B91C1C;
  transform: translateY(-2px);
}

/* Fixed Header Wrapper */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow-md);
  background-color: var(--white);
}

/* Top Announcement Header Bar */
.top-header {
  background-color: var(--primary-navy);
  color: var(--white);
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-header-info {
  display: flex;
  gap: 20px;
  align-items: center;
}

.top-header-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Main Navigation Bar */
.navbar {
  position: relative;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  transition: all var(--transition-fast);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 94px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo-img {
  height: 76px;
  max-height: 80px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(11, 37, 69, 0.22));
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.06);
  filter: drop-shadow(0 6px 22px rgba(37, 99, 235, 0.38));
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary-navy), var(--electric-blue));
  color: var(--white);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-navy);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--electric-blue);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
  margin-right: auto;
}

.nav-link {
  font-weight: 500;
  color: var(--text-dark);
  padding: 8px 0;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--electric-blue);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--electric-blue);
  border-radius: 3px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile Hamburger Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--primary-navy);
  cursor: pointer;
  padding: 6px;
}

/* Mobile Navigation Drawer */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  z-index: 999;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.mobile-menu.open {
  display: block;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.mobile-nav-link {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 10px;
  border-radius: var(--radius-sm);
  display: block;
}

.mobile-nav-link.active, .mobile-nav-link:hover {
  background-color: var(--ice-blue);
  color: var(--electric-blue);
}

/* Hero Section - Pro Layout */
.hero {
  position: relative;
  background: linear-gradient(135deg, rgba(11, 37, 69, 0.88) 0%, rgba(19, 64, 116, 0.82) 100%), url('../images/hero_banner.webp');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 80px 0 110px 0;
  overflow: hidden;
}

.hero-pro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

/* Hero Image Slider Carousel Component */
.hero-slider-card {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  height: 320px;
  background-color: var(--primary-navy);
}

@media (max-width: 991px) {
  .hero-slider-card {
    height: 280px;
  }
}

@media (max-width: 575px) {
  .hero-slider-card {
    height: 240px;
  }
}

.hero-slider-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(11, 37, 69, 0.88);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 2;
}

.hero-slide-badge i {
  color: #60A5FA;
}

.hero-slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(11, 37, 69, 0.95) 0%, rgba(11, 37, 69, 0.6) 70%, transparent 100%);
  padding: 18px 20px 22px 20px;
  color: #FFF;
  z-index: 2;
}

.hero-slide-caption h4 {
  font-size: 1.02rem;
  color: #FFF;
  margin-bottom: 4px;
  line-height: 1.3;
}

.hero-slide-caption p {
  font-size: 0.82rem;
  color: #CBD5E1;
  margin: 0;
}

/* Slider Arrow Controls */
.hero-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(11, 37, 69, 0.75);
  backdrop-filter: blur(4px);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: all var(--transition-fast);
}

.hero-slider-btn:hover {
  background: var(--electric-blue);
  transform: translateY(-50%) scale(1.1);
}

.hero-slider-btn.prev {
  left: 12px;
}

.hero-slider-btn.next {
  right: 12px;
}

/* Slider Dot Indicators */
.hero-slider-dots {
  position: absolute;
  bottom: 10px;
  right: 16px;
  display: flex;
  gap: 6px;
  z-index: 6;
}

.hero-slider-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-slider-dots .dot.active {
  background: var(--electric-blue);
  width: 20px;
  border-radius: 999px;
}

/* Responsive Grid Utility Classes */
.about-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.stats-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.service-detail-hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

.about-story-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin-bottom: 16px;
  line-height: 1.35;
  /* Even out the two lines instead of forcing a break with a nowrap span,
     which used to overflow on narrow phones. */
  text-wrap: balance;
}

/* Thai body copy: taller leading for tone marks/vowels, and let the browser
   break on Thai word boundaries rather than mid-word. */
.about-story-text {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 18px;
  text-wrap: pretty;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

.about-story-text:last-of-type {
  margin-bottom: 26px;
}

.hero-content h1 {
  color: var(--white);
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 16px 0 20px 0;
}

.hero-content h1 span {
  color: #60A5FA;
  /* "มาตรฐานระดับมืออาชีพ" always starts its own line, at every screen width */
  display: block;
}

/* Coverage highlight strip sitting between the hero headline and subtitle.
   Frosted panel + blue accent bar so it reads as a callout on the photo. */
.hero-coverage {
  max-width: 580px;
  margin-bottom: 22px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: 4px solid #60A5FA;
  background-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-coverage-lead {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.hero-coverage-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hero-coverage-chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #DBEAFE;
  background-color: rgba(96, 165, 250, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.38);
}

.hero-coverage-chips i {
  color: #60A5FA;
  font-size: 0.82rem;
}

.hero-coverage-cta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
}

.hero-coverage-cta i {
  color: #4ADE80;
  font-size: 1.05rem;
  flex-shrink: 0;
}

@media (max-width: 767px) {
  .hero-coverage {
    padding: 14px 16px;
  }

  .hero-coverage-lead {
    font-size: 0.98rem;
  }

  .hero-coverage-chips li {
    font-size: 0.8rem;
    padding: 4px 11px;
  }

  .hero-coverage-cta {
    font-size: 0.86rem;
    align-items: flex-start;
  }

  .hero-coverage-cta i {
    margin-top: 2px;
  }
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #E2E8F0;
  margin-bottom: 28px;
  line-height: 1.65;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

/* Floating White Highlights Bar */
.floating-features-wrapper {
  margin-top: -55px;
  position: relative;
  z-index: 30;
}

.floating-features-card {
  background-color: var(--white);
  border-radius: 18px;
  padding: 24px 30px;
  box-shadow: 0 12px 36px rgba(11, 37, 69, 0.1);
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.floating-feature-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 15px;
  border-right: 1px solid var(--border-color);
}

.floating-feature-box:last-child {
  border-right: none;
  padding-right: 0;
}

.floating-feature-icon-circle {
  width: 48px;
  height: 48px;
  background-color: var(--ice-blue);
  color: var(--electric-blue);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.floating-feature-text h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary-navy);
  margin-bottom: 2px;
}

.floating-feature-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

/* Dark Navy Brand Trust Bar */
.brand-trust-bar {
  background-color: var(--primary-navy);
  color: var(--white);
  border-radius: 16px;
  padding: 18px 30px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}

.brand-trust-rating {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-trust-stars {
  color: #F59E0B;
  font-size: 0.95rem;
}

.brand-logos-row {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.brand-logo-pill {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Hero Quick Contact Box */
.hero-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-md);
  padding: 30px;
  color: var(--text-dark);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-card h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  text-align: center;
}

.hero-card p {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.quick-form .form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--primary-navy);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

select.form-control {
  cursor: pointer;
}

/* Service Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 28px;
}

.service-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

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

.service-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

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

.service-card:hover .service-img-wrapper img {
  transform: scale(1.06);
}

.service-badge-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  background-color: rgba(11, 37, 69, 0.85);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.service-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.service-icon {
  width: 48px;
  height: 48px;
  background-color: var(--ice-blue);
  color: var(--electric-blue);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.service-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.service-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.service-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--electric-blue);
  font-weight: 600;
  font-size: 0.95rem;
}

.service-footer-link i {
  transition: transform var(--transition-fast);
}

.service-card:hover .service-footer-link i {
  transform: translateX(5px);
}

/* Interactive Symptom Checker Section */
.symptom-box {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.symptom-item {
  background-color: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 12px;
}

.symptom-item:hover, .symptom-item.active {
  border-color: var(--electric-blue);
  background-color: var(--ice-blue);
}

.symptom-icon {
  font-size: 1.4rem;
  color: var(--electric-blue);
}

.symptom-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.symptom-result {
  background-color: var(--ice-blue);
  border-left: 4px solid var(--electric-blue);
  padding: 24px;
  border-radius: var(--radius-sm);
  display: none;
}

.symptom-result.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Portfolio Filter Gallery */
.portfolio-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.filter-btn {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  padding: 8px 20px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background-color: var(--electric-blue);
  color: var(--white);
  border-color: var(--electric-blue);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.portfolio-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-fast);
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.portfolio-thumb {
  height: 220px;
  overflow: hidden;
}

.portfolio-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-content {
  padding: 20px;
}

.portfolio-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--electric-blue);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.portfolio-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.portfolio-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Feature Benefits Section */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

/* Service Process Steps Section */
.process-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature-box {
  background-color: var(--white);
  padding: 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  text-align: center;
}

.feature-box-icon {
  width: 60px;
  height: 60px;
  background-color: var(--ice-blue);
  color: var(--electric-blue);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 20px auto;
}

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

.faq-item {
  background-color: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.faq-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--primary-navy);
}

.faq-header span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.faq-icon {
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--electric-blue);
}

.faq-body {
  padding: 0 24px 20px 24px;
  color: var(--text-muted);
  display: none;
  font-size: 0.98rem;
  line-height: 1.6;
}

.faq-item.active .faq-body {
  display: block;
}

/* Facebook Feed Section */
.fb-feed-grid {
  display: grid;
  grid-template-columns: 1fr minmax(300px, 500px);
  gap: 44px;
  align-items: center;
}

/* Narrower than its grid column and pushed right, so the text sits closer to
   the feed card instead of hugging the far left edge of the container. */
.fb-feed-intro {
  max-width: 520px;
  margin-left: auto;
}

.fb-feed-intro h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.fb-feed-intro > p {
  color: var(--text-muted);
  margin-bottom: 22px;
}

.fb-feed-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
}

.fb-feed-points li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.98rem;
}

.fb-feed-points i {
  color: var(--green-success);
  margin-top: 5px;
  flex-shrink: 0;
}

.fb-feed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-facebook {
  background-color: #1877F2;
  color: var(--white);
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.3);
}

.btn-facebook:hover {
  background-color: #0F62D0;
  transform: translateY(-2px);
}

/* Branded frame around the Facebook plugin - the plugin itself renders in a
   sandboxed iframe, so the card around it is the only part we can style. */
.fb-feed-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 100%;
  max-width: 500px;
}

.fb-feed-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
}

.fb-feed-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #1877F2;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.fb-feed-card-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}

.fb-feed-card-meta strong {
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
}

.fb-feed-card-meta span {
  color: #A9C3E4;
  font-size: 0.76rem;
}

.fb-feed-visit {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.fb-feed-visit:hover {
  background-color: rgba(255, 255, 255, 0.26);
}

/* min-height reserves the space so the page doesn't jump while the feed loads */
.fb-feed-frame {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 10px;
  min-height: 540px;
}

.fb-feed-frame iframe {
  position: relative;
  z-index: 1;
  border: 0;
  background-color: var(--white);
}

/* Sits underneath the iframe, so it shows through only when a blocker
   strips the embed out */
.fb-feed-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 20px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.fb-feed-fallback i {
  font-size: 2.2rem;
  color: #1877F2;
  margin-bottom: 12px;
  display: block;
}

.fb-feed-fallback p {
  margin-bottom: 10px;
}

.fb-feed-fallback a {
  color: var(--electric-blue);
  font-weight: 600;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .fb-feed-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .fb-feed-intro {
    max-width: 100%;
    margin-left: 0;
    text-align: center;
  }

  .fb-feed-actions {
    justify-content: center;
  }

  .fb-feed-card {
    margin: 0 auto;
  }
}

/* Diagnostic Section: Desktop Table vs Mobile Cards */
.diagnostic-table-desktop {
  display: block;
}

.diagnostic-cards-mobile {
  display: none;
}

@media (max-width: 767px) {
  .diagnostic-table-desktop {
    display: none;
  }

  .diagnostic-cards-mobile {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .diag-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .diag-card-header {
    background-color: var(--ice-blue);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--ice-blue-alt);
  }

  .diag-card-icon {
    font-size: 1.25rem;
    color: var(--electric-blue);
    flex-shrink: 0;
  }

  .diag-card-icon.red { color: var(--red-emergency); }
  .diag-card-icon.cyan { color: #0284C7; }
  .diag-card-icon.green { color: #16A34A; }

  .diag-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1.35;
  }

  .diag-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .diag-card-row {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .diag-card-label {
    font-weight: 700;
    color: var(--primary-navy);
    display: block;
    margin-bottom: 2px;
  }

  .diag-card-value {
    color: var(--text-muted);
  }

  .diag-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
  }

  .diag-card-badge-green {
    color: #16A34A;
    font-weight: 700;
  }

  .diag-card-btn {
    width: 100%;
    margin-top: 6px;
    padding: 10px 14px;
    font-size: 0.9rem;
    justify-content: center;
  }
}

/* Footer Component */
.footer {
  background-color: var(--primary-navy);
  color: var(--white);
  padding: 70px 0 30px 0;
  border-top: 4px solid var(--electric-blue);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-about p {
  color: #94A3B8;
  font-size: 0.95rem;
  margin: 16px 0 20px 0;
  line-height: 1.6;
}

.footer-heading {
  color: var(--white);
  font-size: 1.15rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 8px;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 35px;
  height: 3px;
  background-color: var(--electric-blue);
  border-radius: 2px;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: #CBD5E1;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--electric-blue);
  padding-left: 4px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #CBD5E1;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer-contact i {
  color: var(--electric-blue);
  margin-top: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #94A3B8;
  font-size: 0.88rem;
}

.footer-bottom a {
  color: #94A3B8;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* Mobile Fixed Bottom Call-To-Action Bar (Disabled) */
.mobile-cta-bar {
  display: none !important;
}

/* Scroll Lock when Modal Popup is Open */
/* Scroll lock while a modal is open. The body is pinned with position:fixed and
   an inline top offset (set in main.js) instead of height:100vh - forcing the
   height collapsed the document and made the browser jump back to the top. */
html.modal-open {
  overflow: hidden !important;
  touch-action: none !important;
}

body.modal-open {
  position: fixed !important;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden !important;
  touch-action: none !important;
}

/* ==========================================================================
   Comprehensive Responsive System (All 5 Standard Breakpoints)
   ========================================================================== */

/* Anti-Overflow & Touch Target Base Guards */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

p, span, h1, h2, h3, h4, h5, h6, a, li, button, td, th {
  overflow-wrap: break-word;
  word-break: break-word;
}

.btn {
  min-height: 44px;
  touch-action: manipulation;
}

/* 1. Laptop / Tablet Landscape (max-width: 1199px) */
@media (max-width: 1199px) {
  .container {
    max-width: 960px;
    padding: 0 20px;
  }

  .brand-logo-img {
    height: 64px;
  }

  .hero-pro-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .floating-features-card {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .floating-feature-box {
    border-right: none;
    padding-right: 0;
  }

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

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

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 28px;
  }
}

/* 2. Tablet Portrait (max-width: 991px) */
@media (max-width: 991px) {
  body {
    padding-top: 80px;
  }

  .container {
    padding: 0 20px;
  }

  .navbar-container {
    height: 80px;
  }

  .brand-logo-img {
    height: 56px;
  }

  .nav-links, .nav-cta {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--primary-navy);
    cursor: pointer;
  }

  .mobile-menu {
    top: 100%;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  .hero-pro-grid,
  .about-story-grid,
  .service-detail-hero-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-content h1 {
    font-size: 2.3rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

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



  .section {
    padding: 55px 0;
  }

  .symptom-box {
    padding: 24px;
  }
}

/* 3. Large Mobile / Small Tablet (max-width: 767px) */
@media (max-width: 767px) {
  body {
    padding-top: 80px;
  }

  .container {
    padding: 0 16px;
  }

  .top-header-content {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  .top-header-info {
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .hero {
    padding: 50px 0 80px 0;
  }

  .hero-content h1 {
    font-size: 1.95rem;
    margin: 12px 0 16px 0;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

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

  .floating-features-wrapper {
    margin-top: -35px;
  }

  .floating-features-card {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 16px;
  }

  .brand-trust-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .process-steps-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .portfolio-filter {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.88rem;
  }

  .section-header {
    margin-bottom: 32px;
  }

  .section-header h2 {
    font-size: 1.7rem;
  }
}

/* 4. Standard Mobile (max-width: 575px) */
@media (max-width: 575px) {
  body {
    padding-top: 72px;
  }

  .container {
    padding: 0 14px;
  }

  .navbar-container {
    height: 72px;
  }

  .mobile-menu {
    top: 100%;
    max-height: calc(100vh - 80px);
  }

  .brand-logo {
    gap: 10px;
  }

  .brand-logo-img {
    height: 48px;
    max-width: 160px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .brand-sub {
    font-size: 0.68rem;
  }

  .hero-content h1 {
    font-size: 1.7rem;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }

  .section-header p {
    font-size: 0.9rem;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    white-space: normal;
    text-align: center;
    min-height: 44px;
  }

  .mobile-cta-bar {
    padding: 8px 12px;
    gap: 8px;
  }

  .mobile-cta-bar .btn {
    font-size: 0.88rem;
    padding: 10px 8px;
    min-height: 44px;
  }

  .quick-form {
    width: 100%;
  }

  .form-control {
    font-size: 16px;
    min-height: 44px;
  }

  .symptom-box {
    padding: 16px;
  }

  .symptom-result {
    padding: 16px;
  }

  .stats-grid-2col {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .faq-header {
    padding: 14px 16px;
    gap: 8px;
  }

  .faq-header span {
    font-size: clamp(0.78rem, 3.2vw, 0.95rem);
  }
}

/* 5. Ultra-Small Mobile (max-width: 375px) */
@media (max-width: 375px) {
  body {
    padding-top: 72px;
  }

  .container {
    padding: 0 10px;
  }

  .brand-logo {
    gap: 8px;
  }

  .brand-logo-img {
    height: 42px;
    max-width: 135px;
  }

  .brand-name {
    font-size: 1rem;
  }

  .brand-sub {
    font-size: 0.62rem;
  }

  .hero-content h1 {
    font-size: 1.45rem;
  }

  .hero-subtitle {
    font-size: 0.88rem;
  }

  .btn {
    font-size: 0.88rem;
    padding: 10px 12px;
    min-height: 44px;
  }

  .mobile-cta-bar {
    padding: 6px 8px;
    gap: 6px;
  }

  .mobile-cta-bar .btn {
    font-size: 0.8rem;
    padding: 8px 4px;
    gap: 4px;
    min-height: 44px;
  }

  .mobile-cta-bar .btn i {
    font-size: 0.85rem;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
}

/* Portfolio Interactive Modal Popup */
.portfolio-card {
  cursor: pointer;
  position: relative;
}

.portfolio-card .portfolio-thumb {
  position: relative;
  overflow: hidden;
}

.portfolio-card .portfolio-thumb::after {
  content: '\f00e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  background: rgba(11, 37, 69, 0.45);
  color: #FFF;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.portfolio-card:hover .portfolio-thumb::after {
  opacity: 1;
}

.portfolio-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.portfolio-modal.open {
  opacity: 1;
  visibility: visible;
}

.portfolio-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 37, 69, 0.82);
  backdrop-filter: blur(8px);
}

.portfolio-modal-container {
  position: relative;
  background: #FFF;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2001;
}

.portfolio-modal.open .portfolio-modal-container {
  transform: scale(1) translateY(0);
}

.portfolio-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.7);
  color: #FFF;
  border: none;
  /* line-height:1 + padding:0 keep the icon dead-centre: the inherited 1.6
     line-height was adding space below the glyph and pushing it upward. */
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2002;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* Any image that opens the lightbox: cursor + magnifier badge on hover */
.img-zoomable {
  cursor: zoom-in;
}

.img-zoom-hint {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: rgba(11, 37, 69, 0.72);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
  z-index: 3;
}

.service-img-wrapper .img-zoom-hint {
  right: 12px;
  bottom: 12px;
}

.hero-slide .img-zoom-hint {
  right: 14px;
  top: 14px;
}

.img-zoomable:hover .img-zoom-hint,
.img-zoomable:focus-visible .img-zoom-hint {
  opacity: 1;
  transform: scale(1);
}

.img-zoomable:focus-visible {
  outline: 3px solid var(--electric-blue);
  outline-offset: 2px;
}

/* Touch devices have no hover, so the hint stays visible there */
@media (hover: none) {
  .img-zoom-hint {
    opacity: 0.9;
    transform: scale(1);
  }
}

.portfolio-modal-close:hover {
  background: #DC2626;
  transform: scale(1.1);
}

/* Fixed height so every popup is the same size no matter whether the photo is
   portrait or landscape - the image is cropped to fit instead of stretching
   the whole modal. */
.portfolio-modal-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  height: clamp(340px, 62vh, 520px);
}

.portfolio-modal-image-wrap {
  background: #0F172A;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px 0 0 20px;
  height: 100%;
  min-height: 0;
}

.portfolio-modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-modal-info {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  overflow-y: auto;
}

.portfolio-modal-info h3 {
  font-size: 1.4rem;
  color: var(--primary-navy);
  margin: 12px 0 16px 0;
  line-height: 1.35;
}

.portfolio-modal-details {
  color: var(--text-dark);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
}

.portfolio-modal-details p {
  margin-bottom: 8px;
}

.portfolio-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 768px) {
  .portfolio-modal-body {
    grid-template-columns: 1fr;
    /* Stacked layout scrolls inside the container instead of being pinned */
    height: auto;
  }
  .portfolio-modal-image-wrap {
    border-radius: 20px 20px 0 0;
    height: 240px;
  }
  .portfolio-modal-info {
    padding: 24px 20px;
    overflow-y: visible;
  }
}

/* ============================================
   Mobile Bottom Navigation Bar
   ============================================ */

/* Hidden on desktop - the standard navbar handles navigation there */
.bottom-nav {
  display: none;
}

@media (max-width: 991px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 1100;
    height: 62px;
    padding: 0 4px;
    align-items: center;
    justify-content: space-between;
    background-color: var(--primary-navy);
    border-radius: 31px;
    box-shadow: 0 10px 30px rgba(11, 37, 69, 0.38);
  }

  .bottom-nav-item {
    position: relative;
    flex: 1 1 0;
    height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #8FA6C4;
    font-family: var(--font-main);
    font-size: 0.66rem;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    transition: color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item i {
    font-size: 1.12rem;
  }

  .bottom-nav-item.active {
    color: var(--white);
  }

  /* Raised centre item ("หน้าแรก") - the bump is the same solid colour as the
     bar so the two shapes merge into one continuous outline. */
  .bottom-nav-item.center {
    flex: 0 0 78px;
    justify-content: flex-end;
    padding-bottom: 8px;
    color: var(--white);
  }

  .bottom-nav-item.center::before {
    content: '';
    position: absolute;
    top: -21px;
    left: 50%;
    transform: translateX(-50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background-color: var(--primary-navy);
    z-index: -1;
  }

  .bottom-nav-item.center .bottom-nav-circle {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--cyan-accent) 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
    transition: transform var(--transition-fast);
  }

  .bottom-nav-item.center .bottom-nav-circle i {
    font-size: 1.35rem;
    color: var(--white);
  }

  .bottom-nav-item.center:active .bottom-nav-circle {
    transform: translateX(-50%) scale(0.94);
  }

  /* Bottom nav replaces the hamburger drawer on mobile */
  .mobile-toggle,
  .mobile-menu {
    display: none !important;
  }

  /* Hero call/LINE buttons are hidden on mobile by request */
  .hero-actions {
    display: none;
  }


  /* Give the floating bar its clearance by growing the footer, not the body.
     Padding on the body sits *below* the footer and renders in the near-white
     page background, which showed as a pale band behind the bar. */
  .footer {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 360px) {
  .bottom-nav-item {
    font-size: 0.6rem;
  }

  .bottom-nav-item.center {
    flex: 0 0 68px;
  }
}

/* ============================================
   Legal Pages (Privacy Policy / Terms)
   ============================================ */

.legal-hero {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  color: var(--white);
  padding: 54px 0 46px 0;
}

.legal-hero-title {
  color: var(--white);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  margin-bottom: 14px;
  text-wrap: balance;
}

.legal-hero-sub {
  color: #CBD5E1;
  font-size: 1.05rem;
  line-height: 1.85;
  max-width: 780px;
  text-wrap: pretty;
}

.legal-meta {
  margin-top: 18px;
  font-size: 0.88rem;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Body copy - constrained measure keeps Thai text comfortable to read */
.legal-content {
  max-width: 860px;
  margin: 0 auto;
}

.legal-content h2 {
  font-size: 1.35rem;
  margin: 40px 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ice-blue-alt);
  text-wrap: balance;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-size: 1.08rem;
  color: var(--secondary-navy);
  margin: 26px 0 10px 0;
}

.legal-content p {
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.9;
  margin-bottom: 16px;
  text-wrap: pretty;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}

.legal-content ul {
  margin: 0 0 20px 0;
  padding-left: 4px;
}

.legal-content li {
  position: relative;
  color: var(--text-muted);
  font-size: 1.02rem;
  line-height: 1.85;
  padding-left: 26px;
  margin-bottom: 10px;
  text-wrap: pretty;
}

.legal-content li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0.72em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--electric-blue);
}

.legal-content strong {
  color: var(--text-dark);
  font-weight: 600;
}

.legal-content a {
  color: var(--electric-blue);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--blue-hover);
}

/* Purpose / legal-basis table */
.legal-table-wrap {
  overflow-x: auto;
  margin-bottom: 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.legal-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.legal-table th {
  background-color: var(--ice-blue);
  color: var(--primary-navy);
  font-weight: 700;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
}

.legal-table td {
  color: var(--text-muted);
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  line-height: 1.75;
  vertical-align: top;
}

.legal-table tbody tr:last-child td {
  border-bottom: none;
}

.legal-table td:last-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--secondary-navy);
}

/* Contact card at the end of the policy */
.legal-contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0 8px 0;
}

.legal-contact-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background-color: var(--ice-blue);
  border: 1px solid var(--ice-blue-alt);
  border-radius: var(--radius-sm);
  color: var(--text-dark) !important;
  text-decoration: none !important;
  font-weight: 400 !important;
  transition: all var(--transition-fast);
}

.legal-contact-row:hover {
  border-color: var(--electric-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.legal-contact-row i {
  font-size: 1.5rem;
  color: var(--electric-blue);
  flex-shrink: 0;
}

.legal-contact-row span {
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 767px) {
  .legal-hero {
    padding: 40px 0 34px 0;
  }

  .legal-content h2 {
    font-size: 1.2rem;
    margin-top: 32px;
  }

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

/* ============================================
   Contact Page - Equal Column Heights (desktop)
   ============================================ */

/* Applies from the width where the grid actually splits into two columns
   (2 x 290px track + 24px gap = 604px of container, i.e. ~636px viewport),
   so tablets get the same treatment as desktop. The grid already stretches
   both columns to the taller one's height; making the left-hand cards
   flexible lets them share that extra space and finish on the same line. */
@media (min-width: 640px) {
  .contact-two-col {
    align-items: stretch;
  }

  .contact-two-col > div {
    height: 100%;
  }

  .contact-channel-card {
    flex: 1 1 0;
  }
}

/* ============================================
   Shared Page Banner (services / portfolio / about)
   ============================================ */

/* min-height + centred flex column keeps every banner the same height whether
   its subtitle runs to one line or two. */
.page-banner {
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--secondary-navy) 100%);
  color: var(--white);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 280px;
  /* Heavier bottom padding lifts the text block off the mathematical centre.
     The big h1 has no descenders, so a perfectly centred box still reads low -
     this puts the visual centre where the eye expects it. */
  padding: 34px 0 54px 0;
}

.page-banner .badge-blue {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.page-banner h1 {
  color: var(--white);
  font-size: 2.4rem;
  margin-bottom: 12px;
  text-wrap: balance;
}

.page-banner p {
  color: #CBD5E1;
  max-width: 820px;
  margin: 0 auto;
  text-wrap: pretty;
}

@media (max-width: 767px) {
  .page-banner {
    min-height: 220px;
    padding: 26px 0 40px 0;
  }

  .page-banner h1 {
    font-size: 1.85rem;
  }

  .page-banner p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .page-banner {
    min-height: 200px;
  }

  .page-banner h1 {
    font-size: 1.6rem;
  }
}

/* ============================================
   Home page "ผลงานล่าสุด" showcase - tablet layout
   ============================================ */

/* The showcase holds exactly 3 cards. On tablet the grid drops to 2 columns,
   which would strand the third card alone in a half-empty row. Let it span the
   full width instead and lay it out sideways so it reads as a feature card
   rather than a stretched thumbnail. */
@media (min-width: 576px) and (max-width: 1199px) {
  .portfolio-grid-showcase .portfolio-card:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(240px, 40%) 1fr;
    align-items: stretch;
  }

  .portfolio-grid-showcase .portfolio-card:last-child .portfolio-thumb {
    height: 100%;
    min-height: 220px;
  }

  .portfolio-grid-showcase .portfolio-card:last-child .portfolio-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
  }
}

/* ============================================
   Supported Car Brands Grid
   ============================================ */

/* Flexbox rather than grid: with 10 logos the final row is often short, and
   flex-wrap + justify-content centres that row instead of leaving a gap on
   the right. Item width matches the old minmax(160px) track. */
.brand-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  max-width: 950px;
  margin: 0 auto;
}

.brand-card {
  flex: 0 1 168px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.brand-card img {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.brand-card span {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary-navy);
  letter-spacing: 0.5px;
}

/* Tablet: pin the 10 logos to exactly 5 per row (2 clean rows). The card is
   narrower here, so the logo and label scale down to keep "MERCEDES-BENZ"
   on one line. */
@media (min-width: 768px) and (max-width: 991px) {
  .brand-card {
    flex: 0 0 calc((100% - 64px) / 5);
    padding: 16px 10px;
    gap: 10px;
  }

  .brand-card img {
    height: 42px;
  }

  .brand-card span {
    font-size: 0.72rem;
    letter-spacing: 0.2px;
  }
}

/* ============================================
   iPad Pro range (992-1199px)
   ============================================ */

/* The container caps at 960px here, so the auto-fit grids land on 3 tracks and
   strand a 4th/3rd card alone on the next row. Pin them instead. */
@media (min-width: 992px) and (max-width: 1199px) {
  /* 4 service cards -> a clean 2 x 2 */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Hero — สลับลำดับเฉพาะมือถือ (<= 767px)
   ============================================ */

/* ย้าย .hero-subtitle ลงไปอยู่ใต้รูปสไลด์ เฉพาะจอมือถือ
   .hero-content เป็น div ครอบเปล่า ๆ ไม่มี style ของตัวเอง จึงใช้
   display:contents ปล่อยลูกทั้ง 4 ขึ้นมาเป็น grid item ของ .hero-pro-grid
   ตรง ๆ แล้วสั่ง order ใหม่ได้ ไม่ต้องเขียนข้อความซ้ำสองที่
   ต้องวางบล็อกนี้ไว้ท้ายไฟล์ ไม่งั้นโดน media query ด้านบนทับ
   จอ >= 768px ไม่โดนแตะ ลำดับเดิมทุกอย่าง */
@media (max-width: 767px) {
  .hero-content {
    display: contents;
  }

  .hero-pro-grid {
    gap: 20px;
  }

  .hero-content h1  { order: 1; margin-bottom: 0; }
  .hero-coverage    { order: 2; margin-bottom: 0; }
  .hero-slider-card { order: 3; }
  .hero-subtitle    { order: 4; margin-bottom: 0; }
  .hero-actions     { order: 5; }
}

/* ============================================
   Utility: <br> ที่ทำงานเฉพาะมือถือ
   ============================================ */

/* ใช้บังคับตัดบรรทัดเฉพาะจอ <= 767px
   จอ >= 768px จะซ่อน <br> ทิ้ง ข้อความไหลต่อกันเป็นบรรทัดเดียวตามเดิม
   วิธีใช้: <p>ข้อความท่อนแรก <br class="br-mobile">ข้อความท่อนสอง</p>
   สำคัญ: ต้องเว้นวรรคไว้หน้า <br> ด้วย ไม่งั้นพอซ่อนบนจอใหญ่
   สองท่อนจะติดกันเป็นคำเดียว */
@media (min-width: 768px) {
  .br-mobile {
    display: none;
  }
}

/* ตรงข้ามกับ .br-mobile — บังคับตัดบรรทัดเฉพาะจอ >= 768px
   จอมือถือจะซ่อน <br> ทิ้ง ข้อความไหลต่อกันตามปกติ
   วิธีใช้: <p>ท่อนแรก <br class="br-desktop">ท่อนสอง</p>
   สำคัญ: ต้องเว้นวรรคไว้หน้า <br> ไม่งั้นพอซ่อนบนมือถือสองท่อนจะติดกัน */
@media (max-width: 767px) {
  .br-desktop {
    display: none;
  }
}

/* ============================================
   About — Story block จัดกึ่งกลางบนมือถือ
   ============================================ */

/* จัดกึ่งกลางเฉพาะป้าย OUR STORY กับหัวข้อ
   ย่อหน้าเนื้อหาด้านล่างปล่อยชิดซ้ายเหมือนเดิม เพราะข้อความยาว
   ถ้าจัดกึ่งกลางด้วยจะอ่านยาก ตาต้องไล่หาจุดเริ่มบรรทัดใหม่ทุกครั้ง
   .about-story-title มี text-wrap: balance อยู่แล้ว (บรรทัด 645)
   บรรทัดจึงถูกเกลี่ยให้ยาวใกล้เคียงกันเองอยู่ก่อนแล้ว */
@media (max-width: 767px) {
  /* badge เดิมเป็น inline-flex ต้องเปลี่ยนเป็น flex + fit-content
     เพื่อให้ margin auto จัดกึ่งกลางได้ โดยไม่ต้องไปแตะ text-align
     ของ div แม่ (ซึ่งจะพาลทำให้ย่อหน้าข้างล่างกึ่งกลางตามไปด้วย) */
  .about-story-grid > div > .badge-blue {
    display: flex;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }

  .about-story-title {
    text-align: center;
  }
}

/* ============================================
   Facebook feed — เหลือแค่การ์ดฟีดอย่างเดียว
   ============================================ */

/* บล็อกข้อความ (.fb-feed-intro) ถูกลบออกจาก HTML แล้ว เหลือการ์ดใบเดียว
   จึงเปลี่ยนเป็นคอลัมน์เดียววางกลาง
   หมายเหตุ: ห้ามใส่ justify-items: center ที่นี่ เพราะจะทำให้ grid item
   หดตามความกว้างเนื้อหาแทนที่จะยืดเต็ม แล้ว JS ที่คำนวณความกว้าง iframe
   จาก frame.clientWidth จะได้ค่าน้อยกว่าจริง การ์ดเลยแคบผิดปกติบนมือถือ */
.fb-feed-grid {
  grid-template-columns: 1fr;
  gap: 28px;
}

.fb-feed-card {
  margin-left: auto;
  margin-right: auto;
}

/* ---- การ์ด Facebook บนมือถือ: ออกแบบใหม่ทั้งชุด ----

   ปัญหาของแบบเดิมบนจอมือถือ
   1. หัวเพจโผล่ซ้ำ 2 ชั้น - แถบน้ำเงินของเราบอกชื่อเพจ แล้ว Facebook
      ก็วาดหัวเพจของมันเองซ้ำอีกใต้ลงมา กินที่ไปเปล่า ๆ ~52px
   2. ปลั๊กอินเว้นพื้นที่ขาวท้าย iframe ที่แก้จากข้างนอกไม่ได้ (ข้าม domain)
   3. แถบหัวการ์ดออกแบบมาสำหรับจอคอม ระยะขอบใหญ่เกินไปบนมือถือ

   แนวทางแก้: เก็บแถบหัวน้ำเงินของเราไว้ (เข้ากับธีมเว็บ และมีปุ่มดูเพจ)
   แล้วเลื่อน iframe ขึ้นซ่อนหัวเพจซ้ำของ Facebook ทิ้ง
   ส่วนท้ายที่เป็นพื้นที่ขาวก็ถูกครอบตัดด้วย overflow: hidden ไปพร้อมกัน */
@media (max-width: 767px) {
  /* มุมโค้งและเงาให้เท่ากับการ์ดอื่น ๆ ในเว็บ */
  .fb-feed-card {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
  }

  /* แถบหัวกระชับขึ้น ให้พื้นที่ไปกับเนื้อหาฟีดแทน */
  .fb-feed-card-head {
    padding: 10px 12px;
    gap: 10px;
  }

  .fb-feed-avatar {
    width: 32px;
    height: 32px;
  }

  .fb-feed-card-meta strong {
    font-size: 0.88rem;
  }

  .fb-feed-card-meta span {
    font-size: 0.7rem;
  }

  .fb-feed-visit {
    font-size: 0.72rem;
  }

  /* ครอบตัดการ์ดให้แคบลงจากด้านขวา
     ปลั๊กอินวาดเนื้อหาจริงกว้างราว 280px แล้วเว้นขาวที่เหลือไว้เฉย ๆ
     JS ยังสร้าง iframe ตามความกว้างจอเต็ม แต่การ์ดถูกหนีบไว้ที่ 280
     ส่วนเกิน (พื้นที่ขาว + แถบเลื่อน) จึงถูก overflow: hidden ตัดทิ้ง
     JS จะไม่ตั้ง maxWidth ทับที่ความกว้างนี้ (ดู isMobile ใน main.js) */
  .fb-feed-card {
    width: 280px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* กรอบฟีด: ครอบตัดหัวและท้ายที่ไม่ต้องการ ให้เหลือแต่เนื้อหาโพสต์
     height 400 + การ์ดกว้าง 280 = ทรงสี่เหลี่ยมผืนผ้าแนวตั้ง

     justify-content: flex-start ทำให้ iframe ชิดซ้าย ส่วนเกินจึงถูกตัด
     จากด้านขวาอย่างเดียว (ค่าเริ่มต้น center จะตัดทั้งสองข้างเท่า ๆ กัน)

     align-items: flex-start จำเป็นด้วยเหตุผลเดียวกันในแนวตั้ง
     ค่าเริ่มต้น stretch จะบีบ iframe ให้เตี้ยลงแทนที่จะครอบตัด */
  .fb-feed-frame {
    padding: 0;
    height: 400px;
    min-height: 0;
    justify-content: flex-start;
    align-items: flex-start;

    /* overflow-y: auto แทน hidden เพื่อให้เลื่อนดูโพสต์ถัดไปได้บนมือถือ
       iframe สูง 700 (ดู data-fb-height-mobile) แต่ช่องมองสูง 400
       ส่วนที่เกินจึงเลื่อนขึ้นมาดูได้ ราว 220px

       ทำไมต้องให้กรอบเป็นตัวเลื่อนเอง: iframe ถูกตั้ง scrolling="no"
       และอยู่ข้าม domain เราสั่งให้เนื้อหาข้างในเลื่อนไม่ได้
       จึงเลื่อน "ช่องมอง" แทน ได้ผลเหมือนกันในมุมผู้ใช้

       overflow-x: hidden คงไว้ เพราะส่วนเกินด้านขวายังต้องถูกตัดทิ้ง */
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* เลื่อนขึ้นซ่อนหัวเพจซ้ำของ Facebook
     -78 ไม่ใช่ -52 เพราะพอการ์ดแคบลงเหลือ 280px หัวเพจของ Facebook
     ตัดบรรทัดเป็น 2 แถว ความสูงจึงเพิ่มขึ้น
     ตัวเลขนี้ผูกกับความกว้างการ์ด ถ้าแก้ width ด้านบนต้องวัดใหม่ด้วย

     ส่วนที่ถูกดันขึ้นไปพ้นขอบบนจะเลื่อนกลับลงมาดูไม่ได้
     (พื้นที่เลื่อนของ scroll container เริ่มนับที่ 0 เสมอ) */
  .fb-feed-frame iframe {
    margin-top: -78px;
  }
}
