/* Shared sections */
.section {
  padding-block: 100px;
}

.section--compact {
  padding-block: 50px;
}

.section--roomy {
  padding-block: 160px;
}

.section--flush {
  padding-block: 0;
}

.section-header,
.page-hero__header {
  display: grid;
  width: min(100%, 790px);
  margin-inline: auto;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.section-header__title,
.page-hero__title {
  max-width: 740px;
}

.section-header__text,
.page-hero__text {
  max-width: 620px;
  color: var(--color-grey);
  font-size: var(--text-body);
  line-height: 1.3;
}

.section-header--left {
  margin-inline: 0;
  justify-items: start;
  text-align: left;
}

.section-header--left .section-header__title,
.section-header--left .section-header__text {
  max-width: 100%;
}

.section-actions {
  display: flex;
  margin-top: 42px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.section-actions .button {
  min-height: 48px;
}

.page-hero {
  padding: 112px 0 64px;
}

.page-hero--large {
  padding-top: 120px;
  padding-bottom: 70px;
}

.page-hero + .section,
.page-hero + .category-listing,
.page-hero + .blog-listing {
  padding-top: 0;
}

.home-hero {
  padding-top: 56px;
}

/* Categories */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.categories-section .category-grid {
  margin-top: 64px;
}

/* Products */
.popular-products .section-header,
.category-listing .section-header {
  margin-bottom: 66px;
}

.filter-tabs {
  display: flex;
  margin-bottom: 24px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.filter-button {
  display: inline-flex;
  min-height: 36px;
  padding: 8px;
  border: 0.5px solid var(--color-background);
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--text-body-sm);
  line-height: 1.2;
}

.filter-button:hover {
  background: var(--color-background);
}

.filter-button.is-active,
.filter-button[aria-pressed="true"] {
  border-color: var(--color-accent);
}

.filter-button .icon {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
}

.filter-button:not(.is-active) .icon {
  color: var(--color-ink);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.product-grid.is-filtering .product-card {
  pointer-events: none;
}

/* Testimonials */
.testimonials .section-header {
  margin-bottom: 64px;
}

.testimonials .section-header__title {
  max-width: 800px;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.testimonial-row {
  width: 100%;
  overflow: hidden;
}

.testimonial-track {
  display: flex;
  width: max-content;
  align-items: stretch;
  gap: 8px;
  will-change: transform;
}

.testimonial-track > .testimonial-card {
  flex: 0 0 calc((100vw - 16px) / 3);
}

@media (min-width: 810px) {
  body[data-page="product"] .product-detail {
    gap: 20px;
  }

  body[data-page="product"] .product-detail .product-info {
    padding-top: 0;
  }

  body[data-page="product"] .product-gallery__thumbs,
  body[data-page="product"] .thumbs {
    margin-top: 10px;
  }

  body[data-page="product"] .product-info {
    gap: 0;
  }

  body[data-page="product"] .product-info__title {
    max-width: none;
    font-size: 24px;
    line-height: 1.2;
  }

  body[data-page="product"] .product-info__subtitle {
    font-size: 16px;
  }

  body[data-page="product"] .product-info__heading {
    display: grid;
    margin-top: 18px;
    gap: 8px;
  }

  body[data-page="product"] .product-info__price {
    margin: 27px 0 0;
    font-size: 32px;
  }

  body[data-page="product"] .product-info__buy {
    min-height: 49px;
    margin-top: 49px;
  }

  body[data-page="product"] .urgency {
    height: 44px;
    min-height: 44px;
    margin-top: 25px;
    padding-block: 10px;
    font-size: 16px;
  }

  body[data-page="product"] .description-accordion {
    margin-top: 5px;
  }

  body[data-page="product"] .description-accordion__trigger {
    min-height: 44px;
    padding-block: 12px;
  }

  .testimonials-grid {
    width: 100vw;
    margin-left: calc(50% - 50vw);
  }
}

/* About */
.about-section .section-header,
.features-section .section-header,
.faq-section .section-header,
.blog-section .section-header,
.blog-listing .section-header {
  margin-bottom: 64px;
}

.about-section .section-header {
  margin-bottom: 64px;
}

.about-section .section-header__title {
  max-width: 740px;
  font-size: var(--text-h1);
}

.about-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.stats-grid {
  display: grid;
  margin-top: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.about-section .section-actions {
  margin-top: 24px;
}

/* Feature listing */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.blog-section .section-actions,
.blog-listing .section-actions {
  margin-top: 24px;
}

.home-hero {
  padding-bottom: 98.0625px;
}

.popular-products {
  padding-bottom: 99px;
}

.blog-section {
  padding-top: 100px;
  padding-bottom: 100px;
}

.blog-section .section-header {
  margin-bottom: 44px;
  gap: 10px;
}

.blog-section .section-header__text {
  width: 100%;
}

/* Newsletter */
.newsletter {
  padding: 50px 0 100px;
}

.newsletter .section-header {
  margin-bottom: 44px;
  gap: 10px;
}

.newsletter .section-header__text {
  width: 100%;
}

@media (min-width: 1200px) {
  .home-hero .section-header,
  .popular-products .section-header,
  .about-section .section-header,
  .blog-section .section-header,
  .newsletter .section-header {
    width: 1040px;
  }

  .home-hero .section-header__title,
  .popular-products .section-header__title,
  .about-section .section-header__title {
    width: 670.59375px;
  }

  .testimonials .section-header {
    width: 800px;
  }

  .testimonials .section-header__title {
    width: 800px;
  }

  .blog-section .section-header__title,
  .newsletter .section-header__title {
    width: 904.59375px;
  }
}

/* CTA */
.cta-section {
  width: min(calc(100% - (2 * var(--page-gutter))), 800px);
  margin-inline: auto;
  padding-block: 100px;
}

/* FAQ */
.faq-section .faq-list {
  width: min(100%, 1040px);
  margin-inline: auto;
}

/* Product detail page */
.product-detail {
  display: grid;
  padding-top: 76px;
  padding-bottom: 100px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 68px;
}

.product-detail .product-info {
  padding-top: 22px;
}

/* Article */
.post-article {
  padding-block: 64px 100px;
}

.post-article__back {
  margin-bottom: 72px;
}

.post-article__header {
  display: grid;
  width: min(100%, 860px);
  margin-inline: auto;
  justify-items: center;
  gap: 17px;
  text-align: center;
}

.post-article__header h1 {
  max-width: 800px;
  text-wrap: wrap;
}

.post-article__lede {
  max-width: 650px;
  color: var(--color-grey);
  font-size: var(--text-body);
  line-height: 1.3;
}

.post-article__hero {
  width: 100%;
  max-height: 710px;
  margin-top: 72px;
  overflow: hidden;
  aspect-ratio: 1.72 / 1;
  background: #ddd;
}

.post-article__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-article__body {
  position: relative;
  display: grid;
  width: min(100%, 760px);
  margin: 88px auto 0;
  padding-left: 32px;
  color: var(--color-grey);
  font-size: var(--text-body-lg);
  line-height: 1.5;
  gap: 25px;
}

.post-article__body::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--color-accent);
  content: "";
}

.post-article__body h2 {
  margin-top: 34px;
  color: var(--color-ink);
  font-size: var(--text-h3);
  letter-spacing: -0.02em;
  line-height: 1;
}

.post-article__body h2:first-child {
  margin-top: 0;
}

.post-article__body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-article + .cta-section {
  padding-top: 0;
}

@media (min-width: 810px) {
  body[data-page="category"] .category-listing {
    padding-top: 68px;
  }

  body[data-page="category"] .category-listing .section-header {
    margin-bottom: 36px;
  }

  body[data-page="category"] .category-listing + .testimonials-section {
    padding-top: 183px;
    padding-bottom: 103px;
  }

  body[data-page="category"] .category-listing + .testimonials-section .section-header {
    margin-bottom: 47px;
  }

  .post-article {
    padding: 6px 0 99px;
  }

  .post-article__back {
    margin-bottom: 16px;
  }

  .post-article__hero {
    width: min(100%, 800px);
    max-height: none;
    margin: 66px auto 0;
    border-radius: 24px;
    aspect-ratio: 1.2308 / 1;
  }

  .post-article__body {
    width: min(100%, 800px);
    margin-top: 100px;
    padding-left: 36px;
    font-size: 16px;
    line-height: 1.5;
    gap: 10px;
  }

  .post-article__body::before {
    bottom: auto;
    height: 470px;
  }

  .post-article__body h2 {
    margin-top: 36px;
    font-size: 54px;
  }

  .post-article__body h2:first-child {
    margin-top: 0;
    margin-bottom: 8px;
  }

  .post-article__body h2:nth-child(4) {
    margin-top: 28px;
  }

  body[data-page="about"] .about-section {
    padding-top: 56px;
  }

  body[data-page="about"] .about-section .section-header {
    margin-bottom: 67px;
  }

  body[data-page="about"] .features-section .section-header {
    margin-bottom: 68px;
  }

  body[data-page="about"] .features-grid {
    gap: 11px;
  }

  body[data-page="about"] .feature-card {
    height: 66px;
    min-height: 66px;
  }

  body[data-page="about"] .features-section {
    padding-bottom: 65px;
  }

  body[data-page="about"] .cta-section {
    padding-top: 0;
    padding-bottom: 100px;
  }

  body[data-page="about"] .faq-section .section-header {
    margin-bottom: 68px;
  }

  body[data-page="about"] .faq-list {
    gap: 9px;
  }

  body[data-page="about"] .faq-item__trigger,
  body[data-page="about"] .faq-item > summary {
    min-height: 64px;
    padding-block: 20px;
  }

  body[data-page="about"] .testimonials .section-header {
    margin-bottom: 65px;
  }

  body[data-page="about"] .blog-section .section-header {
    margin-bottom: 62px;
  }

  body[data-page="about"] .blog-section {
    padding-bottom: 123px;
  }

  body[data-page="blogs"] .blog-listing {
    padding-top: 56px;
    padding-bottom: 57px;
  }

  body[data-page="blogs"] .blog-listing .section-header {
    margin-bottom: 55px;
  }

  body[data-page="blogs"] .blog-grid {
    gap: 12px;
  }
}

@media (min-width: 810px) {
  body[data-page="404"] .page-404 {
    min-height: 706px;
  }

  body[data-page="404"] .page-404__content {
    width: min(100%, 800px);
    transform: translateY(-33px);
  }

  body[data-page="404"] .page-404__text {
    color: var(--color-ink);
    white-space: nowrap;
  }

  body[data-page="404"] .page-404 .button {
    min-height: 49px;
    padding-inline: 20px;
  }
}

/* 404 */
.page-404 {
  display: grid;
  min-height: 620px;
  padding-block: 100px;
  place-items: center;
}

.page-404__content {
  display: grid;
  width: min(100%, 650px);
  justify-items: center;
  gap: 30px;
  text-align: center;
}

.page-404__text {
  color: var(--color-grey);
  font-size: var(--text-body-lg);
  line-height: 1.3;
}
