/* ============================================
   AC Repair Fort Worth — Site-wide layout
   Equal width, consistent spacing (mobile-first)
   ============================================ */

:root {
  --space-section-y: 4rem;
  --space-header-bottom: 2.5rem;
  --space-grid: 1.25rem;
  --space-card: 1.5rem;
  --container-padding: 1.125rem;
}

@media (min-width: 768px) {
  :root {
    --space-section-y: 5rem;
    --space-header-bottom: 2.75rem;
    --space-grid: 1.5rem;
    --space-card: 1.5rem;
    --container-padding: 1.25rem;
  }
}

@media (min-width: 992px) {
  :root {
    --space-section-y: 5.5rem;
  }
}

@media (min-width: 1200px) {
  :root {
    --space-section-y: 6rem;
    --container-padding: 1.75rem;
  }
}

/* ---- Base width / overflow ---- */
html {
  overflow-x: clip;
  width: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.site-header,
.site-footer,
.main-content {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.section,
.hero,
.hero--premium,
.page-hero,
.emergency-banner,
.cta-section,
.service-detail {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
  margin-inline: 0;
}

/* ---- Container — single horizontal rhythm on every page ---- */
.container {
  width: 100%;
  max-width: min(var(--container-max), 100%);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  box-sizing: border-box;
  min-width: 0;
}

/* ---- Section vertical rhythm ---- */
.main-content > .section,
.main-content > .service-detail {
  padding-block: var(--space-section-y);
  padding-inline: 0;
}

.stats-section,
.cta-section,
.emergency-banner {
  padding-block: var(--space-section-y);
  padding-inline: 0;
}

.page-hero {
  padding-block: calc(var(--header-height) + 1.75rem) 2.5rem;
  padding-inline: 0;
}

.hero--premium {
  padding-top: var(--header-height);
  padding-bottom: var(--space-section-y);
}

/* ---- Section headers align with content width ---- */
.section-header {
  width: 100%;
  max-width: 100%;
  margin: 0 0 var(--space-header-bottom);
  padding-inline: 0;
  text-align: center;
}

@media (min-width: 768px) {
  .section-header {
    max-width: 720px;
    margin-inline: auto;
    margin-bottom: var(--space-header-bottom);
  }
}

/* ---- Grids — equal width, consistent gaps ---- */
.services-grid,
.services-index-grid,
.why-grid,
.process-grid,
.testimonials-grid,
.stats-grid,
.areas-grid,
.showcase-split,
.photo-gallery,
.google-business-grid,
.brand-showcase,
.trust-images,
.faq-list,
.values-grid,
.about-grid,
.team-grid,
.service-detail-grid,
.benefits-grid,
.financing-grid,
.contact-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: var(--space-grid);
}

.services-grid > *,
.services-index-grid > *,
.why-grid > *,
.process-grid > *,
.testimonials-grid > *,
.stats-grid > *,
.showcase-split > *,
.photo-gallery > *,
.brand-showcase > *,
.service-detail-grid > * {
  min-width: 0;
  max-width: 100%;
}

.service-card,
.service-index-card,
.why-item,
.process-step,
.testimonial-card,
.value-card,
.faq-item,
.google-profile-card,
.service-detail-content,
.service-detail-image,
.showcase-split__media,
.showcase-split__content {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.service-card h3,
.service-card p,
.service-index-card__body h3,
.service-index-card__body p,
.why-item h4,
.why-item p,
.why-item > div,
.showcase-split__content,
.feature-list li {
  overflow-wrap: break-word;
  word-wrap: break-word;
  min-width: 0;
}

.why-item > div {
  flex: 1;
}

.showcase-split__media img,
.service-detail-image img,
.photo-gallery__item img,
.trust-images img {
  max-width: 100%;
  width: 100%;
}

.animate-on-scroll,
.section-animate,
.stagger-children > * {
  max-width: 100%;
}

.hero__grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

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

@media (min-width: 768px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .why-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .process-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .testimonials-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================================
   MOBILE spacing — final authority (≤767px)
   ============================================ */
@media (max-width: 767px) {
  :root {
    --space-section-y: 2.75rem;
    --space-header-bottom: 1.375rem;
    --space-grid: 0.875rem;
    --space-card: 1rem;
    --container-padding: 1.125rem;
  }

  @media (max-width: 380px) {
    :root {
      --container-padding: 1rem;
      --space-grid: 0.75rem;
    }
  }

  .main-content {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  /* All sections — same vertical + zero horizontal */
  .main-content > .section,
  .main-content > .service-detail,
  .stats-section,
  .cta-section,
  .emergency-banner {
    padding-block: var(--space-section-y);
    padding-inline: 0;
    margin-inline: 0;
  }

  #services.section,
  .page-hero,
  .hero--premium {
    padding-inline: 0;
  }

  .hero--premium {
    padding-bottom: 2rem;
  }

  .hero__grid {
    padding-block: 1rem;
  }

  .page-hero {
    padding-block: calc(var(--header-height) + 1.25rem) 2rem;
  }

  .page-hero-content {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 1.125rem var(--container-padding);
    box-sizing: border-box;
  }

  .section-header {
    max-width: 100%;
    margin-bottom: var(--space-header-bottom);
    padding-inline: 0;
  }

  .section-title {
    margin-bottom: 0.5rem;
  }

  .section-label {
    margin-bottom: 0.375rem;
  }

  .section-desc {
    margin-bottom: 0;
  }

  /* Cards & blocks — uniform inner padding */
  .service-card,
  .service-index-card__body,
  .why-item,
  .process-step,
  .testimonial-card,
  .financing-feature,
  .faq-item,
  .google-profile-card,
  .service-detail-content,
  .contact-form-wrapper,
  .value-card {
    padding: var(--space-card);
  }

  .service-index-card__body {
    padding: var(--space-card);
  }

  .service-card--home {
    display: grid;
    grid-template-columns: minmax(0, 64px) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 0.75rem;
    row-gap: 0.375rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: var(--space-card);
  }

  .service-card--home .service-card-thumb {
    grid-row: 1 / span 2;
    width: 64px;
    height: 64px;
  }

  .service-card--home .service-card-thumb {
    grid-row: 1 / span 2;
    width: 64px;
    height: 64px;
  }

  .service-card--home .service-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .service-card--home h3,
  .service-card--home p,
  .service-card--home .service-link {
    min-width: 0;
    max-width: 100%;
  }

  .faq-question {
    padding: 0.875rem var(--space-card);
  }

  .faq-answer {
    padding-inline: var(--space-card);
  }

  .faq-item.is-open .faq-answer {
    padding-bottom: var(--space-card);
  }

  .showcase-split {
    gap: var(--space-grid);
  }

  .trust-images {
    margin-bottom: var(--space-grid);
    gap: var(--space-grid);
  }

  .brand-showcase {
    gap: var(--space-grid);
  }

  .stats-section .section-header {
    margin-bottom: var(--space-header-bottom);
  }

  .stats-grid {
    gap: var(--space-grid);
  }

  .cta-section p,
  .emergency-banner p {
    margin-bottom: 1.25rem;
  }

  .btn {
    white-space: normal;
    text-align: center;
    max-width: 100%;
  }

  .hero__actions,
  .hero__phones,
  .hero__stats {
    width: 100%;
    max-width: 100%;
  }

  .hero__actions .btn,
  .hero__phones a {
    min-width: 0;
    max-width: 100%;
  }

  .site-footer {
    padding-block: 2.5rem 1.5rem;
  }

  .site-footer .container {
    padding-inline: var(--container-padding);
  }

  .areas-grid,
  .photo-gallery {
    width: 100%;
    max-width: 100%;
  }
}

/* ---- Header: pixel-perfect mobile layout + transparent logo ---- */
:root {
  --header-logo-size: 44px;
}

.site-header .container.header-inner {
  min-width: 0;
}

@media (max-width: 991px) {
  .site-header .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 0.375rem;
    justify-content: unset;
  }

  .site-header .logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    max-width: 100%;
    min-width: 0;
  }

  .site-header .logo span {
    display: none;
  }

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

  .site-header .header-google-reviews {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    align-self: center;
  }

  .site-header .header-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
  }
}

@media (min-width: 480px) and (max-width: 991px) {
  .site-header .logo span {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    max-width: 6.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.15;
  }
}

@media (min-width: 992px) {
  :root {
    --header-logo-size: 50px;
  }

  .site-header .header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .site-header .header-google-reviews {
    min-width: 4.5rem;
    flex-shrink: 0;
    margin-left: auto;
  }

  .site-header .header-actions {
    margin-left: 0;
    gap: 0.75rem;
  }

  .site-header .header-google-reviews__icon {
    width: 20px;
    height: 20px;
  }

  .site-header .header-google-reviews__stars {
    font-size: 0.5625rem;
  }

  .site-header .header-google-reviews__count {
    font-size: 0.6875rem;
  }
}

@media (max-width: 359px) {
  :root {
    --header-logo-size: 38px;
    --container-padding: 0.875rem;
  }

  .site-header .header-google-reviews {
    min-width: 3.75rem;
  }

  .site-header .header-google-reviews__count {
    font-size: 0.5625rem;
  }

  .site-header .hamburger {
    width: 36px;
    height: 36px;
  }

  .site-header .hamburger span {
    width: 18px;
  }
}
