/* ─── Equal-Size Box Alignment ─── */

/* Force all rows to equal height in 3-col and 4-col grid sections */
[style*="grid-template-columns: repeat(3, 1fr)"],
[style*="grid-template-columns: repeat(4, 1fr)"] {
  grid-auto-rows: 1fr;
}

/* Service cards (a tags in 3-col grid): flex columns so content aligns */
[style*="grid-template-columns: repeat(3, 1fr)"] > a {
  display: flex !important;
  flex-direction: column !important;
}

/* Service card inner content wrapper (has z-index): stretch to fill card */
[style*="grid-template-columns: repeat(3, 1fr)"] > a > div[style*="z-index"] {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
}

/* Service card description: grow to push CTA to bottom */
[style*="grid-template-columns: repeat(3, 1fr)"] > a > div[style*="z-index"] > p {
  flex: 1 !important;
}

/* Review and coupon cards (div children of 3-col grid): flex columns */
[style*="grid-template-columns: repeat(3, 1fr)"] > div[style*="border-radius"] {
  display: flex !important;
  flex-direction: column !important;
}

/* Description paragraphs in review/coupon cards: grow to push footer content down */
[style*="grid-template-columns: repeat(3, 1fr)"] > div[style*="border-radius"] > p {
  flex: 1 !important;
}

/* ─── Mobile Responsive Fixes ─── */

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ─── Hamburger Menu Button ─── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1100;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: #faf3e6;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
  border-radius: 2px;
}

.hamburger-btn.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.open span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Desktop nav links ─── */
.nav-links-desktop {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* ─── Mobile nav dropdown ─── */
.nav-links-mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(15, 13, 9, 0.98);
  border-bottom: 1px solid #3a2f1e;
  padding: 16px 24px 24px;
  flex-direction: column;
  gap: 0;
  z-index: 1050;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.nav-links-mobile.open {
  display: flex;
}

.nav-links-mobile a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid #3a2f1e;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #c4b99a;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links-mobile a:last-child {
  border-bottom: none;
}

.nav-links-mobile a:hover {
  color: #faf3e6;
}

.nav-links-mobile .mobile-cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #3a2f1e;
}

/* ─── Mobile Breakpoint ─── */
@media (max-width: 900px) {
  /* Show hamburger, hide desktop nav */
  .hamburger-btn {
    display: block;
  }

  .nav-links-desktop {
    display: none !important;
  }

  /* ─── Fix all grid layouts to stack ─── */
  /* Hero grid: 1fr 420px -> 1fr */
  [style*="grid-template-columns: 1fr 420px"],
  [style*="grid-template-columns: 1fr 420"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* 3-column grids -> 1 column */
  [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
  }

  /* 4-column grids -> 2 columns on tablet */
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 2-column equal grids -> 1 column */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Footer grid -> 1 column */
  [style*="grid-template-columns: 1.3fr 1fr 1fr 1.2fr"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* ─── Typography scaling ─── */
  h1 {
    font-size: 32px !important;
    line-height: 1.2 !important;
  }

  h2 {
    font-size: 28px !important;
  }

  h3 {
    font-size: 22px !important;
  }

  /* ─── Section padding ─── */
  section {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ─── Hero section adjustments ─── */
  /* Stack hero buttons vertically */
  section > div > div > div[style*="display: flex"][style*="gap: 12px"] {
    flex-direction: column;
    align-items: stretch;
  }

  section > div > div > div[style*="display: flex"][style*="gap: 12px"] a {
    text-align: center;
  }

  /* Stats row: stack on mobile */
  section > div > div > div[style*="display: flex"][style*="gap: 0"] {
    flex-wrap: wrap;
    justify-content: center;
  }

  section > div > div > div[style*="display: flex"][style*="gap: 0"] > div {
    flex: 0 0 50% !important;
    text-align: center;
    border-right: none !important;
    border-bottom: 1px solid #3a2f1e;
    padding: 12px 8px !important;
  }

  section > div > div > div[style*="display: flex"][style*="gap: 0"] > div:last-child {
    flex: 0 0 100% !important;
    border-bottom: none;
  }

  /* ─── WhyChoose pills: wrap and center ─── */
  [style*="display: flex"][style*="justify-content: center"][style*="flex-wrap: wrap"] {
    gap: 12px !important;
  }

  [style*="display: flex"][style*="justify-content: center"][style*="flex-wrap: wrap"] > div {
    flex: 1 1 calc(50% - 12px) !important;
    text-align: center;
    padding: 12px 16px !important;
    font-size: 13px !important;
  }

  /* ─── Form padding ─── */
  [style*="padding: 36px 32px"] {
    padding: 24px 16px !important;
  }

  /* ─── Trust badges: full width items ─── */
  [style*="display: flex"][style*="gap: 14"] {
    flex-direction: row;
    align-items: center;
  }

  /* ─── Ready Banner: stack centered ─── */
  [style*="justify-content: space-between"][style*="flex-wrap: wrap"] {
    flex-direction: column;
    text-align: center;
    align-items: center !important;
    gap: 24px !important;
  }

  /* ─── Footer: center on mobile ─── */
  footer [style*="grid-template-columns: 1.3fr"] {
    text-align: center;
  }

  footer [style*="grid-template-columns: 1.3fr"] > div {
    text-align: center;
  }

  footer p[style*="max-width: 300"] {
    max-width: 100% !important;
    margin-left: auto;
    margin-right: auto;
  }

  /* ─── TopBar font size ─── */
  [style*="padding: 8px 24px"][style*="text-align: center"][style*="font-size: 13"] {
    font-size: 11px !important;
    padding: 6px 12px !important;
  }

  /* ─── Background logo: hide on mobile to save space ─── */
  [style*="opacity: 0.08"] {
    display: none !important;
  }

  /* ─── Max-width constraints: allow full width ─── */
  [style*="max-width: 560px"],
  [style*="max-width: 560"] {
    max-width: 100% !important;
  }

  [style*="max-width: 640"] {
    max-width: 100% !important;
  }

  [style*="max-width: 600"] {
    max-width: 100% !important;
  }

  /* ─── Service area city pills: symmetrical ─── */
  [style*="max-width: 900"] {
    max-width: 100% !important;
  }
}

/* ─── Mobile Sticky Bottom Bar ─── */
.mobile-sticky-bar {
  display: none !important;
}

@media (max-width: 900px) {
  .mobile-sticky-bar {
    display: flex !important;
  }

  /* Add bottom padding to prevent content hiding behind sticky bar */
  body {
    padding-bottom: 72px;
  }
}

/* ─── Small phone breakpoint ─── */
@media (max-width: 480px) {
  /* 4-column grids -> 1 column on phones */
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* 2-column badge grids -> 1 column */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  h1 {
    font-size: 26px !important;
  }

  h2 {
    font-size: 24px !important;
  }

  section {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  /* ─── WhyChoose pills: single column on phones ─── */
  [style*="display: flex"][style*="justify-content: center"][style*="flex-wrap: wrap"] > div {
    flex: 1 1 100% !important;
  }

  /* ─── Stats row: single column on phones ─── */
  section > div > div > div[style*="display: flex"][style*="gap: 0"] > div {
    flex: 0 0 100% !important;
  }

  /* ─── Coupon price: smaller ─── */
  [style*="font-size: 48px"] {
    font-size: 36px !important;
  }
}
