/* Per-page overrides for pages/rates.html */

@media (min-width: 481px) and (max-width: 1400px) {
  body header { position: relative !important; }
  body header::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(to right, #00a79d 0%, #639 100%) !important;
    background-repeat: no-repeat !important;
    background-size: cover !important;
    z-index: 0 !important;
    pointer-events: none !important;
  }
  body header .header-container { position: relative !important; z-index: 1 !important; }
  .logo-text { font-size: clamp(1rem, 2.6vw, 1.6rem) !important; white-space: normal !important; line-height: 1.05 !important; }
  .logo img { height: 56px !important; width: auto !important; display: block !important; }
}

@media (max-width: 480px) {
  body header::before { background-size: 100% 100% !important; }
  .logo img { height: 44px !important; }
  .logo-text { font-size: clamp(0.9rem, 4.2vw, 1.1rem) !important; }
  .mobile-toggle { position: relative !important; z-index: 3 !important; }
}

@media (max-width: 768px) {
  nav {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    padding: 0 2rem !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-8px) !important;
    transition: max-height 0.36s ease, opacity 0.28s ease, padding 0.28s ease, transform 0.28s ease !important;
    z-index: 200 !important;
  }

  nav.active { max-height: 80vh !important; padding: 1.5rem 2rem !important; opacity: 1 !important; pointer-events: auto !important; transform: translateY(0) !important; }

  nav ul li { opacity: 0 !important; transform: translateY(-6px) !important; transition: opacity 0.28s ease, transform 0.28s ease !important; }

  nav.active ul li:nth-child(1) { transition-delay: 0.06s; opacity: 1 !important; transform: translateY(0) !important; }
  nav.active ul li:nth-child(2) { transition-delay: 0.12s; opacity: 1 !important; transform: translateY(0) !important; }
  nav.active ul li:nth-child(3) { transition-delay: 0.18s; opacity: 1 !important; transform: translateY(0) !important; }
  nav.active ul li:nth-child(4) { transition-delay: 0.24s; opacity: 1 !important; transform: translateY(0) !important; }
  nav.active ul li:nth-child(5) { transition-delay: 0.30s; opacity: 1 !important; transform: translateY(0) !important; }
  nav.active ul li:nth-child(6) { transition-delay: 0.36s; opacity: 1 !important; transform: translateY(0) !important; }

  nav ul li .dropdown-menu {
    position: relative !important; top: auto !important; left: auto !important; min-width: 100% !important; background: #fff !important; box-shadow: 0 10px 30px rgba(0,0,0,0.12) !important; border-radius: 8px !important; padding: 0 !important; margin-top: 0.5rem !important; opacity: 0 !important; max-height: 0 !important; overflow: hidden !important; transform: translateY(-8px) !important; transition: opacity 0.28s ease, transform 0.28s ease, max-height 0.36s ease !important; pointer-events: none !important;
  }

  nav a {
    color: #222 !important;
    text-decoration: none !important;
  }

  nav a:hover,
  nav a:focus {
    color: var(--primary) !important;
    text-decoration: underline !important;
  }

  nav ul li.dropdown.open .dropdown-menu,
  nav ul li.dropdown:focus-within .dropdown-menu,
  nav ul li.dropdown:hover .dropdown-menu {
    opacity: 1 !important; transform: translateY(0) !important; max-height: 420px !important; pointer-events: auto !important;
  }

  /* Ensure hero image/text layout doesn't overlap on mobile */
  .hero-paragraph,
  .hero-paragraph.hero-image-text-align { display: block !important; clear: both !important; }
  .hero-paragraph img,
  .hero-image.active { width: 100% !important; height: auto !important; object-fit: contain !important; margin: 0 0 1rem 0 !important; float: none !important; }
}

/* Center the pricing section as its own two-column grid and clear any hero floats */
.pricing-columns {
  clear: both !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 3rem !important;
  max-width: 1100px !important;
  margin: 5rem auto 3rem !important; /* add extra breathing room above the columns */
  align-items: start !important; /* revert equal-height tweak */
}

.pricing-col { width: auto !important; min-width: 0 !important; max-width: none !important; }

@media (max-width: 900px) {
  .pricing-columns { grid-template-columns: 1fr !important; }
  .pricing-col { width: 100% !important; min-width: 0 !important; max-width: none !important; }
}

/* Increase spacing between items in the left column list on mid+ viewports */
@media (min-width: 1024px) {
  /* Apply ~+10% spacing only to the left column */
  #pricing-philosophy > li { margin-bottom: 1.5rem !important; line-height: 1.65 !important; }
  #pricing-philosophy > li:last-child { margin-bottom: 0 !important; }

  /* Ensure right column lists keep the default spacing */
  #pricing-how > li,
  #second-section > li { margin-bottom: 0.8rem !important; }
  #pricing-how > li:last-child,
  #second-section > li:last-child { margin-bottom: 0 !important; }
}

/* Widen image on medium viewports while keeping text readable */
@media (min-width: 769px) and (max-width: 1368px) {
  .hero-paragraph { display: block !important; clear: both !important; }
  .hero-image.active { width: clamp(320px, 58vw, 900px) !important; }
}

/* Tame hero image size for better wrap between ~900–1350px */
@media (min-width: 901px) and (max-width: 1350px) {
  #waiting-image.hero-image.active {
    width: clamp(260px, 40vw, 680px) !important;
    max-width: 680px !important;
    float: left !important;
    margin: 0 1rem 1rem 0 !important;
  }
  /* Ensure the paragraph uses normal block flow so text wraps around the float */
  .hero-paragraph { display: block !important; clear: none !important; }
  .hero-paragraph .hero-text-align { display: block !important; }
}

/* Hide decorative backgrounds that may visually overlap at some sizes */
@media (max-width: 1400px) {
  .hero-bg, .main-bg, .main-bg-alt { display: none !important; }
}

/* Equalize column heights on wide viewports */
@media (min-width: 901px) {
  .pricing-columns { align-items: stretch !important; }
  /* Make BOTH columns flex containers and let the card fill height */
  .pricing-columns > .pricing-col { display: flex !important; flex-direction: column !important; }
  .pricing-columns > .pricing-col > .service-description { flex: 1 1 auto !important; }
}

/* Remove extra top offset so cards align with their headings */
.pricing-columns .service-description { margin-top: 0 !important; }
