/* ==========================================================================
   Page-level compositions
   ========================================================================== */

/* --- Hero ----------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 82% 8%, rgba(183, 217, 53, 0.16) 0%, transparent 58%),
    radial-gradient(70% 60% at 8% 92%, rgba(201, 134, 58, 0.16) 0%, transparent 55%),
    linear-gradient(165deg, var(--forest-700) 0%, var(--forest-900) 100%);
  color: var(--cream-100);
  padding-block: clamp(3rem, 1.5rem + 7vw, 6rem) clamp(3.5rem, 2rem + 7vw, 6.5rem);
}

/* Faint cane-field line texture behind the hero content. */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    102deg,
    rgba(183, 217, 53, 0.055) 0px,
    rgba(183, 217, 53, 0.055) 1px,
    transparent 1px,
    transparent 26px
  );
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.hero__title {
  font-size: var(--text-5xl);
  color: var(--cream-50);
}

.hero__title em {
  font-style: normal;
  color: var(--lime-400);
}

.hero__lede {
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.15rem);
  line-height: var(--leading-relaxed);
  color: rgba(248, 243, 231, 0.78);
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-4);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(248, 243, 231, 0.14);
  width: 100%;
}

.hero__proof-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: rgba(248, 243, 231, 0.66);
}

.hero__proof-item .icon {
  width: 17px;
  height: 17px;
  color: var(--lime-400);
}

/* Stacked pack shots */
.hero__media {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  align-items: center;
}

.hero__pack {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(248, 243, 231, 0.14);
  transition: transform var(--duration-slow) var(--ease-out);
}

.hero__pack img {
  width: 100%;
  /* Portrait crop so the two packs carry the height of the copy beside them. */
  aspect-ratio: 1 / 1.24;
  object-fit: cover;
}

.hero__pack:first-child {
  transform: translateY(-22px) rotate(-1.8deg);
}

.hero__pack:last-child {
  transform: translateY(22px) rotate(1.8deg);
}

.hero__pack:hover {
  transform: translateY(0) rotate(0) scale(1.03);
  z-index: 2;
}

.hero__seal {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: clamp(84px, 9vw, 108px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--lime-400);
  color: var(--forest-900);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xs);
  line-height: 1.15;
  text-align: center;
  letter-spacing: 0.02em;
  box-shadow: 0 14px 34px -12px rgba(4, 24, 20, 0.7);
  border: 3px solid var(--forest-800);
}

.hero__seal span {
  display: block;
  font-size: 1.55em;
  letter-spacing: -0.03em;
}

@media (max-width: 940px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .hero__content {
    align-items: center;
    text-align: center;
  }

  .hero__lede {
    margin-inline: auto;
  }

  .hero__actions,
  .hero__proof {
    justify-content: center;
  }

  .hero__media {
    max-width: 520px;
    margin-inline: auto;
  }
}

@media (max-width: 480px) {
  .hero__pack:first-child,
  .hero__pack:last-child {
    transform: none;
  }

  .hero__seal {
    display: none;
  }
}

/* --- Page hero (interior pages) ------------------------------------------- */

.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(80% 80% at 85% 0%, rgba(183, 217, 53, 0.14) 0%, transparent 60%),
    linear-gradient(160deg, var(--forest-700), var(--forest-900));
  color: var(--cream-100);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.25rem);
}

.page-hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 64ch;
}

.page-hero h1 {
  font-size: var(--text-4xl);
  color: var(--cream-50);
}

.page-hero p {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: rgba(248, 243, 231, 0.74);
}

.page-hero .breadcrumb {
  color: rgba(248, 243, 231, 0.55);
}

.page-hero .breadcrumb a:hover {
  color: var(--lime-300);
}

.page-hero .breadcrumb li:not(:last-child)::after {
  color: rgba(248, 243, 231, 0.35);
}

/* --- Product detail ------------------------------------------------------- */

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: start;
}

.product-gallery {
  position: sticky;
  top: calc(var(--header-height) + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.product-gallery__main {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: linear-gradient(160deg, var(--forest-600), var(--forest-800));
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-soft);
}

.product-gallery__main img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.product-gallery__flag {
  position: absolute;
  top: var(--space-5);
  left: var(--space-5);
  z-index: 2;
}

.product-facts {
  display: grid;
  /* 100px keeps all three facts on one row even on a 360px phone. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 100px), 1fr));
  gap: var(--space-3);
}

.product-fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  text-align: center;
  align-items: center;
}

.product-fact .icon {
  width: 22px;
  height: 22px;
  color: var(--lime-600);
  margin-bottom: var(--space-2);
}

.product-fact__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--forest-800);
}

.product-fact__label {
  font-size: var(--text-xs);
  color: var(--color-ink-subtle);
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.product-info__name {
  font-family: var(--font-pack);
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--forest-800);
  /*
   * Comfortaa's glyphs sit low in the em box and its descenders ("gg" in
   * "Jaggery") render *below* the line box, so a box-level gap alone still
   * reads as touching. 1.35 keeps the descenders inside the element's own box.
   */
  line-height: 1.35;
}

.product-info__tagline {
  font-size: var(--text-lg);
  color: var(--color-ink-muted);
  /* Was a negative margin, which overlapped the name outright. */
  margin-top: var(--space-3);
}

.product-info__price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-block: 1px dashed var(--color-border);
}

.product-info__price .price__current {
  font-size: var(--text-3xl);
}

.product-info__copy p {
  color: var(--color-ink-muted);
  line-height: var(--leading-relaxed);
}

.product-info__copy p + p {
  margin-top: var(--space-4);
}

.product-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.product-cta__note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-ink-subtle);
}

.product-cta__note .icon {
  width: 16px;
  height: 16px;
  color: var(--lime-600);
}

.usage-list li {
  position: relative;
  padding-left: 1.85rem;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-ink-muted);
}

.usage-list li + li {
  margin-top: var(--space-3);
}

.usage-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 0 100% 0 100%;
  background: var(--lime-400);
  transform: rotate(-18deg);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table th,
.spec-table td {
  padding: var(--space-3) 0;
  text-align: left;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border-soft);
}

.spec-table th {
  font-weight: 500;
  color: var(--color-ink-subtle);
  width: 52%;
}

.spec-table td {
  font-weight: 600;
  color: var(--forest-800);
  text-align: right;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: none;
}

.panel {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}

.panel h3 {
  font-size: var(--text-lg);
  color: var(--forest-800);
  margin-bottom: var(--space-4);
}

@media (max-width: 900px) {
  .product-detail {
    grid-template-columns: 1fr;
  }

  .product-gallery {
    position: static;
  }
}

/* --- Checkout ------------------------------------------------------------- */

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 1rem + 3vw, 3rem);
  align-items: start;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.order-summary {
  position: sticky;
  top: calc(var(--header-height) + var(--space-5));
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--forest-800);
  color: var(--cream-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.order-summary h2 {
  font-size: var(--text-xl);
  color: var(--cream-50);
}

.order-summary__product {
  display: flex;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(248, 243, 231, 0.14);
}

.order-summary__thumb {
  width: 78px;
  height: 78px;
  flex: none;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(248, 243, 231, 0.16);
}

.order-summary__name {
  font-family: var(--font-pack);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--cream-50);
}

.order-summary__meta {
  font-size: var(--text-xs);
  color: rgba(248, 243, 231, 0.6);
  margin-top: 2px;
}

.summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: rgba(248, 243, 231, 0.78);
}

.summary-line + .summary-line {
  margin-top: var(--space-3);
}

.summary-line--total {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(248, 243, 231, 0.14);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--cream-50);
}

.summary-line--total .amount {
  color: var(--lime-400);
}

.summary-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: rgba(248, 243, 231, 0.6);
}

.summary-note .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--lime-400);
  margin-top: 0.1em;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--color-surface);
}

.qty-control button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--forest-700);
  transition: background-color var(--duration-fast) var(--ease-out);
}

.qty-control button:hover:not(:disabled) {
  background: var(--lime-100);
}

.qty-control button:disabled {
  color: var(--ink-300);
  cursor: not-allowed;
}

.qty-control input {
  width: 52px;
  height: 42px;
  border: none;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  background: transparent;
  -moz-appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
    order: -1;
  }
}

/* --- Order success -------------------------------------------------------- */

.success-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  padding-block: var(--space-8);
}

.success-mark {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--lime-100);
  color: var(--forest-600);
  border: 2px solid var(--lime-300);
  animation: pop var(--duration-slow) var(--ease-out) both;
}

.success-mark .icon {
  width: 42px;
  height: 42px;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.order-ref {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--forest-800);
  color: var(--lime-400);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.receipt {
  display: grid;
  /* 200px keeps all three blocks on one row inside the narrow container. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-6);
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.receipt h3 {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-ink-subtle);
  margin-bottom: var(--space-3);
}

.receipt dl {
  display: grid;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.receipt dt {
  color: var(--color-ink-subtle);
  font-size: var(--text-xs);
}

.receipt dd {
  color: var(--color-ink);
  font-weight: 500;
  margin: 0 0 var(--space-2) 0;
}

/* --- About ---------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(2rem, 1rem + 4vw, 4rem);
  align-items: center;
}

.split__media img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border-soft);
}

.prose p {
  color: var(--color-ink-muted);
  line-height: var(--leading-relaxed);
}

.prose p + p {
  margin-top: var(--space-4);
}

.prose h3 {
  color: var(--forest-800);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.pull-quote {
  position: relative;
  padding: var(--space-6) var(--space-6) var(--space-6) var(--space-8);
  background: var(--lime-100);
  border-left: 4px solid var(--lime-400);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: var(--leading-snug);
  color: var(--forest-800);
}

/* --- Contact -------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: var(--space-5);
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

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

.contact-card .icon {
  width: 26px;
  height: 26px;
  color: var(--lime-600);
  margin-bottom: var(--space-3);
}

.contact-card h3 {
  font-size: var(--text-base);
  color: var(--forest-800);
}

.contact-card p,
.contact-card a {
  font-size: var(--text-sm);
  color: var(--color-ink-muted);
  line-height: var(--leading-relaxed);
}

.contact-card a:hover {
  color: var(--forest-600);
  text-decoration: underline;
}

/* --- CTA band ------------------------------------------------------------- */

.cta-band {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 1.4rem + 3vw, 3.5rem);
  background:
    radial-gradient(80% 120% at 88% 10%, rgba(183, 217, 53, 0.2) 0%, transparent 60%),
    linear-gradient(140deg, var(--forest-700), var(--forest-900));
  color: var(--cream-100);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  box-shadow: var(--shadow-lg);
}

.cta-band h2 {
  font-size: var(--text-3xl);
  color: var(--cream-50);
  max-width: 20ch;
}

.cta-band p {
  color: rgba(248, 243, 231, 0.74);
  max-width: 44ch;
  margin-top: var(--space-3);
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --- Error page ----------------------------------------------------------- */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
  padding-block: clamp(3.5rem, 2rem + 8vw, 7rem);
}

.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 3rem + 10vw, 9rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--cream-300);
}

.error-page p {
  max-width: 48ch;
  color: var(--color-ink-muted);
  line-height: var(--leading-relaxed);
}
