/* ─── Certification Detail Page Styles ─────────────────────────────── */

/* Top bar: back link + breadcrumb */
.cert-topbar {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--mid-gray);
  background: var(--white);
}
.cert-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.cert-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 150ms;
}
.cert-back-link:hover { color: var(--red); }
.cert-back-link svg { width: 14px; height: 14px; }

.cert-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--text-light);
  flex-wrap: wrap;
}
.cert-breadcrumb a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 150ms;
}
.cert-breadcrumb a:hover { color: var(--red); }
.cert-breadcrumb span:last-child { color: var(--text-dark); }

/* Hero */
.cert-hero {
  padding: 3.5rem 0 3rem;
  background: linear-gradient(135deg, #1a0000 0%, #6b0000 40%, #c8161d 75%, #e8352d 100%);
  color: var(--white);
}
.cert-hero-inner {
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 5rem;
  align-items: start;
}
.cert-hero-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 1.25rem;
  grid-column: 1 / -1;
}
.cert-hero-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 0;
  grid-column: 1;
}
.cert-hero-sub {
  font-size: 0.9375rem;
  font-weight: 300;
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
  margin-bottom: 2rem;
  max-width: 100%;
  grid-column: 2;
  grid-row: 2;
  padding-top: 0.25rem;
}
.cert-hero-inner .btn-primary {
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
  position: relative;
  overflow: hidden;
  background: #fff;
  color: var(--red);
  z-index: 0;
  transition: color 320ms ease;
}
.cert-hero-inner .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--red-dark, #b5121f);
  transform: translateX(-101%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.cert-hero-inner .btn-primary:hover {
  color: #fff;
}
.cert-hero-inner .btn-primary:hover::before {
  transform: translateX(0);
}

/* CTA section button override (white bg → fill dark red) */
.cert-cta .btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 0;
  transition: color 320ms ease;
}
.cert-cta .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #7a0a0d;
  transform: translateX(-101%);
  transition: transform 320ms cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}
.cert-cta .btn-primary:hover::before {
  transform: translateX(0);
}
@media (max-width: 768px) {
  .cert-hero-inner {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
  .cert-hero-label,
  .cert-hero-title,
  .cert-hero-sub,
  .cert-hero-inner .btn-primary {
    grid-column: 1;
    grid-row: auto;
  }
  .cert-hero-title { margin-bottom: 1.25rem; }
}

/* Generic section */
.cert-section {
  padding: 3.5rem 0;
}
.cert-section-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: 0.875rem;
}
.cert-section-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0;
}

/* Two-col layout for "What It Covers" */
.cert-two-col {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .cert-two-col { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* ISO logo below the section title in left col */
.cert-two-col > div:first-child::after {
  content: '';
  display: block;
  margin-top: 2.5rem;
  width: 120px;
  height: 120px;
  background: url('./ISO_Logo_(Red_square).png') center / contain no-repeat;
}
@media (max-width: 768px) {
  .cert-two-col > div:first-child::after { display: none; }
}
.cert-two-col--halal > div:first-child::after {
  background-image: url('./halal-certification.avif');
}
.cert-two-col--haccp > div:first-child::after {
  width: 220px;
  height: 220px;
}
.cert-two-col--brc > div:first-child::after,
.cert-two-col--fssc > div:first-child::after,
.cert-two-col--sqf > div:first-child::after,
.cert-two-col--gmp > div:first-child::after {
  width: 340px;
  height: 340px;
}
.cert-two-col--brc > div:first-child::after {
  background-image: url('./brc-food-certificated.png');
}
.cert-two-col--fssc > div:first-child::after {
  background-image: url('./fssc.webp');
}
.cert-two-col--haccp > div:first-child::after {
  background-image: url('./green-haccp-certified-.avif');
}
.cert-two-col--sqf > div:first-child::after {
  background-image: url('./logo-SQF.jpeg');
}
.cert-two-col--gmp > div:first-child::after {
  background-image: url('./gmp-certified-.webp');
}

/* Covers list */
.cert-covers-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cert-covers-list li {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.7;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--mid-gray);
}
.cert-covers-list li:first-child { border-top: 1px solid var(--mid-gray); }
.cert-covers-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

/* Why It Matters grid */
.cert-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--mid-gray);
  border: 1px solid var(--mid-gray);
}
@media (max-width: 900px) {
  .cert-why-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .cert-why-grid { grid-template-columns: 1fr; }
}
.cert-why-item {
  background: var(--off-white);
  padding: 1.75rem 1.5rem;
  transition: background 220ms ease, transform 220ms ease, box-shadow 220ms ease;
  cursor: default;
}
.cert-why-item:hover {
  background: var(--white);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.07);
}
.cert-why-item:hover .cert-why-num {
  color: var(--red);
  transition: color 220ms ease;
}
.cert-why-num {
  font-size: 2rem;
  font-weight: 500;
  color: var(--mid-gray);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 1rem;
  transition: color 220ms ease;
}
.cert-why-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.625rem;
  line-height: 1.3;
}
.cert-why-body {
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.65;
}

.cert-journey-tagline {
  font-size: 0.9375rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 3rem;
  max-width: 58ch;
}

/* 5-Step Journey */
.cert-journey {
  position: relative;
}
.cert-journey-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  position: relative;
}
@media (max-width: 900px) {
  .cert-journey-steps {
    grid-template-columns: 1fr;
  }
}
/* Horizontal connector line (desktop) */
.cert-journey-steps::before {
  content: '';
  position: absolute;
  top: 20px;
  left: calc(20px + 2.5rem);
  right: calc(20px + 2.5rem);
  height: 2px;
  background: var(--mid-gray);
  z-index: 0;
}
@media (max-width: 900px) {
  .cert-journey-steps::before {
    top: calc(20px + 1rem);
    left: 20px;
    right: auto;
    width: 2px;
    height: calc(100% - 40px - 2rem);
  }
}

.cert-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 1.25rem;
  position: relative;
  z-index: 1;
  transition: transform 220ms ease;
  cursor: default;
}
.cert-step:hover {
  transform: translateY(-4px);
}
.cert-step:hover .cert-step-circle {
  background: var(--red-dark, #b5121f);
  box-shadow: 0 4px 14px rgba(237,28,36,0.35);
  transform: scale(1.1);
}
.cert-step:hover .cert-step-title {
  color: var(--red);
}
@media (max-width: 900px) {
  .cert-step {
    flex-direction: row;
    text-align: left;
    align-items: flex-start;
    padding: 0 0 2.5rem 0;
    gap: 1.25rem;
  }
}

.cert-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
  transition: background 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}
@media (max-width: 900px) {
  .cert-step-circle { margin-bottom: 0; }
}

.cert-step-content { flex: 1; }
.cert-step-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  transition: color 220ms ease;
}
.cert-step-body {
  font-size: 0.8125rem;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.6;
}

/* Track Record */
.cert-track-record {
  background: var(--dark-surface);
  padding: 4rem 0;
}
.cert-stats-row {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
}
.cert-stat {
  flex: 1;
  min-width: 140px;
  padding: 1.5rem 2rem;
  text-align: center;
}
.cert-stat-num {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  color: var(--white);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.cert-stat-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
}
.cert-stat-divider {
  width: 1px;
  height: 3rem;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.cert-stat-industries {
  flex: 1.5;
  min-width: 200px;
  padding: 1.5rem 2rem;
}
.cert-stat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.cert-stat-tags span {
  font-size: 0.6875rem;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.08);
  padding: 0.25rem 0.625rem;
  border-radius: 2px;
}

/* CTA */
.cert-cta {
  background: var(--red);
  padding: 5rem 0;
  text-align: center;
}
.cert-cta-title {
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.03em;
  margin-bottom: 0.875rem;
}
.cert-cta-sub {
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.8);
  margin-bottom: 2.5rem;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* ─── Cert detail — phone optimisations ────────────────────────────── */
@media (max-width: 768px) {
  .cert-hero { padding: 2.5rem 0 2rem; }
  .cert-section { padding: 2.5rem 0; }
  .cert-cta { padding: 3rem 0; }
  .cert-cta-sub { margin-bottom: 1.75rem; }
}
@media (max-width: 480px) {
  /* Stats row: let items stack */
  .cert-stats-row { flex-direction: column; align-items: stretch; }
  .cert-stat { min-width: 0; padding: 1rem 1.25rem; text-align: left; }
  .cert-stat-industries { min-width: 0; padding: 1rem 1.25rem; }
  .cert-stat-divider { display: none; }
  /* Journey steps connector line: hide on very small phones */
  .cert-journey-steps::before { display: none; }
}
