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

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  font-size: 1rem;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
  padding: 20px 0;
}

.hero-section h1 {
  font-weight: 700;
  line-height: 1.2;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.hero-section .lead {
  font-size: 1.15rem;
}

/* Service Cards */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 10px;
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
}

.service-icon {
  transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
}

/* Homepage service card image fallback - ensure flex display when image fails */
.service-icon-fallback {
  display: none;
}

/* Hero logos carousel - infinite scroll, logos always follow each other */
.hero-section .hero-logos-container {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 20px 0 0 0 !important;
  padding: 0 !important;
}
.hero-section .hero-logos-carousel-wrapper {
  width: 100% !important;
  display: flex !important;
  justify-content: flex-start !important;
  overflow: hidden !important;
}
.hero-section .hero-logos-row {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 30px !important;
  width: max-content !important;
}
.hero-section .hero-logos-row.hero-logos-infinite {
  animation: hero-logos-scroll 40s linear infinite;
}
@keyframes hero-logos-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.hero-section .logo-item-carousel {
  width: 110px !important;
  height: 55px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  min-width: 110px !important;
}
@media (max-width: 768px) {
  .hero-section .hero-logos-carousel-wrapper {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    justify-content: flex-start !important;
    scroll-behavior: smooth !important;
    padding: 15px 0 !important;
  }
  .hero-section .hero-logos-row {
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: max-content !important;
  }
  .hero-section .logo-item-carousel {
    width: 100px !important;
    height: 50px !important;
    min-width: 100px !important;
  }
  .hero-section .logo-item-carousel img {
    max-width: 98px !important;
    max-height: 43px !important;
  }
}

/* Cards */
.card {
  border-radius: 10px;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-title {
  font-size: 1.25rem;
}

.card-text {
  font-size: 1rem;
}

/* Product Service Cards */
.product-service-card {
  min-height: 300px;
  margin-bottom: 2rem;
}

.product-service-card .card-body {
  padding: 2rem !important;
}

.product-image-placeholder {
  width: 100%;
  height: 250px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
}

.product-image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
}

/* Navigation */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.3rem;
}

.nav-link {
  font-weight: 500;
  transition: color 0.3s ease;
  font-size: 1rem;
}

.nav-link:hover {
  color: rgba(255,255,255,0.8) !important;
}

/* Footer */
footer {
  margin-top: auto;
}

footer a {
  transition: color 0.3s ease;
}

footer a:hover {
  color: #fff !important;
  text-decoration: underline !important;
}

/* Buttons */
.btn {
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-lg {
  font-size: 1.1rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Forms */
.form-control, .form-select {
  border-radius: 5px;
  border: 1px solid #dee2e6;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Badges */
.badge {
  font-weight: 600;
}

/* Alerts */
.alert {
  border-radius: 8px;
  border: none;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* Section Spacing */
section {
  padding: 50px 0;
}

/* Headings */
h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.1rem;
}

.display-4 {
  font-size: 2.8rem;
}

.display-5 {
  font-size: 2.2rem;
}

.lead {
  font-size: 1.15rem;
}

/* Text Colors */
.text-primary {
  color: #0d6efd !important;
}

.bg-primary {
  background-color: #0d6efd !important;
}

/* Accessibility */
a:focus, button:focus {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar, footer, .btn {
    display: none;
  }
}

/* Smooth Animations */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Gas Safety Page Specific Styles */
.gas-safety-page {
  background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100%);
}

.gas-safe-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gas-safe-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

.gas-safe-logo {
  max-height: 140px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.3s ease;
}

.gas-safe-logo:hover {
  transform: scale(1.05);
}

/* Boiler Company Logos */
.boiler-logo {
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.9;
  object-fit: contain;
}

.boiler-logo:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* Boiler Logos Carousel */
.boiler-logos-carousel-container {
  overflow: hidden;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.boiler-logos-carousel {
  display: flex;
  align-items: center;
  gap: 2rem;
  transition: transform 0.6s ease-in-out;
  will-change: transform;
}

.boiler-logo-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

/* Pause on hover */
.boiler-logos-carousel-container:hover .boiler-logos-carousel {
  transition-duration: 0.3s;
}

/* Service Icons Carousel */
.service-icons-carousel-container {
  overflow: hidden;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.service-icons-carousel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.6s ease-in-out;
  will-change: transform;
}

.service-icon-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
}

/* Pause on hover */
.service-icons-carousel-container:hover .service-icons-carousel {
  transition-duration: 0.3s;
}

/* "We fit and service" text styling */
.gas-safe-card .d-flex span {
  margin: 0 1rem;
}

/* Pest content carousel - left-aligned auto-scroll like Gas section */
.pest-content-carousel-wrapper {
  min-width: 0;
  flex: 1;
}

.pest-content-box-row {
  justify-content: flex-start;
}

.pest-content-box-row .text-center {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .gas-safe-card .d-flex span {
    margin: 0.5rem 0;
    display: block;
    width: 100%;
  }
  .pest-content-box-row {
    justify-content: center;
  }
}

.section-title {
  color: #212529;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
}

.section-subtitle {
  color: #6c757d;
  line-height: 1.8;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Service Cards Modern Style */
.service-card-modern {
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
}

.service-card-modern:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12) !important;
}

.service-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  transition: transform 0.5s ease;
}

.service-card-modern:hover .service-image {
  transform: scale(1.05);
}

.service-image-placeholder {
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
}

.service-icon-large {
  font-size: 5rem;
  opacity: 0.7;
  transition: transform 0.3s ease;
}

.service-card-modern:hover .service-icon-large {
  transform: scale(1.1);
}

.service-icon-header {
  font-size: 2.8rem;
  transition: transform 0.3s ease;
}

.service-card-modern:hover .service-icon-header {
  transform: scale(1.1) rotate(5deg);
}

.service-title {
  color: #212529;
  font-size: 1.75rem;
  line-height: 1.3;
}

.service-price {
  font-size: 1.25rem;
  color: #0d6efd;
}

.service-tagline {
  color: #495057;
  font-size: 1.15rem;
  line-height: 1.5;
}

.service-description {
  color: #6c757d;
  line-height: 1.8;
  font-size: 1.05rem;
}

.service-btn {
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.service-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

/* Feature Cards */
.feature-card {
  border-radius: 12px;
  transition: all 0.3s ease;
  background: #ffffff;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.1) !important;
}

.feature-icon {
  font-size: 2.5rem;
  transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.15) rotate(5deg);
}

/* Responsibilities Section */
.responsibilities-section {
  background: #f8f9fa;
  padding: 3rem;
  border-radius: 16px;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.responsibilities-list {
  list-style: none;
  padding: 0;
  max-width: 700px;
  margin: 0 auto;
}

.responsibilities-list li {
  padding: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  background: #ffffff;
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  font-size: 1.05rem;
  line-height: 1.6;
}

.responsibilities-list li:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border-left-color: #0a58ca;
}

.responsibilities-list li:before {
  content: "✓";
  color: #0d6efd;
  font-weight: bold;
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

/* CTA Card */
.cta-card {
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  transition: transform 0.3s ease;
}

.cta-card:hover {
  transform: scale(1.02);
}

.cta-btn {
  border-radius: 10px;
  padding: 0.875rem 2rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* ============================================
   RESPONSIVE DESIGN - Mobile, Tablet, Desktop
   ============================================ */

/* Mobile Devices (max-width: 576px) */
@media (max-width: 576px) {
  /* Gas Safety Page */
  .gas-safety-page {
    padding: 2rem 0 !important;
  }
  
  .gas-safe-card .card-body {
    padding: 1.5rem !important;
  }
  
  .gas-safe-logo {
    max-height: 100px;
  }
  
  .boiler-logo {
    max-height: 80px !important;
    max-width: 150px !important;
  }
  
  /* Section Titles */
  .section-title {
    font-size: 1.75rem !important;
    margin-bottom: 1rem;
  }
  
  .section-subtitle {
    font-size: 1rem !important;
    padding: 0 1rem;
  }
  
  /* Service Cards */
  .service-card-modern .card-body {
    padding: 1.5rem !important;
  }
  
  .service-card-modern .row {
    flex-direction: column;
  }
  
  .service-image,
  .service-image-placeholder {
    height: 200px;
    margin-bottom: 1.5rem;
  }
  
  .service-title {
    font-size: 1.5rem !important;
    margin-bottom: 0.75rem;
  }
  
  .service-price {
    font-size: 1.1rem !important;
  }
  
  .service-tagline {
    font-size: 1rem !important;
    margin-bottom: 1rem;
  }
  
  .service-description {
    font-size: 1rem !important;
    margin-bottom: 1.5rem;
  }
  
  .service-icon-header {
    font-size: 2rem !important;
  }
  
  /* Buttons */
  .service-btn {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
  }
  
  .service-btn:last-child {
    margin-bottom: 0;
  }
  
  /* Feature Cards */
  .feature-card {
    margin-bottom: 1.5rem;
  }
  
  .feature-icon {
    font-size: 2rem !important;
  }
  
  /* Responsibilities Section */
  .responsibilities-section {
    padding: 1.5rem 1rem !important;
    margin-top: 2rem !important;
    margin-bottom: 2rem !important;
  }
  
  .responsibilities-section h2 {
    font-size: 1.5rem !important;
    margin-bottom: 1rem;
  }
  
  .responsibilities-list {
    padding: 0;
  }
  
  .responsibilities-list li {
    padding: 0.875rem 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
  }
  
  /* CTA Card */
  .cta-card .card-body {
    padding: 2rem 1.5rem !important;
  }
  
  .cta-card h3 {
    font-size: 1.5rem !important;
    margin-bottom: 1rem;
  }
  
  .cta-card .lead {
    font-size: 1rem !important;
    margin-bottom: 1.5rem;
  }
  
  .cta-btn {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
  }
  
  .cta-btn:last-child {
    margin-bottom: 0;
  }
  
  /* Container Padding */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Spacing Adjustments */
  .mb-5 {
    margin-bottom: 2rem !important;
  }
  
  .mt-5 {
    margin-top: 2rem !important;
  }
  
  .mb-4 {
    margin-bottom: 1.5rem !important;
  }
  
  .mt-4 {
    margin-top: 1.5rem !important;
  }
}

/* Tablet Devices (577px - 992px) */
@media (min-width: 577px) and (max-width: 992px) {
  /* Gas Safety Page */
  .gas-safety-page {
    padding: 3rem 0;
  }
  
  .gas-safe-card .card-body {
    padding: 3rem !important;
  }
  
  .gas-safe-logo {
    max-height: 120px;
  }
  
  /* Section Titles */
  .section-title {
    font-size: 2rem !important;
  }
  
  .section-subtitle {
    font-size: 1.1rem !important;
    padding: 0 2rem;
  }
  
  /* Service Cards */
  .service-card-modern .card-body {
    padding: 2.5rem !important;
  }
  
  .service-image,
  .service-image-placeholder {
    height: 220px;
  }
  
  .service-title {
    font-size: 1.65rem !important;
  }
  
  .service-price {
    font-size: 1.15rem !important;
  }
  
  .service-tagline {
    font-size: 1.1rem !important;
  }
  
  .service-description {
    font-size: 1.05rem !important;
  }
  
  /* Buttons */
  .service-btn {
    padding: 0.875rem 1.75rem !important;
    font-size: 1.05rem !important;
  }
  
  /* Feature Cards Grid */
  .feature-card {
    margin-bottom: 1.5rem;
  }
  
  /* Responsibilities Section */
  .responsibilities-section {
    padding: 2.5rem 2rem !important;
  }
  
  .responsibilities-list li {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  /* CTA Card */
  .cta-card .card-body {
    padding: 3rem 2rem !important;
  }
  
  .cta-btn {
    padding: 0.875rem 2rem !important;
    margin-bottom: 0.5rem;
  }
  
  /* Container */
  .container {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Small Desktop / Large Tablet (993px - 1199px) */
@media (min-width: 993px) and (max-width: 1199px) {
  .service-image,
  .service-image-placeholder {
    height: 240px;
  }
  
  .service-card-modern .card-body {
    padding: 3rem !important;
  }
  
  .container {
    max-width: 1140px;
  }
}

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
  .service-image,
  .service-image-placeholder {
    height: 250px;
  }
  
  .service-card-modern .card-body {
    padding: 4rem !important;
  }
  
  .container {
    max-width: 1320px;
  }
}

/* Landscape Mobile Orientation */
@media (max-width: 992px) and (orientation: landscape) {
  .service-image,
  .service-image-placeholder {
    min-height: 180px;
  }
  
  .gas-safe-logo {
    max-height: 90px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .service-btn,
  .cta-btn {
    min-height: 48px;
    padding: 0.875rem 1.5rem !important;
  }
  
  .service-card-modern,
  .feature-card,
  .gas-safe-card {
    cursor: pointer;
  }
  
  /* Larger tap targets for mobile */
  .service-btn,
  .cta-btn {
    font-size: 1.05rem !important;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .service-image,
  .gas-safe-logo {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print Styles */
@media print {
  .service-btn,
  .cta-btn,
  .gas-safe-card,
  .service-card-modern {
    box-shadow: none !important;
    page-break-inside: avoid;
  }
  
  .service-image {
    height: 200px;
  }
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Improved Typography */
h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
}

/* Better Spacing */
.mb-5 {
  margin-bottom: 3.5rem !important;
}

.mt-5 {
  margin-top: 3.5rem !important;
}

/* FAQ Section Styles */
.faq-section {
  background: #ffffff;
  padding: 3rem 0;
}

.faq-section .accordion {
  max-width: 900px;
  margin: 0 auto;
}

.faq-section .accordion-item {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.faq-section .accordion-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.faq-section .accordion-button {
  background-color: #f8f9fa;
  color: #212529;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 1.25rem 1.5rem;
  border: none;
  transition: all 0.3s ease;
}

.faq-section .accordion-button:not(.collapsed) {
  background-color: #0d6efd;
  color: #ffffff;
  box-shadow: none;
}

.faq-section .accordion-button:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-color: transparent;
}

.faq-section .accordion-body {
  padding: 1.5rem;
  background-color: #ffffff;
  color: #495057;
  line-height: 1.7;
  font-size: 1rem;
}

/* Responsive FAQ */
@media (max-width: 768px) {
  .faq-section {
    padding: 2rem 0;
  }
  
  .faq-section .accordion-button {
    font-size: 0.95rem;
    padding: 1rem 1.25rem;
  }
  
  .faq-section .accordion-body {
    padding: 1.25rem;
    font-size: 0.95rem;
  }
}

/* Service Icon Cards */
.service-icon-card {
  background: #ffffff;
  border-radius: 12px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.service-icon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: #0d6efd;
}

.service-icon-card i {
  transition: transform 0.3s ease;
}

.service-icon-card:hover i {
  transform: scale(1.15);
}

.service-icon-card h6 {
  font-weight: 600;
  color: #212529;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 768px) {
  .service-icon-card {
    min-height: 100px;
    padding: 1rem !important;
  }
  
  .service-icon-card i {
    font-size: 2rem !important;
  }
  
  .service-icon-card h6 {
    font-size: 0.8rem;
  }
}