/*
 * Car Seat Cover Space responsive layout system.
 * Desktop uses the available canvas; tablet and mobile use dedicated layouts.
 */

/* Base safety: do not let a child layout create horizontal overflow. */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Desktop: wide layout, with readable text measure inside wide sections. */
@media (min-width: 1200px) {
  .shell,
  .ccs-wrap,
  .ccs-section,
  .section {
    width: calc(100% - 80px);
    max-width: none;
    margin-left: 40px;
    margin-right: 40px;
  }

  .site-header .header-inner,
  .site-footer .footer-grid,
  .site-footer .footer-bottom {
    width: calc(100% - 80px);
    max-width: none;
    margin-left: 40px;
    margin-right: 40px;
  }

  .hero {
    width: 100%;
    min-height: calc(100vh - 92px);
    padding: 64px 40px 88px;
  }

  .hero-grid,
  .landing-hero-grid {
    width: 100%;
    max-width: none;
    margin: 0;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(36px, 4vw, 80px);
    align-items: center;
  }

  .hero-copy {
    max-width: 760px;
    padding-left: clamp(0px, 2vw, 36px);
  }

  .hero-copy h1,
  .landing-hero h1 {
    max-width: 900px;
    font-size: clamp(58px, 6.1vw, 112px);
    line-height: 0.93;
  }

  .hero-copy .lead,
  .landing-hero .lead {
    max-width: 720px;
    font-size: clamp(18px, 1.35vw, 23px);
    line-height: 1.55;
  }

  .hero-media,
  .landing-hero-media {
    width: 100%;
    max-width: none;
  }

  .hero-media img[src*="home-hero.jpg"],
  .landing-hero-media img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center !important;
  }

  .split-shell,
  .split-shell > .shell {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .split-shell > .shell {
    padding-left: 40px;
    padding-right: 40px;
  }

  .section-head,
  .ccs-section__head {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  }

  .collection-grid,
  .ccs-dynamic-product-grid.collection-grid,
  .ccs-grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .ccs-content,
  .entry-content {
    max-width: 1100px;
  }
}

@media (min-width: 1600px) {
  .shell,
  .ccs-wrap,
  .ccs-section,
  .section,
  .site-header .header-inner,
  .site-footer .footer-grid,
  .site-footer .footer-bottom {
    width: calc(100% - 120px);
    margin-left: 60px;
    margin-right: 60px;
  }

  .hero {
    padding-left: 60px;
    padding-right: 60px;
  }

  .split-shell > .shell {
    padding-left: 60px;
    padding-right: 60px;
  }
}

/* Tablet: two-column cards, but not full desktop density. */
@media (min-width: 768px) and (max-width: 1199px) {
  .shell,
  .ccs-wrap,
  .ccs-section,
  .section {
    width: calc(100% - 48px);
    max-width: none;
    margin-left: 24px;
    margin-right: 24px;
  }

  .hero-grid,
  .landing-hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
  }

  .collection-grid,
  .ccs-dynamic-product-grid.collection-grid,
  .ccs-grid--3,
  .ccs-grid--4,
  .benefits-grid,
  .seo-faq-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: separate one-column layout. */
@media (max-width: 767px) {
  .shell,
  .ccs-wrap,
  .ccs-section,
  .section {
    width: calc(100% - 32px);
    max-width: none;
    margin-left: 16px;
    margin-right: 16px;
  }

  .hero,
  .landing-hero {
    min-height: auto;
    padding: 48px 16px 56px;
  }

  .hero-grid,
  .landing-hero-grid,
  .collection-grid,
  .ccs-dynamic-product-grid.collection-grid,
  .ccs-grid--3,
  .ccs-grid--4,
  .benefits-grid,
  .seo-faq-grid,
  .split-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .landing-hero .hero-copy {
    padding-left: 0;
    max-width: none;
  }

  .hero-copy h1,
  .landing-hero h1 {
    font-size: clamp(42px, 13vw, 66px);
  }

  .hero-media,
  .landing-hero-media {
    width: 100%;
    min-width: 0;
  }

  .hero-media img[src*="home-hero.jpg"],
  .landing-hero-media img {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
  }

  .hero-actions,
  .hero-media-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .hero-media-actions .button {
    width: 100%;
    text-align: center;
  }

  .split-shell > .shell {
    width: calc(100% - 32px);
    padding-left: 0;
    padding-right: 0;
  }

  .section-head,
  .ccs-section__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .ccs-content,
  .entry-content {
    max-width: none;
  }
}
