/* Coffee walkthrough: visible stages, clear choices and a consistent forward action. */
body[data-page="coffee"] {
  --coffee-heading-size: clamp(1.75rem, 2.7vw, 2.125rem);
  --coffee-brand: #d8470c;
  --coffee-active: #23744b;
}

body[data-page="coffee"] .coffee-zone-label {
  color: var(--coffee-brand);
  font-size: clamp(1.5rem, 2.5vw, 2.125rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.2;
  margin-bottom: 20px;
}

body[data-page="coffee"] .builder-intro h2,
body[data-page="coffee"] .step-tabs button,
body[data-page="coffee"] .step-heading h3,
body[data-page="coffee"] .pouch-spec-card > h4 {
  font-family: inherit;
  font-size: var(--coffee-heading-size);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.15;
}

body[data-page="coffee"] .builder-intro h2,
body[data-page="coffee"] .step-heading h3,
body[data-page="coffee"] .pouch-spec-card > h4 {
  color: var(--coffee-brand);
}

body[data-page="coffee"] .step-tabs {
  gap: 12px;
  border: 0;
  margin-bottom: 32px;
}

body[data-page="coffee"] .step-tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 148px;
  padding: 16px 10px;
  text-align: center;
  color: var(--ink);
  background: #fffdf8;
  border: 2px solid #bacdbb;
  border-radius: 18px;
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}

body[data-page="coffee"] .step-tabs button:hover {
  border-color: var(--coffee-active);
  background: #f4f9ed;
}

body[data-page="coffee"] .step-tabs button[aria-selected="true"] {
  color: #17472e;
  border-color: var(--coffee-active);
  background: #edf8e9;
  box-shadow: inset 0 0 0 1px var(--coffee-active), 0 6px 14px #1c513014;
}

body[data-page="coffee"] .step-label {
  display: block;
  overflow-wrap: normal;
  max-width: 100%;
}

body[data-page="coffee"] .step-tabs button[aria-selected="true"] .step-label {
  transform: scale(1.025);
  transform-origin: center;
}

body[data-page="coffee"] .step-tabs .step-index,
body[data-page="coffee"] .step-heading > .stage-number {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  margin: 0;
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.02em;
  border: 3px solid #617563;
  border-radius: 50%;
  background: #fffef8;
  color: #294638;
}

body[data-page="coffee"] .step-tabs button[aria-selected="true"] .step-index,
body[data-page="coffee"] .step-panel:not([hidden]) .step-heading > .stage-number {
  color: #fff;
  background: var(--coffee-active);
  border-color: #174e32;
  animation: coffee-stage-glow 2.8s ease-in-out infinite;
}

body[data-page="coffee"] .step-heading {
  gap: 18px;
  align-items: flex-start;
}

body[data-page="coffee"] .step-heading p {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.6;
}

body[data-page="coffee"] .builder-main > .step-panel > h4,
body[data-page="coffee"] .slot-subheading {
  font-size: 23px;
  font-weight: 850;
  line-height: 1.25;
}

body[data-page="coffee"] .slot-subheading {
  margin: 24px 0 8px;
}

body[data-page="coffee"] .slot-introduction {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 24px;
}

body[data-page="coffee"] .shape-grid {
  gap: 12px;
  align-items: stretch;
}

body[data-page="coffee"] .shape-option {
  position: relative;
  min-width: 0;
  min-height: 180px;
  padding: 17px 10px 13px;
  border: 3px solid #bdcbbd;
  border-radius: 18px;
  background: #fffef9;
  gap: 9px;
}

body[data-page="coffee"] .shape-option strong {
  font-size: 17px;
  font-weight: 850;
  line-height: 1.25;
}

body[data-page="coffee"] .shape-option-visual {
  display: grid;
  place-items: center;
  width: min(100%, 110px);
  height: 138px;
  margin-inline: auto;
}

body[data-page="coffee"] .coffee-handoff-total {
  display: block;
  color: var(--coffee-brand);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -.035em;
}

body[data-page="coffee"] .coffee-handoff-sizes {
  list-style: none;
  margin: 18px 0;
  padding: 0;
}

body[data-page="coffee"] .coffee-handoff-sizes li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid #b7cbb3;
  font-size: 17px;
}

body[data-page="coffee"] .coffee-handoff-sizes b {
  text-align: right;
}

body[data-page="coffee"] .shape-option small {
  font-size: 12px;
}

body[data-page="coffee"] .shape-option::after {
  content: "✓ Selected";
  visibility: hidden;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
  color: #163e29;
}

body[data-page="coffee"] .shape-option[aria-pressed="true"] {
  border-color: #1f6543;
  background: #ecf6e8;
  box-shadow: inset 0 0 0 2px #1f6543;
}

body[data-page="coffee"] .shape-option[aria-pressed="true"]::after {
  visibility: visible;
}

body[data-page="coffee"] .shape-option[data-shape="stand"][aria-pressed="true"] {
  background: #fff0cb;
}

body[data-page="coffee"] .shape-option[data-shape="flat"][aria-pressed="true"] {
  background: #e8f1ff;
}

body[data-page="coffee"] .shape-option[data-shape="gusset"][aria-pressed="true"] {
  background: #f1e9ff;
}

body[data-page="coffee"] .choice-group label,
body[data-page="coffee"] .extras-field legend {
  font-size: 17px;
  font-weight: 800;
}

body[data-page="coffee"] .extra-choice {
  min-height: 76px;
  padding: 14px;
  border: 3px solid #bccabd;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 650;
  gap: 12px;
  background: #fffef9;
}

body[data-page="coffee"] .extra-choice input {
  width: 23px;
  height: 23px;
  min-width: 23px;
  min-height: 23px;
  accent-color: var(--coffee-active);
}

body[data-page="coffee"] .extra-choice small {
  font-size: 14px;
  margin-top: 5px;
}

body[data-page="coffee"] .extra-choice:has(input:checked) {
  border-color: #1f6543;
  box-shadow: inset 0 0 0 1px #1f6543;
  background: #eaf7e5;
}

body[data-page="coffee"] .extra-choice:has(input:checked)::after {
  content: "✓";
  margin-left: auto;
  font-size: 24px;
  font-weight: 900;
  color: #1f6543;
}

body[data-page="coffee"] .pouch-spec-card {
  border: 3px solid #c6c7b8;
  border-radius: 20px;
  padding: 24px;
  margin-top: 28px;
}

body[data-page="coffee"] .pouch-spec-card > h4 {
  margin-bottom: 22px;
}

body[data-page="coffee"] .step-actions {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

body[data-page="coffee"] .step-actions > .step-next {
  margin-left: auto;
}

body[data-page="coffee"] .step-next {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: 0 1 auto;
  min-height: 66px;
  max-width: 100%;
  padding: 16px 23px;
  font-family: inherit;
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -.025em;
  text-align: left;
  color: #fff;
  background: linear-gradient(115deg, #d8470c, #c83a08);
  border: 2px solid #b63308;
  border-radius: 16px;
  box-shadow: 0 6px 0 #9a2b0717, 0 8px 18px #a3471610;
}

body[data-page="coffee"] .step-next:hover {
  background: #bb3609;
  border-color: #972b08;
}

body[data-page="coffee"] .next-label {
  min-width: 0;
}

body[data-page="coffee"] .next-arrow {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1.35em;
  line-height: 1;
  animation: coffee-next-nudge 1.8s ease-in-out infinite;
}

body[data-page="coffee"] .joey-handoff #coffee-to-cards {
  margin-left: auto;
}

body[data-page="coffee"] #summary-pouch-visual:not([hidden]),
body[data-page="coffee"] #summary-pouch-image {
  width: 100%;
  margin: 12px auto 18px;
  padding: 14px;
  border: 3px solid #171b18;
  border-radius: 17px;
  background: #fffdf8;
}

body[data-page="coffee"] #summary-pouch-visual:not([hidden]) {
  display: grid;
  place-items: center;
  min-height: 220px;
}

body[data-page="coffee"] #summary-pouch-image {
  height: 220px;
  object-fit: contain;
  mix-blend-mode: normal;
}

body[data-page="coffee"] .summary-panel #spec-summary {
  font-size: 16px;
  line-height: 1.55;
}

body[data-page="coffee"] .step-panel,
body[data-page="coffee"] #builder {
  scroll-margin-top: calc(var(--whatsapp-access-height, 0px) + 115px);
}

body[data-page="coffee"] .coffee-error-summary {
  border: 4px solid #b42318;
  border-radius: 12px;
  padding: 20px;
  margin: 0 0 24px;
  background: #fff7f6;
  color: #75180f;
  scroll-margin-top: calc(var(--whatsapp-access-height, 0px) + 115px);
}

body[data-page="coffee"] .coffee-error-summary h3 {
  margin: 0 0 12px;
  color: #75180f;
  font-size: 1.4rem;
}

body[data-page="coffee"] .coffee-error-summary ul {
  margin: 0;
  padding-left: 24px;
}

body[data-page="coffee"] .coffee-error-summary a {
  color: #8a1c12;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body[data-page="coffee"] .coffee-error-summary:focus {
  outline: 3px solid #1f1d1a;
  outline-offset: 4px;
}

body[data-page="coffee"] .coffee-slot-choices.has-coffee-slot-error {
  border-left: 5px solid #b42318;
  padding-left: 12px;
}

body[data-page="coffee"] .coffee-inline-error {
  margin: 0 0 16px;
  color: #a41f15;
  font-size: 1.05rem;
  font-weight: 650;
}

body[data-page="coffee"] .coffee-error-icon {
  display: inline-flex;
  width: 1.4em;
  height: 1.4em;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

body[data-page="coffee"] #coffee-quantity-recovery,
body[data-page="coffee"] #mobile-size {
  scroll-margin-top: calc(var(--whatsapp-access-height, 0px) + 115px);
}

body[data-page="coffee"] .coffee-autosave-status {
  margin: 18px 0 14px;
  padding: 14px;
  border: 1px solid #d4ded7;
  border-radius: 10px;
  background: #f1f8f3;
  color: #234832;
  font-size: 0.95rem;
  line-height: 1.5;
}

@keyframes coffee-stage-glow {
  0%, 100% { box-shadow: 0 0 0 0 #23744b14; }
  50% { box-shadow: 0 0 0 7px #23744b24; }
}

@keyframes coffee-next-nudge {
  0%, 100% { transform: translateX(-2px); }
  55% { transform: translateX(4px); }
}

@media (max-width: 900px) {
  body[data-page="coffee"] .step-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-page="coffee"] .summary-panel {
    display: block;
  }

  body[data-page="coffee"] #summary-pouch-visual:not([hidden]),
  body[data-page="coffee"] #summary-pouch-image {
    max-width: 340px;
    min-height: 220px;
  }
}

@media (max-width: 640px) {
  body[data-page="coffee"] {
    --coffee-heading-size: 1.75rem;
  }

  body[data-page="coffee"] .coffee-zone-label {
    font-size: 1.5rem;
  }

  body[data-page="coffee"] .step-tabs {
    gap: 10px;
    margin-bottom: 26px;
  }

  body[data-page="coffee"] .step-tabs button {
    min-height: 152px;
    padding: 14px 8px;
  }

  body[data-page="coffee"] .step-tabs .step-index,
  body[data-page="coffee"] .step-heading > .stage-number {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    font-size: 28px;
  }

  body[data-page="coffee"] .step-heading {
    gap: 13px;
  }

  body[data-page="coffee"] .step-heading p {
    font-size: 15px;
  }

  body[data-page="coffee"] .shape-grid {
    gap: 7px;
  }

  body[data-page="coffee"] .shape-option {
    min-height: 168px;
    padding: 12px 5px;
  }

  body[data-page="coffee"] .shape-option strong {
    font-size: 14px;
  }

  body[data-page="coffee"] .shape-option small,
  body[data-page="coffee"] .shape-option::after {
    font-size: 11px;
  }

  body[data-page="coffee"] .pouch-spec-card {
    padding: 19px 15px;
  }

  body[data-page="coffee"] .step-actions .btn {
    flex: 0 1 auto;
    max-width: 100%;
  }

  body[data-page="coffee"] .step-actions .step-next,
  body[data-page="coffee"] .joey-handoff .step-next {
    min-height: 62px;
    padding: 15px 18px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="coffee"] .step-tabs button[aria-selected="true"] .step-index,
  body[data-page="coffee"] .step-panel:not([hidden]) .step-heading > .stage-number,
  body[data-page="coffee"] .next-arrow {
    animation: none;
  }

  body[data-page="coffee"] .step-tabs button {
    transition: none;
  }
}

/* Plan B 017: Coffee Zone hero correction. */
body[data-page="coffee"] .coffee-zone .zone-hero-grid{align-items:stretch}
body[data-page="coffee"] .coffee-zone .zone-hero-grid>div:first-child{display:flex;flex-direction:column;min-height:320px}
body[data-page="coffee"] .coffee-start-actions{margin-top:auto!important;padding-top:34px}
body[data-page="coffee"] .coffee-start-actions .btn{font-size:1.05rem}
