/* ESG Website Main CSS - Brand Design System */

/* Brand Colors */
:root {
  --primary-blue: #03A9F4;  /* Brand blue for decorative elements */
  --link-blue: #0288D1;     /* Slightly darker blue specifically for links */
  --link-hover: #0277BD;    /* Even darker for link hover states */
  --dark-grey: #333333;
  --light-grey: #F2F2F2;
  --white: #FFFFFF;
  --hover-blue: #0296D8;    /* For button hovers */
  --success-green: #28a745;
  --error-red: #dc3545;
}

/* Typography - Raleway Font */
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap');

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 180px; /* Account for fixed header when using anchor links */
}

body {
  font-family: 'Raleway', Arial, Helvetica, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--dark-grey);
  background-color: var(--white);
}

/* Typography Hierarchy - Using Fluid Typography */
h1 {
  font-size: clamp(1.75rem, 4vw + 1rem, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--dark-grey);
}

h2 {
  font-size: clamp(1.5rem, 3vw + 0.75rem, 2rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.875rem;
  color: var(--dark-grey);
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.75rem, 1.5rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--dark-grey);
}

h4 {
  font-size: clamp(1.125rem, 1.5vw + 0.5rem, 1.25rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--dark-grey);
}

h5, h6 {
  font-size: clamp(1rem, 1vw + 0.5rem, 1.125rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--dark-grey);
}

p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Links - Enhanced Styling System */

/* Default link styling for content links */
a {
  color: var(--link-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: all 0.3s ease;
}

a:hover, a:focus {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

/* Remove underlines for specific link types that have their own styling */
a.btn,
a.nav-link,
a.top-link,
.footer a,
a[href^="tel:"],
a[href^="mailto:"],
a.logo-link,
a[aria-label="Home"] {
  text-decoration: none;
}

/* Inline content links in paragraphs and lists - ensure visibility */
p a:not(.btn),
li a:not(.btn):not(.nav-link) {
  color: var(--link-blue);
  text-decoration: underline;
  text-decoration-style: solid;
  font-weight: 500;
}

p a:not(.btn):hover,
li a:not(.btn):not(.nav-link):hover {
  color: var(--link-hover);
  background-color: rgba(2, 136, 209, 0.05);
  padding: 0 2px;
  margin: 0 -2px;
  border-radius: 2px;
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 3rem 0;
}

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

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent 0%, #ccc 50%, transparent 100%);
  margin: 1rem 0;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Header */
.header {
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Top Bar */
.header-top {
  background-color: var(--light-grey);
  border-bottom: 1px solid #e0e0e0;
  padding: 0.5rem 0;
}

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

.header-top-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.top-link {
  font-size: 0.875rem;
  color: var(--dark-grey);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

.top-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--link-blue);
  transition: width 0.3s ease;
}

.top-link:hover {
  color: var(--link-blue);
  text-decoration: none;
}

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

.top-link.btn {
  margin-left: 0.5rem;
}

/* Main Header */
.header-main {
  background-color: var(--white);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  height: 60px;
  width: auto;
  max-width: 100%;
}

/* Navigation */
.nav {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-weight: 600;
  color: var(--dark-grey);
  text-decoration: none;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
  position: relative;
  border-bottom: 2px solid transparent;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--link-blue);
  transition: width 0.3s ease;
}

.nav-link:hover, .nav-link:focus {
  color: var(--link-blue);
  text-decoration: none;
}

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

.nav-link.active {
  color: var(--link-blue);
  border-bottom-color: var(--link-blue);
}

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

/* Mobile Navigation Toggle - Enhanced Touch Target */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dark-grey);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem;
  touch-action: manipulation;
  transition: transform 0.2s ease;
}

.nav-toggle:active {
  transform: scale(0.95);
}

/* Buttons - Enhanced Touch Targets */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  min-height: 44px; /* Minimum touch target height */
  min-width: 44px; /* Minimum touch target width */
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.2;
  touch-action: manipulation; /* Prevent double-tap zoom */
}

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

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--hover-blue);
  border-color: var(--hover-blue);
  color: var(--white);
  text-decoration: none;
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-blue);
  border-color: var(--primary-blue);
}

.btn-secondary:hover, .btn-secondary:focus {
  background-color: var(--primary-blue);
  color: var(--white);
  text-decoration: none;
}

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}

.btn-small {
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  position: relative;
  background-image: url('../images/hero-background.webp');
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  background-attachment: scroll;
  min-height: 400px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0;
  margin: 0;
}

/* Knock-back overlay — dims the background image without affecting text.
   Adjust the rgba alpha (currently 0.5) to taste:
     0.15 = barely there  |  0.25 = subtle  |  0.40 = heavy  */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 50, 70, 0.45);       /* darker overlay for better text contrast */
  pointer-events: none;
}

.hero-overlay {
  position: relative;
  z-index: 2;                                /* keeps text above the overlay */
  width: 100%;
  padding: 4rem 0;
}

/* Extra padding for hero sections without CTA buttons to match height */
.hero-services .hero-overlay,
.hero-help .hero-overlay,
.hero-about .hero-overlay {
  padding: 5.5rem 0;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
  font-size: clamp(1.25rem, 3vw + 0.5rem, 1.75rem);
  color: var(--white);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-cta {
  margin-top: 2rem;
}

.hero-cta .btn {
  margin: 0 0.5rem 1rem 0.5rem;
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Services Page Hero */
.hero-services {
  background-image: url('../images/services-hero-background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(1.5);
}


.hero-services h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-services .hero-subtitle {
  font-size: clamp(1.25rem, 3vw + 0.5rem, 1.75rem);
  color: var(--white);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Help Page Hero */
.hero-help {
  background-image: url('../images/help-hero-background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(1.5);
}

.hero-help h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-help .hero-subtitle {
  font-size: clamp(1.25rem, 3vw + 0.5rem, 1.75rem);
  color: var(--white);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* About Page Hero */
.hero-about {
  background-image: url('../images/about-hero-background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: brightness(1.5);
}

.hero-about h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-about .hero-subtitle {
  font-size: clamp(1.25rem, 3vw + 0.5rem, 1.75rem);
  color: var(--white);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* Trust Section */
.trust-section {
  background-color: var(--light-grey);
  padding: 1.5rem 0;
}

/* Trust Indicators */
.trust-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  font-size: 0.9rem;
  color: var(--dark-grey);
  font-weight: 600;
}

.trust-indicators span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Testimonials Section */
.testimonials-section {
  padding: 3rem 0;
  background-color: var(--white);
}

.testimonials-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.testimonial-card {
  background-color: var(--light-grey);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.testimonial-quote {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--dark-grey);
  margin-bottom: 1.5rem;
  font-style: italic;
  flex-grow: 1;
}

.testimonial-quote::before {
  content: '"';
  font-size: 1.2em;
  color: var(--primary-blue);
  opacity: 0.6;
}

.testimonial-quote::after {
  content: '"';
  font-size: 1.2em;
  color: var(--primary-blue);
  opacity: 0.6;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.testimonial-logo {
  width: 80px;
  height: auto;
  object-fit: contain;
}

.testimonial-info {
  flex-grow: 1;
}

.testimonial-name {
  font-weight: 600;
  color: var(--dark-grey);
  margin-bottom: 0.25rem;
}

.testimonial-title {
  font-size: 0.9rem;
  color: var(--medium-grey);
  margin-bottom: 0.25rem;
}

.testimonial-company {
  font-size: 0.9rem;
  color: var(--primary-blue);
  font-weight: 500;
}

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

  .testimonial-card {
    padding: 1.5rem;
  }
}

/* Cards - Global Consistent Styling */
.card {
  background-color: var(--white);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card h3 {
  color: var(--dark-grey);  /* Changed from blue to avoid confusion with links */
  margin-bottom: 1rem;
  min-height: 2.5rem;
  display: flex;
  align-items: flex-start;
}

/* Keep icons in brand blue as decorative elements */
.card h3 i {
  color: var(--primary-blue) !important;
}

.card h4 {
  color: var(--dark-grey);
  margin-bottom: 1rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.card p {
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.card ul {
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.card .btn {
  margin-top: auto;
  align-self: stretch;
}

.card > a.btn {
  margin-top: auto;
  text-align: center;
}

/* Specific grid overrides using generic classes */
.card-grid.australian-services-grid,
.card-grid.having-trouble-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* Cards with longer headings need more height */
.card-grid.need-help-grid .card h3 {
  min-height: 4rem;
}

/* Compact cards for service grids */
.card-grid.australian-services-grid .card {
  padding: 1.5rem;
}

.card-grid.australian-services-grid .card p {
  font-size: 0.95rem;
  line-height: 1.4;
}

.card-grid.australian-services-grid .card ul li {
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
  .card-grid.australian-services-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .card-grid.having-trouble-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .card-grid.australian-services-grid {
    grid-template-columns: 1fr !important;
  }
  .card-grid.having-trouble-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Why Choose ESG Grid - Uses h4 instead of h3 */
.card-grid.why-choose-grid .card h4 {
  min-height: 3rem;
}

/* Card Grid - Global Consistent Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  align-items: stretch;
}

/* Ensure all cards in grid have equal height */
.card-grid .card {
  margin-bottom: 0 !important; /* Override any mobile styles */
  height: 100%;
}

/* 2-column grid variant */
.card-grid.two-column {
  grid-template-columns: repeat(2, 1fr);
}

/* 3-column grid variant */
.card-grid.three-column {
  grid-template-columns: repeat(3, 1fr);
}

/* 4-column grid variant */
.card-grid.four-column {
  grid-template-columns: repeat(4, 1fr);
}

/* Forms - Mobile Optimized */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-grey);
}

.form-control {
  width: 100%;
  padding: 0.875rem;
  min-height: 44px; /* Touch-friendly height */
  border: 2px solid #ddd;
  border-radius: 5px;
  font-family: inherit;
  font-size: 16px; /* Prevent zoom on iOS */
  transition: border-color 0.3s ease;
  -webkit-appearance: none; /* Remove iOS styling */
  appearance: none;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.form-control.error {
  border-color: var(--error-red);
}

.form-error {
  color: var(--error-red);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

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

/* Lists */
.list-unstyled {
  list-style: none;
}

.list-checked {
  list-style: none;
}

.list-checked li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.5rem;
}

.list-checked li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success-green);
  font-weight: 700;
}

/* Icon Lists */
.list-icons {
  list-style: none;
  padding: 0;
}

.list-icons li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: flex-start;
}

.list-icons li i {
  position: absolute;
  left: 0;
  top: 0.2rem;
  color: var(--primary-blue);
  font-size: 1rem;
}

/* Contact Page Specific Styles */
.contact-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
}

.contact-cards-grid .card {
  margin-bottom: 0;
  height: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Ensure proper spacing on mobile */
@media (max-width: 768px) {
  .contact-info-section {
    margin-top: 2rem;
  }

  .contact-cards-grid {
    gap: 0.75rem;
  }

  .contact-cards-grid .card {
    padding: 1.25rem;
  }
}

/* On larger screens, make contact cards a 2x2 grid */
@media (min-width: 992px) {
  .contact-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Footer */
.footer {
  background-color: var(--dark-grey);
  color: var(--white);
  padding: 3rem 0 2rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-section a {
  color: var(--white);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  position: relative;
  padding-left: 0;
}

.footer-section a:hover {
  color: var(--primary-blue);
  padding-left: 5px;
}

/* Special styling for phone and email links in footer */
.footer-section a[href^="tel:"],
.footer-section a[href^="mailto:"] {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.footer-section a[href^="tel:"]:hover,
.footer-section a[href^="mailto:"]:hover {
  text-decoration-style: solid;
}

.footer-bottom {
  border-top: 1px solid #555;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: #ccc;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus Indicators */
*:focus {
  outline: 2px solid var(--link-blue);
  outline-offset: 2px;
}

/* Keyboard navigation enhancement */
a:focus-visible {
  outline: 2px solid var(--link-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Responsive Utility Classes */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

.responsive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.responsive-two-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

/* Mobile First Breakpoints */
/* Small phones (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* Tablets (768px and up) */
@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
  .responsive-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Large desktop (1200px and up) */
@media (min-width: 1200px) {
  .container {
    padding: 0 2rem;
  }
}

/* Existing Mobile Styles - Enhanced */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .logo {
    height: clamp(45px, 7vw, 55px);
    max-width: 90%;
    object-fit: contain;
  }

  .header-content {
    padding: 0.5rem 0;
  }

  .header a:focus {
    outline: none;
  }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-10px);
  }

  .nav.active {
    display: flex;
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 5px;
    transition: background-color 0.2s ease, color 0.3s ease;
    border-bottom: none;
  }

  .nav-link::after {
    display: none;  /* Remove underline animation on mobile */
  }

  .nav-link:hover, .nav-link:focus {
    background-color: var(--light-grey);
    color: var(--link-blue);
  }

  .nav-link.active {
    background-color: var(--light-grey);
    border-left: 3px solid var(--link-blue);
    padding-left: calc(1rem - 3px);
    color: var(--link-blue);
  }

  .nav-toggle {
    display: block;
  }

  /* Hide header-top completely on mobile for cleaner look */
  .header-top {
    display: none;
  }

  /* Mobile-only items in nav - hidden by default */
  .nav .mobile-only {
    display: none;
  }

  /* Show ALL nav items including mobile-only when menu is active */
  .nav.active .mobile-only {
    display: block !important;
  }

  /* Show mobile menu items */
  .nav.active {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
  }

  .nav.active .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0;
    border-bottom: 1px solid var(--light-grey);
  }

  /* Add mobile menu items for top bar links */
  .mobile-menu-extras {
    display: block !important;
    border-top: 2px solid var(--light-grey);
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .mobile-menu-extras .nav-link {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0;
    border-bottom: 1px solid var(--light-grey);
    color: var(--dark-grey);
  }

  .mobile-menu-extras .nav-link:hover {
    background-color: var(--light-grey);
    color: var(--link-blue);
  }

  .hero {
    min-height: 350px;
    background-attachment: scroll; /* Better performance on mobile */
  }

  .hero-overlay {
    padding: 3rem 0;
  }

  .hero-services .hero-overlay,
  .hero-help .hero-overlay,
  .hero-about .hero-overlay {
    padding: 4.5rem 0;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .trust-indicators {
    flex-direction: column;
    gap: 1rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem; /* Reduce gap on mobile */
  }

  .btn {
    width: 100%;
    margin-bottom: 1rem;
  }

  .hero-cta .btn {
    margin: 0 0 1rem 0;
    display: block;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Mobile-specific grid adjustments */
  .responsive-two-column {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Improve form spacing on mobile */
  .form-group {
    margin-bottom: 2rem;
  }

  /* Better card spacing on mobile */
  .card {
    padding: 1.5rem;
  }

  /* Only add margin to cards not in grids */
  .card:not(.card-grid .card) {
    margin-bottom: 1.5rem;
  }
}

/* Small Mobile Devices (480px and below) */
@media (max-width: 480px) {
  .container {
    padding: 0 0.5rem;
  }

  .section {
    padding: 2rem 0;
  }

  .card {
    padding: 1.25rem;
  }

  /* Smaller font for very small screens */
  html {
    font-size: 14px;
  }

  /* Stack all grids on small mobile */
  .card-grid,
  .card-grid.two-column,
  .card-grid.three-column,
  .card-grid.four-column {
    grid-template-columns: 1fr !important;
  }

  /* Adjust hero padding */
  .hero {
    min-height: 300px;
  }

  .hero-overlay {
    padding: 2.5rem 0;
  }

  .hero-services .hero-overlay,
  .hero-help .hero-overlay,
  .hero-about .hero-overlay {
    padding: 4rem 0;
  }

  /* Smaller buttons on very small screens */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* Extra Small Devices (375px and below - iPhone SE) */
@media (max-width: 375px) {
  .container {
    padding: 0 0.75rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 2rem;
  }

  .btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
  }

  /* Adjust navigation menu for small screens */
  .nav {
    padding: 0.75rem;
  }

  /* Smaller logo on very small screens */
  .logo {
    height: 40px;
  }
}

/* Tight section spacing for pages with many sections */
.tight-sections .section {
  padding: 1.5rem 0;
}

.tight-sections .section:first-of-type {
  padding-top: 2rem;
}

/* Collapsible Troubleshooting Sections */
.troubleshooting-section {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--white);
}

.troubleshooting-section summary {
  padding: 1.5rem;
  cursor: pointer;
  background: var(--light-grey);
  border-radius: 8px;
  transition: background-color 0.3s ease;
  list-style: none;
  position: relative;
}

.troubleshooting-section summary:hover {
  background: #e8e8e8;
}

.troubleshooting-section summary h2 {
  display: inline;
  margin: 0;
  color: var(--dark-grey);
}

.troubleshooting-section summary::after {
  content: "▼";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-blue);
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

.troubleshooting-section[open] summary::after {
  transform: translateY(-50%) rotate(180deg);
}

.troubleshooting-section .details-content {
  padding: 2rem;
  border-top: 1px solid #ddd;
}

/* Ensure cards in troubleshooting sections display in grid */
.troubleshooting-section .card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

/* Remove default marker */
.troubleshooting-section summary::-webkit-details-marker {
  display: none;
}

/* Remove focus outline on troubleshooting sections */
.troubleshooting-section summary:focus {
  outline: none;
}

/* Payment Modal Styles */
.payment-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.payment-modal.active {
  display: flex;
}

.payment-modal-content {
  background: white;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  margin: 2rem;
}

.payment-modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--light-grey);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark-grey);
}

.payment-modal-body {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 600;
  color: var(--dark-grey);
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: 'Raleway', sans-serif;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.form-group textarea {
  resize: vertical;
  height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#card-element {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

#card-errors {
  color: var(--error-red);
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.payment-info {
  background: var(--light-grey);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.payment-info h4 {
  margin-bottom: 0.25rem;
}

#submit-payment {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
}

#submit-payment:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Print Styles */
@media print {
  .header, .footer, .nav, .btn, .nav-toggle {
    display: none !important;
  }

  .section {
    padding: 1rem 0;
  }

  * {
    color: black !important;
    background: white !important;
  }
}