/* ============================================================
   page-agricultural-film.css
   Prefix: afl-
   Depends on: global.css (all tokens, .btn, .section-dark,
               .section-light, .section-header, .container)
   ============================================================ */

/* ── S1 HERO ─────────────────────────────────────────────── */

.afl-hero {
  position: relative;
  overflow: hidden;
  padding: var(--sp-8) var(--sp-5);
  min-height: 560px;
  display: flex;
  align-items: center;
}

.afl-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.afl-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.afl-hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(215,25,32,.28), transparent 35%),
    linear-gradient(135deg, rgba(11,13,16,.92) 0%, rgba(23,26,31,.80) 60%, rgba(36,39,46,.70) 100%);
}

.afl-hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.afl-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-mid);
  background: rgba(215,25,32,0.12);
  border: 1px solid rgba(215,25,32,0.30);
  border-radius: 100px;
  padding: 5px var(--sp-2);
  width: fit-content;
}

.afl-hero__title {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  max-width: 760px;
  margin: 0;
}

.afl-hero__title em {
  font-style: normal;
  color: var(--brand-mid);
}

.afl-hero__subtitle {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  line-height: 1.7;
  margin: 0;
}

/* Trust bar */
.afl-hero__trust {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  width: fit-content;
}

.afl-trust-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.afl-trust-num {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-xl);
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.afl-trust-unit {
  font-size: var(--text-base);
  font-weight: 500;
  color: rgba(255,255,255,0.70);
}

.afl-trust-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.45);
  font-weight: 500;
  white-space: nowrap;
}

.afl-hero__divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}

.afl-hero__cta-group {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}


/* ── S2 FILM TYPE SELECTOR ───────────────────────────────── */

.afl-selector {
  padding: var(--sp-7) var(--sp-5);
}

.afl-selector__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.afl-selector__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: #fff;
  border: 2px solid var(--gray-100);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: left;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-card);
}

.afl-selector__card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.afl-selector__card--active {
  border-color: var(--brand);
  background: var(--brand-subtle);
  box-shadow: var(--shadow-lift);
}

.afl-selector__card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.afl-selector__card-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
  border-radius: var(--r-md);
  color: var(--brand);
  flex-shrink: 0;
}

.afl-selector__card-icon--green {
  background: var(--green-bg);
  color: var(--green-fg);
}

.afl-selector__card-title {
  display: block;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.3;
}

.afl-selector__card-sub {
  display: block;
  font-size: var(--text-sm);
  color: var(--gray-600);
  margin-top: 2px;
  line-height: 1.5;
}

.afl-selector__card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-1);
}

.afl-selector__spec-tag {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid rgba(215,25,32,0.18);
  border-radius: 100px;
  padding: 2px 8px;
  white-space: nowrap;
}

.afl-selector__spec-tag--green {
  color: var(--green-fg);
  background: var(--green-bg);
  border-color: rgba(22,101,52,0.20);
}


/* ── S3 COMPLETE LINE ────────────────────────────────────── */

.afl-flow {
  padding: var(--sp-7) var(--sp-5);
}

.afl-flow__panel {
  display: none;
  flex-direction: column;
  gap: var(--sp-5);
}

.afl-flow__panel--active {
  display: flex;
}

.afl-flow__svg-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
}

.afl-line__svg {
  min-width: 960px;
  width: 100%;
  height: auto;
  display: block;
}

/* Cards row */
.afl-flow__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

.afl-flow__card {
  padding: var(--sp-4);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.afl-flow__card--bio {
  background: rgba(22,163,74,0.08);
  border-color: rgba(34,197,94,0.20);
}

.afl-flow__card-num {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: rgba(215,25,32,0.50);
  line-height: 1;
}

.afl-flow__card-num--bio {
  color: rgba(34,197,94,0.50);
}

.afl-flow__card h4 {
  font-size: var(--text-base);
  font-weight: 700;
  color: rgba(255,255,255,0.90);
  margin: 0;
  line-height: 1.4;
}

.afl-flow__card p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin: 0;
}

/* Bio CTA bar */
.afl-bio__cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: rgba(22,163,74,0.10);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--r-lg);
  flex-wrap: wrap;
}

.afl-bio__cta-bar p {
  font-size: var(--text-base);
  color: rgba(255,255,255,0.70);
  margin: 0;
  max-width: 580px;
  line-height: 1.6;
}


/* ── S4 SPEC TABLE ───────────────────────────────────────── */

.afl-specs {
  padding: var(--sp-7) var(--sp-5);
}

.afl-specs__table-wrap {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-100);
  box-shadow: var(--shadow-card);
  margin-top: var(--sp-5);
}

.afl-specs__table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.afl-specs__table thead tr {
  background: var(--charcoal);
}

.afl-specs__table thead th {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.70);
  white-space: nowrap;
}

.afl-specs__table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  background: #fff;
  transition: background 0.15s ease;
}

.afl-specs__table tbody tr:hover {
  background: var(--gray-50);
}

.afl-specs__table tbody tr:last-child {
  border-bottom: none;
}

.afl-specs__row--highlight {
  background: var(--brand-subtle) !important;
}

.afl-specs__table td {
  padding: var(--sp-3);
  color: var(--gray-800);
  vertical-align: top;
  line-height: 1.5;
}

.afl-specs__film-name {
  display: block;
  font-weight: 700;
  color: var(--gray-800);
}

.afl-specs__film-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 2px;
}

.afl-specs__mono {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-xs);
  color: var(--gray-600);
}

.afl-specs__config-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-tint);
  border: 1px solid rgba(215,25,32,0.18);
  border-radius: 100px;
  padding: 2px 8px;
  white-space: nowrap;
}

.afl-specs__config-tag--aba {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: rgba(29,78,216,0.20);
}

.afl-specs__config-tag--bio {
  color: var(--green-fg);
  background: var(--green-bg);
  border-color: rgba(22,101,52,0.20);
}

/* Masterbatch dosing callout */
.afl-specs__dosing-block {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
}

.afl-specs__dosing-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
  border-radius: var(--r-md);
  color: var(--brand);
  flex-shrink: 0;
}

.afl-specs__dosing-text h4 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 var(--sp-1);
}

.afl-specs__dosing-text p {
  font-size: var(--text-sm);
  color: var(--gray-600);
  line-height: 1.7;
  margin: 0;
}


/* ── S5 CONFIGURATION COMPARISON ────────────────────────── */

.afl-config {
  padding: var(--sp-7) var(--sp-5);
}

.afl-config__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  align-items: start;
}

.afl-config__card {
  padding: var(--sp-5);
  background: #fff;
  border: 2px solid var(--gray-100);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  position: relative;
}

.afl-config__card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.afl-config__card--featured {
  border-color: var(--brand);
  box-shadow: var(--shadow-lift);
}

.afl-config__featured-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand);
  border-radius: 100px;
  padding: 3px var(--sp-2);
  white-space: nowrap;
}

.afl-config__card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.afl-config__card-num {
  font-family: 'DM Mono', monospace;
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--gray-200);
  line-height: 1;
  flex-shrink: 0;
}

.afl-config__card-num--featured {
  color: var(--brand);
}

.afl-config__card-num--bio {
  color: var(--green-fg);
}

.afl-config__card-title {
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.3;
}

.afl-config__card-sub {
  font-size: var(--text-sm);
  color: var(--gray-400);
  margin: 2px 0 0;
}

.afl-config__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.afl-config__list li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-1);
  font-size: var(--text-sm);
  color: var(--gray-600);
  line-height: 1.5;
}

.afl-config__list li svg {
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 2px;
}

.afl-config__best-for {
  font-size: var(--text-sm);
  color: var(--gray-600);
  background: var(--gray-50);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  line-height: 1.5;
}

.afl-config__best-for-label {
  font-weight: 700;
  color: var(--gray-800);
  margin-right: 4px;
}


/* ── S6 CLOSED LOOP ──────────────────────────────────────── */

.afl-loop {
  padding: var(--sp-7) var(--sp-5);
}

.afl-loop__svg-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-lg);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  margin-top: var(--sp-5);
}

.afl-loop__svg-wrap svg {
  min-width: 760px;
  width: 100%;
  height: auto;
  display: block;
}

.afl-loop__detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  margin-top: var(--sp-5);
}

.afl-loop__detail-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.afl-loop__detail-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  color: var(--brand-mid);
  flex-shrink: 0;
}

.afl-loop__detail-col h4 {
  font-size: var(--text-md);
  font-weight: 700;
  color: rgba(255,255,255,0.90);
  margin: 0;
  line-height: 1.4;
}

.afl-loop__detail-col p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  margin: 0;
}

.afl-loop__detail-col .link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand-mid);
  text-decoration: none;
  margin-top: var(--sp-1);
  transition: gap 0.2s ease, color 0.2s ease;
}

.afl-loop__detail-col .link-arrow:hover {
  gap: 10px;
  color: #fff;
}

.afl-loop__detail-col .link-arrow:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ── S7 WHY LAYERQUESTAR ─────────────────────────────────── */

.afl-why {
  padding: var(--sp-7) var(--sp-5);
}

.afl-why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

/* 5 cards — last row: 2 cards centred */
.afl-why__grid .afl-why__card:nth-child(4) {
  grid-column: 1;
}
.afl-why__grid .afl-why__card:nth-child(5) {
  grid-column: 2;
}

.afl-why__card {
  padding: var(--sp-4);
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
}

.afl-why__card:hover {
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.afl-why__icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-tint);
  border-radius: var(--r-md);
  color: var(--brand);
  flex-shrink: 0;
}

.afl-why__card h4 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
  line-height: 1.4;
}

.afl-why__card p {
  font-size: var(--text-sm);
  color: var(--gray-600);
  line-height: 1.7;
  margin: 0;
}


/* ── S8 FAQ ──────────────────────────────────────────────── */

.afl-faq {
  padding: var(--sp-7) var(--sp-5);
}

.afl-faq__list {
  max-width: 820px;
  margin: var(--sp-5) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.afl-faq__item {
  background: #fff;
  border: 1px solid var(--gray-100);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease;
}

.afl-faq__item[open] {
  border-color: var(--brand);
}

/* Remove native browser marker */
summary {
  list-style: none;
}
summary::-webkit-details-marker {
  display: none;
}

.afl-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-800);
  cursor: pointer;
  line-height: 1.5;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.afl-faq__q:hover {
  background: var(--gray-50);
  color: var(--brand);
}

.afl-faq__item[open] .afl-faq__q {
  color: var(--brand);
  background: var(--brand-subtle);
}

.afl-faq__q:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.afl-faq__chevron {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--gray-400);
  transition: transform 0.25s ease, color 0.2s ease;
}

.afl-faq__item[open] .afl-faq__chevron {
  transform: rotate(180deg);
  color: var(--brand);
}

.afl-faq__a {
  padding: 0 var(--sp-4) var(--sp-3);
  border-top: 1px solid var(--gray-100);
}

.afl-faq__a p {
  font-size: var(--text-sm);
  color: var(--gray-600);
  line-height: 1.8;
  margin: var(--sp-2) 0 0;
}

.afl-faq__a p + p {
  margin-top: var(--sp-2);
}


/* ── S9 FINAL CTA ────────────────────────────────────────── */

.afl-cta {
  padding: var(--sp-8) var(--sp-5);
}

.afl-cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-5);
}

.afl-cta__text .section-title {
  justify-content: center;
}

.afl-cta__text h2 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-3xl));
  font-weight: 800;
  color: #fff;
  margin: var(--sp-2) 0;
  line-height: 1.2;
}

.afl-cta__text h2 em {
  font-style: normal;
  color: var(--brand-mid);
}

.afl-cta__text p {
  font-size: var(--text-md);
  color: rgba(255,255,255,0.60);
  max-width: 580px;
  line-height: 1.7;
  margin: 0 auto;
}

.afl-cta__actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: center;
}

.afl-cta__trust {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  justify-content: center;
}

.afl-cta__trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.50);
  font-weight: 500;
}

.afl-cta__trust-item svg {
  color: var(--brand-mid);
  flex-shrink: 0;
}


/* ── RESPONSIVE ──────────────────────────────────────────── */

@media (max-width: 960px) {

  /* Hero */
  .afl-hero {
    padding: var(--sp-7) var(--sp-3);
    min-height: 480px;
  }
  .afl-hero__trust {
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
  }
  .afl-hero__divider {
    display: none;
  }
  .afl-trust-num {
    font-size: var(--text-lg);
  }

  /* Selector */
  .afl-selector {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-selector__grid {
    grid-template-columns: 1fr;
  }

  /* Flow */
  .afl-flow {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-flow__cards {
    grid-template-columns: 1fr;
  }
  .afl-bio__cta-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: var(--sp-3);
  }

  /* Specs */
  .afl-specs {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-specs__dosing-block {
    flex-direction: column;
  }

  /* Config */
  .afl-config {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-config__grid {
    grid-template-columns: 1fr;
  }

  /* Loop */
  .afl-loop {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-loop__detail {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  /* Why */
  .afl-why {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-why__grid {
    grid-template-columns: 1fr 1fr;
  }
  .afl-why__grid .afl-why__card:nth-child(4),
  .afl-why__grid .afl-why__card:nth-child(5) {
    grid-column: auto;
  }

  /* FAQ */
  .afl-faq {
    padding: var(--sp-6) var(--sp-3);
  }
  .afl-faq__q {
    font-size: var(--text-sm);
    padding: var(--sp-2) var(--sp-3);
  }
  .afl-faq__a {
    padding: 0 var(--sp-3) var(--sp-2);
  }

  /* CTA */
  .afl-cta {
    padding: var(--sp-7) var(--sp-3);
  }
  .afl-cta__trust {
    gap: var(--sp-2);
  }
}

@media (max-width: 600px) {

  .afl-hero__cta-group {
    flex-direction: column;
  }
  .afl-hero__cta-group .btn {
    width: 100%;
    justify-content: center;
  }

  .afl-hero__trust {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-2);
  }

  .afl-why__grid {
    grid-template-columns: 1fr;
  }

  .afl-cta__actions {
    flex-direction: column;
    width: 100%;
  }
  .afl-cta__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .afl-cta__trust {
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
  }
}

/* ── REDUCED MOTION ──────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .afl-selector__card,
  .afl-config__card,
  .afl-why__card,
  .afl-faq__item,
  .afl-faq__chevron,
  .afl-loop__detail-col .link-arrow {
    transition: none;
  }
}
