/**
 * Astral Commerce 3.2.0 — Premium Page Polish
 * Page-level rhythm and composition built on the 9.1/9.2 token system.
 */

:root {
  --acp-page-section-space: clamp(3.5rem, 6vw, 6.5rem);
  --acp-page-section-space-compact: clamp(2.5rem, 4vw, 4.25rem);
  --acp-page-hero-space: clamp(3rem, 6vw, 6rem);
  --acp-copy-measure: 68ch;
}

/* Consistent page rhythm */
.site-main > section,
.acp-page-section,
.acp-home-section,
.acp-editorial-section,
.acp-product-section {
  scroll-margin-top: 7rem;
}

.acp-page-shell,
.acp-page-hero__inner,
.acp-archive-hero__inner,
.acp-journey-hero__inner {
  width: min(100% - 2rem, var(--acp-container, 1200px));
  margin-inline: auto;
}

.acp-page-hero,
.acp-archive-hero,
.acp-journey-hero {
  padding-block: var(--acp-page-hero-space);
}

.acp-page-hero p,
.acp-archive-hero p,
.acp-journey-hero p,
.acp-section-heading__copy {
  max-width: var(--acp-copy-measure);
}

/* Homepage */
.home .acp-home-section {
  padding-block: var(--acp-page-section-space);
}

.home .acp-home-section + .acp-home-section {
  border-top: 1px solid color-mix(in srgb, currentColor 8%, transparent);
}

.home .acp-home-hero {
  min-height: clamp(34rem, 72vh, 50rem);
  align-items: center;
}

.home .acp-home-hero__content {
  max-width: 42rem;
}

.home .acp-home-hero__actions,
.acp-section-heading__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* Product discovery / shop */
.woocommerce.archive .site-main,
.search-results .site-main {
  padding-bottom: var(--acp-page-section-space);
}

.acp-discovery-layout {
  gap: clamp(1.5rem, 3vw, 3rem);
}

.woocommerce ul.products,
ul.products.acp-product-grid,
.acp-product-grid {
  gap: clamp(1rem, 2vw, 1.75rem);
}

.woocommerce ul.products li.product,
.acp-product-card {
  min-width: 0;
}

.woocommerce ul.products li.product img,
.acp-product-card__media img {
  aspect-ratio: 1 / 1.12;
  object-fit: contain;
}

.acp-discovery-toolbar {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(1.25rem, 2vw, 2rem);
}

/* Product detail */
.single-product div.product {
  row-gap: var(--acp-page-section-space-compact);
}

.single-product .acp-product-hero {
  padding-block: clamp(2rem, 4vw, 4.5rem);
}

.single-product .woocommerce-product-gallery,
.single-product .summary {
  min-width: 0;
}

.single-product .summary {
  align-self: start;
}

.single-product .product_meta {
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
}

.single-product .acp-product-content,
.single-product .acp-product-reviews,
.single-product .acp-product-learning,
.single-product .related.products {
  padding-block: var(--acp-page-section-space-compact);
}

.single-product .related.products ul.products {
  margin-bottom: 0;
}

/* Cart and checkout */
.woocommerce-cart .site-main,
.woocommerce-checkout .site-main,
.woocommerce-account .site-main {
  padding-block: clamp(2rem, 4vw, 4.5rem) var(--acp-page-section-space);
}

.woocommerce-cart .cart-collaterals,
.woocommerce-checkout #order_review,
.woocommerce-checkout .woocommerce-checkout-review-order {
  border-radius: var(--acp-radius-lg, 1rem);
}

.woocommerce-checkout .col2-set,
.woocommerce-cart .woocommerce-cart-form {
  min-width: 0;
}

/* Account */
.woocommerce-account .woocommerce {
  gap: clamp(1.5rem, 3vw, 3rem);
}

.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
  min-width: 0;
}

.woocommerce-account .woocommerce-MyAccount-content > *:first-child {
  margin-top: 0;
}

/* Editorial / Learn */
.acp-editorial-layout {
  gap: clamp(2rem, 4vw, 4rem);
}

.single-post .entry-content,
.acp-article-content {
  font-size: clamp(1rem, .25vw + .95rem, 1.125rem);
  line-height: 1.78;
}

.single-post .entry-content > *,
.acp-article-content > * {
  max-width: var(--acp-copy-measure);
  margin-inline: auto;
}

.single-post .entry-content > .alignwide,
.acp-article-content > .alignwide {
  max-width: min(100%, 76rem);
}

.single-post .entry-content > .alignfull,
.acp-article-content > .alignfull {
  max-width: none;
}

/* Search and empty states */
.search-no-results .site-main,
.error404 .site-main {
  min-height: 62vh;
  display: grid;
  align-items: center;
}

.error404 .acp-404,
.search-no-results .acp-no-results {
  padding-block: clamp(3rem, 7vw, 7rem);
}

.error404 .acp-404__content,
.search-no-results .acp-no-results__content {
  max-width: 44rem;
  margin-inline: auto;
  text-align: center;
}

/* Responsive composition */
@media (max-width: 960px) {
  .home .acp-home-hero {
    min-height: auto;
  }

  .single-product .acp-product-hero,
  .acp-discovery-layout,
  .acp-editorial-layout {
    grid-template-columns: 1fr;
  }

  .woocommerce-account .woocommerce {
    display: block;
  }
}

@media (max-width: 640px) {
  :root {
    --acp-page-section-space: 3.25rem;
    --acp-page-section-space-compact: 2.5rem;
    --acp-page-hero-space: 3rem;
  }

  .acp-page-shell,
  .acp-page-hero__inner,
  .acp-archive-hero__inner,
  .acp-journey-hero__inner {
    width: min(100% - 1.25rem, var(--acp-container, 1200px));
  }

  .home .acp-home-hero__actions,
  .acp-section-heading__actions {
    align-items: stretch;
  }

  .home .acp-home-hero__actions > *,
  .acp-section-heading__actions > * {
    width: 100%;
  }

  .woocommerce ul.products,
  ul.products.acp-product-grid,
  .acp-product-grid {
    gap: .875rem;
  }
}
