/* Shop: Joy's own sales (cart/checkout) plus Amazon affiliate links. Builds on asf-blog.css (header band, related, text arrows). */

/* ---------- Buttons ---------- */
.asf-shop-buys {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.asf-shop-buy {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid var(--asf-navy);
  border-radius: 999px;
  background: transparent;
  color: var(--asf-navy);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 200ms, color 200ms, border-color 200ms, transform 300ms var(--asf-ease);
}

.asf-shop-buy:not(.asf-shop-buy-soon):not(.is-direct)::after {
  content: "\2197";
  font-size: 0.95em;
  transition: transform 300ms var(--asf-ease);
}

.asf-shop-buy.is-primary {
  background: var(--asf-navy);
  color: var(--asf-cream);
}

.asf-shop-buy:hover,
.asf-shop-buy:focus-visible {
  border-color: var(--asf-coral);
  background: var(--asf-coral);
  color: var(--asf-navy);
}

.asf-shop-buy:hover::after,
.asf-shop-buy:focus-visible::after {
  transform: translate(2px, -2px);
}

.asf-shop-buy:focus-visible {
  outline: 3px solid var(--asf-plum);
  outline-offset: 3px;
}

.asf-shop-buy-soon {
  border-style: dashed;
}

.asf-shop-buys.is-compact {
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.asf-shop-buys.is-compact .asf-shop-buy {
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}

.asf-shop-note {
  max-width: 52ch;
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.75;
}

.asf-shop-direct-note {
  font-size: 14px;
  opacity: 0.9;
}

/* ---------- Cart and checkout (WooCommerce blocks inside page.php's .asf-checkout-body) ---------- */
.asf-site .asf-checkout-body {
  max-width: 1120px;
  color: var(--asf-ink);
  font-size: 16px;
  line-height: 1.5;
}

.asf-checkout-body .wc-block-components-title,
.asf-checkout-body .wc-block-components-checkout-step__title {
  color: var(--asf-navy);
  font-family: var(--asf-font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.asf-checkout-body a {
  color: var(--asf-plum);
}

.asf-site .asf-checkout-body .wc-block-components-button:not(.is-link) {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--asf-navy);
  color: var(--asf-cream);
  font-weight: 800;
  text-decoration: none;
}

.asf-site .asf-checkout-body .wc-block-components-button:not(.is-link):hover,
.asf-site .asf-checkout-body .wc-block-components-button:not(.is-link):focus-visible {
  background: var(--asf-coral);
  color: var(--asf-navy);
}

.asf-checkout-body .wc-block-components-product-name {
  color: var(--asf-navy);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- Shop page ---------- */
.asf-shop-header .asf-article-title {
  font-size: clamp(3rem, 9vw, 7.5rem);
  letter-spacing: -0.05em;
  line-height: 0.92;
}

.asf-shop-section + .asf-shop-section {
  margin-top: clamp(64px, 8vw, 112px);
}

.asf-shop-section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(24px, 3vw, 40px);
}

.asf-shop-section-head::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--asf-navy);
  opacity: 0.14;
}

.asf-shop-section-title {
  margin: 0;
  color: var(--asf-navy);
  font-family: var(--asf-font-display);
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
}

.asf-shop-disclosure {
  max-width: 70ch;
  margin: clamp(56px, 7vw, 96px) 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--asf-line-dark);
  color: var(--asf-ink-soft);
  font-size: 14px;
  line-height: 1.6;
}

/* Feature rows for Joy's own books */
.asf-product-features {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}

.asf-product-feature {
  --asf-tone: var(--asf-lavender);
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  overflow: hidden;
  border-radius: var(--asf-radius-media);
  background: var(--asf-white);
  box-shadow: 0 1px 0 rgba(16, 21, 47, 0.08);
}

.asf-product-feature:nth-child(even) {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
}

.asf-product-feature:nth-child(even) .asf-product-feature-cover {
  order: 2;
}

.asf-tone-coral { --asf-tone: var(--asf-coral); }
.asf-tone-green { --asf-tone: var(--asf-green); }

.asf-product-feature-cover {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(36px, 5vw, 72px) clamp(28px, 4vw, 56px);
  overflow: hidden;
  background: var(--asf-tone);
}

.asf-product-feature-cover::before {
  content: "";
  position: absolute;
  inset: auto -20% -38% auto;
  width: 80%;
  aspect-ratio: 1;
  border: 1px solid rgba(16, 21, 47, 0.16);
  border-radius: 50%;
}

.asf-product-feature-cover img {
  position: relative;
  display: block;
  width: min(100%, 300px);
  height: auto;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(16, 21, 47, 0.3);
  transform: rotate(-3deg);
  transition: transform 600ms var(--asf-ease);
}

.asf-product-feature:nth-child(even) .asf-product-feature-cover img {
  transform: rotate(3deg);
}

.asf-product-feature:hover .asf-product-feature-cover img {
  transform: rotate(0deg) translateY(-6px);
}

.asf-product-feature-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
}

.asf-product-feature-title {
  max-width: 18ch;
  margin: 0;
  color: var(--asf-navy);
  font-family: var(--asf-font-display);
  font-size: clamp(2rem, 3.6vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.02;
  text-wrap: balance;
}

.asf-product-feature-title a {
  color: inherit;
  text-decoration: none;
}

.asf-product-feature-title a:hover,
.asf-product-feature-title a:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.asf-product-feature-summary {
  max-width: 54ch;
  margin: 18px 0 0;
  color: var(--asf-ink);
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  line-height: 1.65;
}

.asf-product-feature-facts {
  margin: 14px 0 0;
  color: var(--asf-ink-soft);
  font-size: 14px;
  font-weight: 700;
}

.asf-product-feature-copy .asf-text-arrow {
  margin-top: 22px;
}

/* Card grid for recommended products */
.asf-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(20px, 2.6vw, 32px);
}

.asf-product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(16, 21, 47, 0.08);
  border-radius: var(--asf-radius-media);
  background: var(--asf-white);
  transition: transform 300ms var(--asf-ease), box-shadow 300ms var(--asf-ease);
}

.asf-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--asf-shadow);
}

.asf-product-card:focus-within {
  outline: 3px solid var(--asf-plum);
  outline-offset: 3px;
}

.asf-product-card-media {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 28px;
  background: var(--asf-lavender);
}

.asf-product-card:nth-child(3n + 2) .asf-product-card-media { background: #ffd9cf; }
.asf-product-card:nth-child(3n + 3) .asf-product-card-media { background: #dcefd3; }

.asf-product-card-media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 16px 34px rgba(16, 21, 47, 0.22);
  transition: transform 600ms var(--asf-ease);
}

.asf-product-card:hover .asf-product-card-media img {
  transform: translateY(-4px) rotate(-1.5deg);
}

.asf-product-card-placeholder {
  width: 60%;
  height: 80%;
  border-radius: 4px;
  background: rgba(16, 21, 47, 0.12);
}

.asf-product-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 22px 22px;
}

.asf-product-card .asf-card-title {
  font-size: clamp(1.2rem, 1.6vw, 1.4rem);
}

.asf-product-card .asf-card-excerpt {
  margin-bottom: 0;
}

.asf-product-card.is-coming-soon .asf-card-kicker {
  color: var(--asf-plum);
}

/* ---------- Single product ---------- */
.asf-product .asf-article-header-book .asf-breadcrumbs {
  color: var(--asf-navy);
}

.asf-product-kicker {
  color: var(--asf-plum);
}

.asf-product .asf-book-hero-cover img {
  max-height: 520px;
  width: auto;
  max-width: 100%;
  margin-left: auto;
}

.asf-product-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--asf-read)) minmax(240px, 320px);
  justify-content: space-between;
  gap: clamp(40px, 6vw, 96px);
}

.asf-product-layout > :only-child {
  grid-column: 1 / -1;
}

.asf-product-details {
  position: sticky;
  top: calc(var(--asf-header-height) + 32px);
  align-self: start;
  padding: 26px;
  border: 1px solid var(--asf-line-dark);
  border-radius: var(--asf-radius-media);
  background: var(--asf-white);
}

.asf-product-details-title {
  margin: 0 0 14px;
  color: var(--asf-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.asf-product-details dl {
  margin: 0;
}

.asf-product-details dl > div {
  padding: 11px 0;
  border-top: 1px solid var(--asf-line-dark);
}

.asf-product-details dt {
  color: var(--asf-ink-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.asf-product-details dd {
  margin: 2px 0 0;
  color: var(--asf-navy);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
}

.asf-product-details .asf-shop-buys {
  flex-direction: column;
  align-items: stretch;
}

.asf-product-details .asf-shop-buy {
  justify-content: center;
}

.asf-product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 16px;
}

.asf-product-gallery figure {
  margin: 0;
}

.asf-product-gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.asf-related .asf-product-card {
  background: var(--asf-white);
}

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .asf-product-layout {
    grid-template-columns: minmax(0, var(--asf-read));
  }

  .asf-product-details {
    position: static;
  }
}

@media (max-width: 760px) {
  .asf-product-feature,
  .asf-product-feature:nth-child(even) {
    grid-template-columns: 1fr;
  }

  .asf-product-feature:nth-child(even) .asf-product-feature-cover {
    order: 0;
  }

  .asf-product-feature-cover img {
    width: min(62%, 240px);
  }

  .asf-shop-buys {
    margin-top: 22px;
  }

  .asf-shop-buys:not(.is-compact) .asf-shop-buy {
    flex: 1 1 100%;
    justify-content: center;
  }

  .asf-product .asf-book-hero-cover img {
    max-height: 300px;
    margin-left: 0;
  }

  .asf-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .asf-shop-buy,
  .asf-shop-buy::after,
  .asf-product-card,
  .asf-product-card-media img,
  .asf-product-feature-cover img {
    transition: none;
  }

  .asf-product-card:hover,
  .asf-product-card:hover .asf-product-card-media img,
  .asf-product-feature:hover .asf-product-feature-cover img {
    transform: none;
  }

  .asf-product-feature:hover .asf-product-feature-cover img {
    transform: rotate(-3deg);
  }
}
