/* ==========================================================================
   HOW IT WORKS SECTION
   Clean, Apple-inspired 4-step store operations lifecycle.
   ========================================================================== */
.hiw-section {
  padding: 104px 0 112px;
  background: radial-gradient(circle at 50% -20%, rgba(37, 99, 235, 0.08) 0%, rgba(245, 246, 249, 0) 65%), #f5f6f9;
  color: #0b0b0c;
  position: relative;
  overflow: hidden;
}

.hiw-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--gutter, 24px);
}

.hiw-head {
  max-width: 820px;
  margin: 0 auto 52px;
  text-align: center;
}

.hiw-label {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: #2563eb;
  margin-bottom: 16px;
}

.hiw-label::before,
.hiw-label::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background: #2563eb;
  opacity: 0.45;
}

.hiw-title {
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.04em;
  color: #0b0b0c;
  margin: 0;
}

.hiw-title .serif {
  font-family: var(--serif, 'Instrument Serif', Georgia, serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.02em;
}

.hiw-sub {
  margin: 18px auto 0;
  max-width: 660px;
  font-size: 19px;
  line-height: 1.55;
  color: #4a4f57;
}

/* Progress rail (desktop only) */
.hiw-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 22px;
  align-items: center;
}

.hiw-rail-step {
  display: flex;
  align-items: center;
  width: 100%;
}

.hiw-rail-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #e3e6ec;
  background: #ffffff;
  color: #7b8190;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease;
  z-index: 2;
}

.hiw-rail-node.active {
  background: #0b0b0c;
  border-color: #0b0b0c;
  color: #ffffff;
}

.hiw-rail-line {
  flex-grow: 1;
  height: 2px;
  background: #e3e6ec;
  position: relative;
  margin-left: 12px;
  border-radius: 2px;
  overflow: hidden;
}

.hiw-rail-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #2563eb;
  border-radius: 2px;
  transition: width 0.45s ease-out;
}

/* 4-card Grid */
.hiw-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  align-items: stretch;
}

.hiw-card {
  background: #ffffff;
  border: 1px solid #e3e6ec;
  border-radius: 26px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.02);
  min-height: 520px;
}

/* Featured dark card (Step 3) */
.hiw-card-dark {
  background: #0b0b0c;
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.14), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hiw-card-badge {
  display: none; /* hidden on desktop, visible on tablet/mobile */
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0b0b0c;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.hiw-card-dark .hiw-card-badge {
  background: #2563eb;
  color: #ffffff;
}

.hiw-card-head {
  margin-bottom: 20px;
}

.hiw-card-title {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -.03em;
  color: #0b0b0c;
  margin: 0 0 10px;
  line-height: 1.2;
}

.hiw-card-dark .hiw-card-title {
  color: #ffffff;
}

.hiw-card-desc {
  font-size: 15px;
  line-height: 1.55;
  color: #4a4f57;
  margin: 0 0 8px;
}

.hiw-card-dark .hiw-card-desc {
  color: #d1d5db;
}

.hiw-card-desc strong,
.hiw-card-desc b {
  font-weight: 600;
  color: #0b0b0c;
}

.hiw-card-dark .hiw-card-desc strong,
.hiw-card-dark .hiw-card-desc b {
  color: #ffffff;
}

/* Illustration Box */
.hiw-screen {
  height: 262px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f3f7fd 0%, #e8f0fe 100%);
  border: 1px solid #dce6f5;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-top: auto;
  box-sizing: border-box;
  overflow: hidden;
}

.hiw-screen-takeover {
  justify-content: flex-start;
  gap: 10px;
}

.hiw-card-dark .hiw-screen {
  background: #14161c;
  border-color: rgba(255, 255, 255, 0.08);
}

.hiw-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hiw-screen-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -.01em;
}

.hiw-card-dark .hiw-screen-title {
  color: #ffffff;
}

/* Chips */
.hiw-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.hiw-chip-green {
  background: #eaf7ee;
  color: #16a34a;
}

.hiw-chip-amber {
  background: #fdf0d9;
  color: #b45309;
}

.hiw-chip-red {
  background: #fde8e6;
  color: #b42318;
}

.hiw-chip-blue {
  background: #e0edff;
  color: #2563eb;
}

/* Screen 1 Rows */
.hiw-audit-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.hiw-audit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

/* Screen 2 Tabs & Switch */
.hiw-switch-bar {
  display: flex;
  background: #dce3ee;
  padding: 3px;
  border-radius: 999px;
  gap: 3px;
  margin-bottom: 12px;
}

.hiw-switch-tab {
  flex: 1;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
  text-align: center;
}

.hiw-switch-tab.active {
  background: #ffffff;
  color: #0b0b0c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.hiw-switch-tab:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.hiw-check-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hiw-check-rows[hidden] {
  display: none !important;
}

.hiw-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.hiw-tick-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eaf7ee;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hiw-tick-circle svg {
  stroke: #16a34a;
}

/* Screen 3 Rows (Dark) */
.hiw-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
}

.hiw-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  animation: hiwPulse 2s infinite ease-in-out;
}

@keyframes hiwPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.55;
  }
}

.hiw-dark-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hiw-dark-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: #1d212a;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 500;
  color: #e5e7eb;
}

.hiw-dark-icon {
  width: 16px;
  height: 16px;
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Screen 4 Chart & Pills */
.hiw-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 120px;
  padding: 10px 14px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  gap: 18px;
}

.hiw-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  flex: 1;
}

.hiw-chart-bar {
  width: 100%;
  max-width: 42px;
  border-radius: 6px 6px 0 0;
  transition: height 0.3s ease;
}

.hiw-bar-sales {
  height: 88%;
  background: #2563eb;
}

.hiw-bar-costs {
  height: 54%;
  background: #94a3b8;
}

.hiw-bar-profit {
  height: 34%;
  background: #16a34a;
}

.hiw-chart-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}

.hiw-chart-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
}

.hiw-report-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hiw-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
}

/* Small note under cards */
.hiw-disclaimer {
  text-align: center;
  font-size: 13.5px;
  color: #7b8190;
  margin: 30px auto 44px;
}

/* Call-to-Action Panel */
.hiw-cta {
  background: radial-gradient(circle at 92% 12%, rgba(37, 99, 235, 0.32) 0%, rgba(11, 11, 12, 0) 65%), #0b0b0c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  padding: clamp(32px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

.hiw-cta-copy {
  max-width: 660px;
}

.hiw-cta-title {
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.03em;
  color: #ffffff;
  margin: 0 0 12px;
}

.hiw-cta-title .serif {
  font-family: var(--serif, 'Instrument Serif', Georgia, serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.015em;
}

.hiw-cta-text {
  font-size: 16px;
  line-height: 1.6;
  color: #9ca3af;
  margin: 0;
}

.hiw-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  min-width: 250px;
}

.hiw-btn-white {
  background: #ffffff !important;
  color: #0b0b0c !important;
  font-weight: 600;
  border: 1px solid #ffffff;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease !important;
}

.hiw-btn-white:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.25);
}

.hiw-btn-white:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

.hiw-btn-dark-line {
  background: transparent !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  transition: transform 0.25s ease, border-color 0.2s ease, background-color 0.2s ease !important;
}

.hiw-btn-dark-line:hover {
  transform: translateY(-1px);
  border-color: #ffffff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.hiw-btn-dark-line:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .hiw-rail {
    display: none;
  }
  .hiw-card-badge {
    display: inline-flex;
  }
  .hiw-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 760px) {
  .hiw-section {
    padding: 76px 0 84px;
  }
  .hiw-head {
    margin-bottom: 36px;
    text-align: left;
  }
  .hiw-title {
    font-size: 34px;
  }
  .hiw-sub {
    font-size: 16px;
    margin-top: 14px;
  }
  .hiw-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .hiw-card {
    min-height: auto;
    padding: 22px 18px 18px;
    border-radius: 22px;
  }
  .hiw-cta {
    flex-direction: column;
    align-items: stretch;
    padding: 30px 22px;
    border-radius: 24px;
  }
  .hiw-cta-actions {
    min-width: 100%;
    margin-top: 8px;
  }
  .hiw-cta-actions .btn {
    width: 100%;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hiw-rail-node,
  .hiw-rail-fill,
  .hiw-live-dot,
  .hiw-btn-white,
  .hiw-btn-dark-line {
    transition: none !important;
    animation: none !important;
  }
  .hiw-rail-node {
    background: #0b0b0c !important;
    border-color: #0b0b0c !important;
    color: #ffffff !important;
  }
  .hiw-rail-fill {
    width: 100% !important;
  }
}

