/* ===============================================
   TRACKING AMACHAINS - MODERN DESIGN SYSTEM
   Palette: Teal + Green (from logos) + Indigo (from product)
   =============================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ===============================================
   CSS VARIABLES
   =============================================== */
:root {
  /* Brand colors - derived from Tracking Amachains + TexBi logos */
  --teal: #2a9d8f;
  --teal-dark: #1f7a6e;
  --teal-light: #5ec4b6;
  --green: #7cb342;
  --green-dark: #5a8a2a;
  --green-light: #a4d65e;

  /* Accent - from jeans product */
  --indigo: #2c3e6b;
  --indigo-light: #3d5a99;

  /* Carbon type colors */
  --biogenic: #2a9d8f;
  --fossil: #4a5568;
  --landuse: #b07d3b;

  /* Neutrals */
  --gray-50: #f8fafb;
  --gray-100: #f0f4f5;
  --gray-200: #e2e8ea;
  --gray-300: #cbd5d8;
  --gray-400: #94a3ab;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --white: #ffffff;
  --bg: #f8fafb;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;
}

/* ===============================================
   RESET & BASE
   =============================================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--teal-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  border: none;
  transition: all 0.2s ease;
}

/* ===============================================
   LAYOUT
   =============================================== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===============================================
   HEADER / HERO (Homepage)
   =============================================== */
.header-section {
  background: linear-gradient(160deg, var(--gray-900) 0%, var(--indigo) 50%, var(--teal-dark) 100%);
  color: var(--white);
  text-align: center;
  padding: 80px 24px 72px;
  position: relative;
  overflow: hidden;
}

.header-section::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(42,157,143,0.15), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.header-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124,179,66,0.1), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.header-section h1 {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--white);
  position: relative;
  z-index: 1;
  letter-spacing: -0.5px;
}

.header-section p {
  font-size: 17px;
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
  font-weight: 300;
  position: relative;
  z-index: 1;
}

.header-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.2s;
  color: rgba(255,255,255,0.9);
}

.info-badge:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.info-badge i {
  font-size: 14px;
  color: var(--teal-light);
}

/* ===============================================
   METRICS
   =============================================== */
.metrics-section {
  padding: 56px 24px;
  background: var(--white);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.metric-card {
  text-align: center;
  padding: 28px 16px;
  background: var(--gray-50);
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal-light);
}

.metric-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  color: var(--white);
  border-radius: var(--r-md);
  font-size: 20px;
}

.metric-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray-900);
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 500;
}

/* ===============================================
   ABOUT / ACCORDION SECTION
   =============================================== */
.about-section {
  padding: 64px 24px;
  background: var(--gray-50);
}

/* ===============================================
   PRODUCTS
   =============================================== */
.products-section {
  padding: 64px 24px;
  background: var(--white);
}

.section-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--gray-500);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

/* ===============================================
   BACK BUTTON
   =============================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--white);
  color: var(--gray-700);
  border-radius: var(--r-md);
  font-size: 16px;
  margin: 16px 0 8px 0;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.back-btn:hover {
  box-shadow: var(--shadow-md);
  color: var(--teal);
  border-color: var(--teal);
}

/* ===============================================
   PRODUCT GRID
   =============================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.product-card {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all 0.25s;
  position: relative;
}

.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  border-color: var(--gray-300);
}

.product-card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.product-card-content {
  padding: 24px;
}

.product-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.product-card-title {
  font-size: 20px;
  color: var(--gray-900);
  margin-bottom: 8px;
  font-family: 'Space Grotesk', sans-serif;
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--teal);
  color: var(--white);
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qr-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--white);
  padding: 8px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  font-size: 16px;
  color: var(--gray-500);
}

.co2-display {
  text-align: center;
  margin: 20px 0;
}

.co2-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--teal-dark);
  font-family: 'Space Grotesk', sans-serif;
}

.co2-label {
  font-size: 12px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
  font-weight: 500;
}

/* ===============================================
   CARBON BAR (MINI)
   =============================================== */
.carbon-bar-mini {
  display: flex;
  height: 8px;
  border-radius: var(--r-full);
  overflow: hidden;
  margin: 16px 0;
  background: var(--gray-100);
}

.carbon-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: var(--white);
  font-weight: 600;
  transition: all 0.2s;
}

.carbon-segment span {
  display: none;
}

.biogenic-segment { background: var(--biogenic); }
.fossil-segment { background: var(--fossil); }
.landuse-segment { background: var(--landuse); }

.view-details-btn {
  width: 100%;
  padding: 12px 24px;
  background: var(--gray-900);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r-md);
  margin-top: 16px;
  letter-spacing: 0.3px;
}

.view-details-btn:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===============================================
   HERO (Product Detail)
   =============================================== */
.hero-section {
  padding: 16px 0 32px;
  text-align: center;
}

.product-code {
  display: inline-block;
  padding: 4px 12px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--r-full);
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  font-family: 'Space Grotesk', sans-serif;
}

.hero-title {
  font-size: 32px;
  margin-bottom: 8px;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.hero-image {
  max-width: 480px;
  margin: 24px auto;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

/* ===============================================
   CARBON SUMMARY
   =============================================== */
.carbon-summary {
  background: var(--white);
  padding: 40px 24px;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  margin: 32px 0;
  text-align: center;
}

.carbon-summary h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
}

.total-co2 {
  font-size: 56px;
  font-weight: 700;
  color: var(--gray-900);
  font-family: 'Space Grotesk', sans-serif;
  margin: 8px 0 4px;
  letter-spacing: -1px;
}

.total-co2::after {
  display: none;
}

.carbon-bar-large {
  display: flex;
  height: 12px;
  border-radius: var(--r-full);
  overflow: hidden;
  margin: 28px auto;
  max-width: 500px;
  background: var(--gray-100);
}

.carbon-bar-large .carbon-segment {
  font-size: 0;
  transition: all 0.2s;
  position: relative;
}

.carbon-bar-large .carbon-segment:hover {
  filter: brightness(1.1);
}

.segment-value, .segment-percent {
  display: none;
}

.carbon-legend {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ===============================================
   CARBON CARDS
   =============================================== */
.carbon-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 32px 0;
}

.carbon-card {
  background: var(--white);
  padding: 24px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  text-align: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.carbon-card::before {
  display: none;
}

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

.carbon-card-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  font-size: 20px;
}

.biogenic-card .carbon-card-icon {
  background: rgba(42,157,143,0.1);
  color: var(--teal);
}

.fossil-card .carbon-card-icon {
  background: rgba(74,85,104,0.1);
  color: var(--fossil);
}

.landuse-card .carbon-card-icon {
  background: rgba(176,125,59,0.1);
  color: var(--landuse);
}

.carbon-card h3 {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: 'Inter', sans-serif;
}

.carbon-card-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  font-family: 'Space Grotesk', sans-serif;
  margin: 8px 0;
}

.carbon-card-description {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* ===============================================
   PRODUCTION JOURNEY
   =============================================== */
.journey-section {
  margin: 64px 0;
}

.section-title {
  font-size: 28px;
  text-align: center;
  margin-bottom: 48px;
  color: var(--gray-900);
  letter-spacing: -0.3px;
}

.timeline {
  position: relative;
  padding-left: 48px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.timeline-stage {
  position: relative;
  background: var(--white);
  padding: 24px;
  border-radius: var(--r-lg);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
  transition: all 0.2s;
}

.timeline-stage:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.timeline-stage::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 28px;
  width: 10px;
  height: 10px;
  background: var(--teal);
  border: 3px solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--teal);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}

.stage-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 10px;
  color: var(--teal);
  background: rgba(42,157,143,0.08);
  border-radius: var(--r-md);
}

.stage-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
  font-family: 'Space Grotesk', sans-serif;
}

.stage-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
}

.stage-location i {
  color: var(--teal);
  font-size: 11px;
}

.stage-carbon {
  display: inline-block;
  padding: 6px 14px;
  background: var(--gray-900);
  color: var(--white);
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 13px;
  font-family: 'Space Grotesk', sans-serif;
}

.stage-materials {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

.stage-materials strong {
  color: var(--gray-800);
}

/* ===============================================
   MATERIAL COMPOSITION
   =============================================== */
.materials-section {
  margin: 64px 0;
  background: var(--white);
  padding: 40px;
  border-radius: var(--r-xl);
  border: 1px solid var(--gray-200);
}

.material-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
}

.material-bar {
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: var(--r-full);
  padding: 0 20px;
  color: var(--white);
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.material-bar::before { display: none; }

.material-bar:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.material-name { flex-grow: 1; }

.material-percentage {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
}

/* Material colors */
.material-cotton { background: var(--teal); }
.material-polyester { background: var(--gray-600); }
.material-denim { background: var(--indigo); }
.material-elastane { background: var(--gray-500); }
.material-teak { background: var(--landuse); }
.material-steel { background: var(--gray-600); }
.material-oil { background: var(--landuse); }
.material-bamboo { background: var(--teal); }
.material-foam { background: var(--gray-400); }

/* ===============================================
   FOOTER
   =============================================== */
.footer-section {
  background: var(--gray-900);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px 24px;
  margin-top: 0;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--white);
}

.footer-description {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
  color: rgba(255,255,255,0.5);
}

.footer-social {
  display: flex;
  gap: 8px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  transition: all 0.2s;
}

.footer-social a:hover {
  background: var(--teal);
  color: var(--white);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--white);
}

/* Product detail page footer */
.qr-code-container {
  margin: 24px 0;
}

.qr-code-placeholder {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.2);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: rgba(255,255,255,0.3);
}

.footer-content {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  margin: 12px 0;
}

/* ===============================================
   RESPONSIVE - TABLET
   =============================================== */
@media (max-width: 1024px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carbon-cards {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }
}

/* ===============================================
   RESPONSIVE - MOBILE
   =============================================== */
@media (max-width: 768px) {
  .header-section {
    padding: 56px 20px 48px;
  }

  .header-section h1 {
    font-size: 28px;
  }

  .header-section p {
    font-size: 15px;
  }

  .header-badges {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .metrics-section {
    padding: 40px 20px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .metric-card {
    padding: 20px 12px;
  }

  .metric-icon {
    width: 40px;
    height: 40px;
    font-size: 16px;
    margin-bottom: 8px;
  }

  .metric-value {
    font-size: 24px;
  }

  .metric-label {
    font-size: 11px;
  }

  .about-section {
    padding: 40px 20px;
  }

  .products-section {
    padding: 40px 20px;
  }

  .section-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .products-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-section {
    padding: 12px 0 20px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-image {
    max-width: 100%;
    border-radius: var(--r-md);
  }

  .carbon-summary {
    padding: 28px 16px;
    margin: 20px 0;
    border-radius: var(--r-lg);
  }

  .total-co2 {
    font-size: 40px;
  }

  .carbon-bar-large {
    max-width: 100%;
  }

  .carbon-legend {
    gap: 16px;
  }

  .legend-item {
    font-size: 12px;
  }

  .carbon-cards {
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin: 24px 0;
  }

  .carbon-card {
    padding: 20px 16px;
  }

  .carbon-card-value {
    font-size: 24px;
  }

  .timeline {
    padding-left: 32px;
  }

  .timeline::before {
    left: 8px;
  }

  .timeline-stage {
    padding: 20px 16px;
  }

  .timeline-stage::before {
    left: -32px;
    width: 8px;
    height: 8px;
  }

  .stage-header {
    flex-direction: column;
    gap: 8px;
  }

  .stage-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .stage-name {
    font-size: 15px;
  }

  .stage-carbon {
    font-size: 12px;
    padding: 5px 12px;
  }

  .materials-section {
    padding: 28px 20px;
    border-radius: var(--r-lg);
  }

  .material-bar {
    font-size: 12px;
    height: 38px;
    padding: 0 14px;
  }

  .material-percentage {
    font-size: 14px;
  }

  .section-title {
    font-size: 22px;
    margin-bottom: 28px;
  }

  .footer-section {
    padding: 36px 20px 16px;
  }
}

/* ===============================================
   ACCESSIBILITY
   =============================================== */
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
