/**
 * Home Cooperation Steps Styling (همکاری با برکت چگونه آغاز می‌شود؟)
 * Pinned Scroll-Driven Horizontal Wave (Desktop) & Pinned Step-by-Step Card Deck (Mobile).
 * Theme: Barekat Food - Luxury Crimson & Gold Palette
 */

:root {
  --bk-crimson-deep: #4a0505;
  --bk-crimson-main: #7a0a0a;
  --bk-crimson-dark: #2a0303;
  --bk-gold-main: #e5a93c;
  --bk-gold-light: #ffd166;
  --bk-gold-pale: #ffe2ad;
  --bk-cream-bg: #dad4b5;
  --bk-card-bg: rgba(28, 3, 3, 0.82);
  --bk-card-border: rgba(229, 169, 60, 0.28);
  --bk-card-hover: rgba(229, 169, 60, 0.75);
  --bk-text-white: #ffffff;
  --bk-text-muted: rgba(255, 255, 255, 0.85);
  --bk-font-fa: 'iranyekan', 'IRANSans', system-ui, -apple-system, sans-serif;
}

/* 1. Pinned Scroll Track (Runway on desktop and mobile) */
.bk-coop-pinned-track {
  position: relative;
  width: 100%;
  height: 280vh; /* Pinned for ~2 screens of smooth scroll progression */
}

/* 2. Sticky Viewport (Locks in screen when reaching this section) */
.bk-coop-sticky-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #761014, #560a0e 55%, #360507);
  border-block: 1px solid #ffffff14;
  font-family: var(--bk-font-fa);
  overflow: hidden;
  direction: rtl;
  box-sizing: border-box;
  z-index: 5;
}

.bk-coop-sticky-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('../img/cooperation-pattern.svg') center / cover no-repeat;
  pointer-events: none;
}

/* 3. Container holding content */
.bk-coop-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1420px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

/* 4. Section Header (Centered & Distinct) */
.bk-coop-header {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bk-coop-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--bk-text-white);
  margin: 0 0 10px;
}

.bk-coop-title span {
  color: var(--bk-gold-light);
  position: relative;
  display: inline-block;
}

.bk-coop-title span::after {
  content: "";
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--bk-gold-main), transparent);
  border-radius: 2px;
}

.bk-coop-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--bk-text-muted);
  margin: 0;
}

/* Mobile Nav - Hidden on Desktop */
.bk-coop-mobile-nav {
  display: none;
}

/* 5. Timeline Wrap */
.bk-coop-timeline-wrap {
  position: relative;
  margin: 15px 0 25px;
  padding: 10px 0;
}

/* 6. SVG Wavy Path Canvas (Desktop) */
.bk-coop-wave-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.bk-coop-wave-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Faint background wave track */
.bk-wave-track {
  fill: none;
  stroke: rgba(229, 169, 60, 0.22);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 6 6;
}

/* Active glowing wave */
.bk-wave-progress {
  fill: none;
  stroke: url(#bkWaveGoldGrad);
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 7px rgba(229, 169, 60, 0.8));
  transition: stroke-dashoffset 0.1s linear;
}

/* Glowing runner head */
.bk-wave-runner {
  fill: #ffffff;
  stroke: var(--bk-gold-main);
  stroke-width: 3.5;
  filter: drop-shadow(0 0 10px #ffd166);
  transition: cx 0.1s linear, cy 0.1s linear;
}

/* 7. Steps Grid (Desktop 6 Columns: Right to Left) */
.bk-coop-steps-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
}

/* Step Item */
.bk-coop-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: center;
  position: relative;
}

/* Alternating wave elevation (Crest & Trough on Desktop) */
.bk-coop-step:nth-child(even) .bk-step-crest {
  margin-top: 24px;
}

.bk-coop-step:nth-child(odd) .bk-step-crest {
  margin-top: 0px;
}

.bk-step-crest {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 16px;
  transition: all 0.35s ease;
}

/* Step Number Badge */
.bk-step-num {
  font-size: 13px;
  font-weight: 800;
  color: var(--bk-gold-pale);
  background: rgba(30, 3, 3, 0.88);
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: 20px;
  padding: 2px 10px;
  margin-bottom: 8px;
  transition: all 0.3s ease;
  letter-spacing: 1px;
}

/* Icon Halo Circle */
.bk-step-icon-halo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(135, 12, 12, 0.95) 0%, rgba(55, 4, 4, 1) 100%);
  border: 3px solid rgba(229, 169, 60, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bk-step-svg {
  width: 50px;
  height: 50px;
  display: block;
  transition: transform 0.35s ease;
}

/* Card Container (Clean & Compact) */
.bk-step-card {
  width: 100%;
  background: var(--bk-card-bg);
  border: 1px solid var(--bk-card-border);
  border-radius: 18px;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  flex: 1;
}

.bk-step-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--bk-gold-pale);
  opacity: 0.85;
  margin-bottom: 5px;
}

.bk-step-heading {
  font-size: 15px;
  font-weight: 800;
  color: var(--bk-text-white);
  margin: 0 0 6px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.bk-step-desc {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--bk-text-muted);
  margin: 0;
  flex: 1;
}

/* 8. Active & Passed State Styles */
.bk-coop-step.is-active .bk-step-icon-halo {
  border-color: var(--bk-gold-light);
  background: radial-gradient(circle, rgba(165, 18, 18, 0.98) 0%, rgba(75, 6, 6, 1) 100%);
  transform: scale(1.14) translateY(-6px);
  box-shadow: 
    0 0 0 4px rgba(229, 169, 60, 0.35),
    0 0 25px rgba(229, 169, 60, 0.65),
    0 14px 32px rgba(0, 0, 0, 0.55);
}

.bk-coop-step.is-active .bk-step-num {
  background: var(--bk-gold-main);
  color: #3b0303;
  border-color: var(--bk-gold-light);
  transform: scale(1.08);
}

.bk-coop-step.is-active .bk-step-card {
  border-color: var(--bk-gold-main);
  background: rgba(45, 5, 5, 0.92);
  transform: translateY(-4px);
  box-shadow: 
    0 16px 36px rgba(0, 0, 0, 0.45),
    inset 0 0 20px rgba(229, 169, 60, 0.12);
}

.bk-coop-step.is-active .bk-step-heading {
  color: var(--bk-gold-light);
}

.bk-coop-step.is-active .bk-step-desc {
  color: #ffffff;
}

.bk-coop-step.is-passed .bk-step-icon-halo {
  border-color: var(--bk-gold-main);
  box-shadow: 0 0 14px rgba(229, 169, 60, 0.35);
}

.bk-coop-step.is-passed .bk-step-num {
  border-color: var(--bk-gold-main);
  color: var(--bk-gold-light);
}

.bk-coop-step:hover:not(.is-active) {
  transform: translateY(-4px);
}

.bk-coop-step:hover:not(.is-active) .bk-step-icon-halo {
  border-color: var(--bk-gold-pale);
  transform: scale(1.06);
}

/* 9. Action Footer Banner */
.bk-coop-cta-banner {
  margin-top: 25px;
  padding: 18px 30px;
  background: rgba(25, 2, 2, 0.72);
  border: 1px solid rgba(229, 169, 60, 0.35);
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  position: relative;
  z-index: 2;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.bk-coop-cta-text {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.bk-coop-cta-icon {
  width: 36px;
  height: 36px;
  color: var(--bk-gold-main);
  flex-shrink: 0;
}

.bk-coop-cta-text strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--bk-text-white);
  margin-bottom: 3px;
}

.bk-coop-cta-text span {
  font-size: 13px;
  color: var(--bk-text-muted);
}

.bk-coop-cta-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.bk-coop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 30px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
}

.bk-coop-btn-primary {
  background: linear-gradient(135deg, var(--bk-gold-main), #f29f05);
  color: #2b0202;
  box-shadow: 0 6px 18px rgba(229, 169, 60, 0.4);
}

.bk-coop-btn-primary:hover {
  background: linear-gradient(135deg, #ffd166, var(--bk-gold-main));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(229, 169, 60, 0.6);
  color: #1a0101;
}

.bk-coop-btn-outline {
  background: transparent;
  color: var(--bk-gold-pale);
  border: 1px solid rgba(229, 169, 60, 0.45);
}

.bk-coop-btn-outline:hover {
  background: rgba(229, 169, 60, 0.15);
  border-color: var(--bk-gold-main);
  color: #ffffff;
  transform: translateY(-2px);
}

.bk-coop-btn-outline svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.bk-coop-btn-outline:hover svg {
  transform: translateX(-4px);
}

/* 10. Responsive Breakpoints */

/* Medium Desktops & Tablets (769px to 1200px) */
@media (max-width: 1200px) {
  .bk-coop-title {
    font-size: 28px;
  }
  .bk-step-icon-halo {
    width: 66px;
    height: 66px;
  }
  .bk-step-svg {
    width: 44px;
    height: 44px;
  }
  .bk-step-heading {
    font-size: 14px;
  }
  .bk-step-desc {
    font-size: 11.5px;
  }
}

/* Mobile Devices (<= 768px): PINNED SCROLL-DRIVEN STEP DECK */
@media (max-width: 768px) {
  .bk-coop-pinned-track {
    height: 320vh; /* Pinned runway on mobile for step-by-step scroll */
  }

  .bk-coop-sticky-viewport {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    padding: 16px 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .bk-coop-container {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
  }

  .bk-coop-header {
    margin-bottom: 10px;
    text-align: center;
  }

  .bk-coop-title {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1.35;
  }

  .bk-coop-lead {
    font-size: 12px;
    line-height: 1.5;
    margin: 0 auto;
  }

  /* Hide Desktop Horizontal Wave */
  .bk-coop-wave-canvas {
    display: none;
  }

  /* Show Mobile Step Progress Indicator */
  .bk-coop-mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 380px;
    margin: 0 auto 14px;
    position: relative;
    z-index: 3;
  }

  .bk-mobile-nav-line {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(229, 169, 60, 0.2);
  }

  .bk-mobile-nav-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f29f05, #e5a93c, #ffd166);
    border-radius: 4px;
    transition: width 0.25s ease-out;
    box-shadow: 0 0 10px rgba(229, 169, 60, 0.8);
  }

  .bk-mobile-nav-dots {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .bk-mobile-dot {
    background: rgba(35, 4, 4, 0.9);
    border: 1.5px solid rgba(229, 169, 60, 0.35);
    color: var(--bk-gold-pale);
    font-size: 11.5px;
    font-weight: 800;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
    font-family: inherit;
  }

  .bk-mobile-dot.is-active {
    background: var(--bk-gold-main);
    color: #2b0202;
    border-color: #ffffff;
    transform: scale(1.15);
    box-shadow: 0 0 14px rgba(229, 169, 60, 0.8);
  }

  .bk-mobile-dot.is-passed {
    border-color: var(--bk-gold-main);
    color: var(--bk-gold-light);
  }

  .bk-mobile-step-status {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--bk-gold-light);
    letter-spacing: 0.2px;
  }

  /* Steps Stack Container on Mobile */
  .bk-coop-timeline-wrap {
    margin: 0;
    padding: 0;
  }

  .bk-coop-steps-grid {
    position: relative;
    width: 100%;
    max-width: 380px;
    height: 250px;
    margin: 0 auto;
    display: block;
  }

  /* Each Step Card Slides/Fades in during Pinned Scroll */
  .bk-coop-step {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .bk-coop-step.is-active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    z-index: 3;
  }

  .bk-coop-step.is-passed {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
    pointer-events: none;
    z-index: 1;
  }

  .bk-coop-step:nth-child(even) .bk-step-crest,
  .bk-coop-step:nth-child(odd) .bk-step-crest {
    margin-top: 0;
  }

  .bk-step-crest {
    margin-bottom: 12px;
  }

  .bk-step-num {
    display: none; /* Already indicated in top mobile nav */
  }

  .bk-step-icon-halo {
    width: 74px;
    height: 74px;
  }

  .bk-step-svg {
    width: 48px;
    height: 48px;
  }

  .bk-step-card {
    width: 100%;
    padding: 16px 18px 14px;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  }

  .bk-step-tag {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .bk-step-heading {
    font-size: 16px;
    margin-bottom: 6px;
  }

  .bk-step-desc {
    font-size: 13px;
    line-height: 1.6;
  }

  /* Compact Footer CTA on Mobile */
  .bk-coop-cta-banner {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 20px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .bk-coop-cta-text {
    display: none; /* Hide lengthy text in 100vh pinned viewport */
  }

  .bk-coop-cta-actions {
    flex-direction: row;
    width: 100%;
    gap: 8px;
  }

  .bk-coop-btn {
    flex: 1;
    justify-content: center;
    padding: 9px 12px;
    font-size: 12px;
  }
}
