/* V38 — Coffee Detail and memory-only Visit Plan. */
.member-view-coffee-detail {
  min-width: 0;
  gap: 16px;
}

.member-view-coffee-detail h1,
.member-view-coffee-detail h2 {
  text-wrap: balance;
}

.member-view-coffee-detail p {
  text-wrap: pretty;
}

.coffee-detail-hero,
.coffee-menu-preview,
.coffee-match,
.coffee-visit-planner,
.coffee-plan-confirmation,
.coffee-empty {
  overflow: hidden;
  border: 1px solid rgb(49 31 25 / 10%);
  border-radius: 22px;
  background: #fffaf2;
}

.coffee-detail-hero picture,
.coffee-detail-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.coffee-detail-hero picture {
  overflow: hidden;
  background: #dfd6c9;
}

.coffee-detail-hero img {
  object-fit: cover;
}

.coffee-detail-copy {
  position: relative;
  padding: 18px;
  background: #2b1c18;
  color: #fffaf2;
}

.coffee-detail-copy .eyebrow {
  margin: 0 0 5px;
  color: #f1a071;
}

.coffee-detail-copy h2 {
  max-width: 14ch;
  margin: 0;
  color: #fffaf2;
  font-size: clamp(1.875rem, 8vw, 2.125rem);
  line-height: 1.02;
}

.coffee-detail-copy > p:last-child {
  max-width: 34ch;
  margin: 9px 0 0;
  color: #e6d8ce;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.coffee-demo-label {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 5px 8px;
  border: 1px solid rgb(255 250 242 / 28%);
  border-radius: 999px;
  color: #fffaf2;
  font-size: 0.6875rem;
  font-weight: 750;
}

.coffee-menu-preview,
.coffee-match,
.coffee-visit-planner {
  padding: 18px;
}

.coffee-match {
  position: relative;
  container: coffee-match / inline-size;
  background: #2b1c18;
  color: #fffaf2;
}

.coffee-match::after {
  position: absolute;
  right: -18px;
  bottom: -25px;
  width: 108px;
  height: 108px;
  border: 1px solid rgb(241 160 113 / 22%);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgb(241 160 113 / 6%), 0 0 0 36px rgb(241 160 113 / 4%);
  content: "";
  pointer-events: none;
}

.coffee-match > * {
  position: relative;
  z-index: 1;
}

.coffee-match-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: start;
  gap: 12px;
}

.coffee-match-heading .eyebrow {
  margin: 0 0 5px;
  color: #f1a071;
}

.coffee-match-heading h2 {
  max-width: 19ch;
  margin: 0;
  color: #fffaf2;
  font-size: clamp(1.35rem, 5.8vw, 1.6rem);
  line-height: 1.08;
}

.coffee-match-heading > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgb(241 160 113 / 32%);
  border-radius: 14px;
  color: #f1a071;
  font-size: 1.2rem;
}

.coffee-match .coffee-match-intro,
.coffee-match .coffee-match-disclosure,
.coffee-match .coffee-match-status,
.coffee-match .coffee-match-error {
  color: #d9cbc1;
  font-size: 0.75rem;
  line-height: 1.5;
}

.coffee-match-intro {
  max-width: 39ch;
  margin: 13px 0 17px;
}

.coffee-match fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.coffee-match fieldset + fieldset {
  margin-top: 18px;
}

.coffee-match legend {
  margin-bottom: 9px;
  color: #fffaf2;
  font-size: 0.8125rem;
  font-weight: 750;
}

.coffee-match-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.coffee-match-options-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.coffee-match-options label {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 74px;
  cursor: pointer;
}

.coffee-match-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.coffee-match-options label > span {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 5px;
  padding: 11px 9px;
  border: 1px solid rgb(255 250 242 / 18%);
  border-radius: 14px;
  background: rgb(255 250 242 / 6%);
}

.coffee-match-options strong,
.coffee-match-options small {
  overflow-wrap: anywhere;
}

.coffee-match-options strong {
  color: #fffaf2;
  font-size: 0.75rem;
  line-height: 1.25;
}

.coffee-match-options small {
  color: #cfc0b6;
  font-size: 0.65rem;
  line-height: 1.35;
}

.coffee-match-options input:checked + span {
  border-color: #f1a071;
  background: #5a2d20;
  box-shadow: inset 0 0 0 1px #f1a071;
}

.coffee-match-options input:focus-visible + span {
  outline: 3px solid #fffaf2;
  outline-offset: 3px;
}

.coffee-match form > .button {
  min-height: 48px;
  margin-top: 18px;
  border-color: #f1a071;
  background: #f1a071;
  color: #2b1c18;
}

.coffee-match form > .button:disabled {
  border-color: #62524b;
  background: #62524b;
  color: #cfc0b6;
  cursor: not-allowed;
}

.coffee-match-result {
  display: grid;
  min-width: 0;
  margin-top: 17px;
  padding: 16px;
  border: 1px solid rgb(241 160 113 / 34%);
  border-radius: 18px;
  background: #fffaf2;
  color: #2b1c18;
}

.coffee-match-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #78381f;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
}

.coffee-match-result-top small {
  padding: 4px 7px;
  border: 1px solid rgb(43 28 24 / 16%);
  border-radius: 999px;
  font-size: 0.625rem;
  text-transform: none;
}

.coffee-match-result > p:first-of-type {
  margin: 17px 0 4px;
  color: #795f54;
  font-size: 0.75rem;
}

.coffee-match-result h3 {
  margin: 0;
  color: #2b1c18;
  font-size: clamp(1.55rem, 6.6vw, 1.85rem);
  line-height: 1.04;
  text-wrap: balance;
}

#coffee-match-result-title:focus-visible {
  outline: none;
  text-decoration: underline 2px #a84725;
  text-underline-offset: 5px;
}

.coffee-match-result > strong {
  margin-top: 7px;
  color: #a84725;
  font-size: 0.875rem;
}

.coffee-match-result > strong small {
  color: #76665f;
  font-size: 0.6875rem;
  font-weight: 550;
}

.coffee-match-result > p:last-of-type {
  margin: 13px 0 0;
  color: #665751;
  font-size: 0.75rem;
  line-height: 1.5;
}

.coffee-match-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgb(43 28 24 / 12%);
}

.coffee-match-route > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.coffee-match-route small {
  color: #7a6c65;
  font-size: 0.6875rem;
}

.coffee-match-route strong {
  font-size: 0.75rem;
  line-height: 1.35;
}

.coffee-match-route .button {
  min-height: 44px;
  padding-inline: 12px;
  white-space: nowrap;
}

.coffee-match-reset {
  justify-self: start;
  min-height: 44px;
  margin-top: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #78381f;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.coffee-match-disclosure {
  margin: 13px 0 0;
}

.coffee-match-status,
.coffee-match-error {
  min-height: 18px;
  margin: 7px 0 0;
}

.coffee-match .coffee-match-error {
  color: #ffd0c2;
}

.coffee-menu-preview .editorial-section-heading {
  margin-bottom: 7px;
}

.coffee-menu-disclosure {
  margin: 0;
  color: #6f625c;
  font-size: 0.75rem;
  line-height: 1.45;
}

.coffee-menu-preview ol {
  display: grid;
  gap: 0;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgb(49 31 25 / 10%);
}

.coffee-menu-preview li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  min-height: 60px;
  gap: 9px;
  border-bottom: 1px solid rgb(49 31 25 / 10%);
}

.coffee-menu-preview li > span:first-child {
  color: #934225;
  font-size: 0.75rem;
  font-weight: 800;
}

.coffee-menu-preview li > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.coffee-menu-preview li strong {
  font-size: 0.875rem;
}

.coffee-menu-preview li small {
  color: #6f625c;
  font-size: 0.75rem;
}

.coffee-visit-heading h2 {
  margin: 4px 0 7px;
  font-size: clamp(1.25rem, 5.4vw, 1.45rem);
  line-height: 1.12;
}

.coffee-visit-heading > p:last-child {
  margin: 0;
  color: #6f625c;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.coffee-visit-options {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.coffee-visit-option {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 64px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgb(49 31 25 / 12%);
  border-radius: 16px;
  background: #f7efe5;
  color: #2b1c18;
  cursor: pointer;
}

.coffee-visit-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.coffee-visit-radio {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid #8c7d75;
  border-radius: 50%;
  background: #fffaf2;
}

.coffee-visit-radio i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
}

.coffee-visit-option input:checked + .coffee-visit-radio {
  border-color: #a84725;
}

.coffee-visit-option input:checked + .coffee-visit-radio i {
  background: #a84725;
}

.coffee-visit-option:has(input:checked) {
  border-color: #a84725;
  background: #f8dfc8;
}

.coffee-visit-option input:focus-visible + .coffee-visit-radio {
  outline: 3px solid #a84725;
  outline-offset: 3px;
}

.coffee-visit-option > span:nth-of-type(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.coffee-visit-option strong {
  font-size: 0.875rem;
}

.coffee-visit-option small,
.coffee-visit-option em {
  color: #6f625c;
  font-size: 0.75rem;
  font-style: normal;
}

.coffee-visit-option em {
  grid-column: 2;
  margin-top: -2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coffee-selection-summary {
  min-height: 38px;
  margin: 12px 0;
  padding: 9px 11px;
  border-left: 3px solid #a84725;
  background: #f7efe5;
  color: #554741;
  font-size: 0.75rem;
  line-height: 1.35;
}

.coffee-selection-summary[aria-hidden="true"] {
  border-left-color: #b8aaa2;
  color: #766a64;
}

.coffee-visit-planner .button,
.coffee-plan-confirmation .button,
.coffee-empty .button {
  min-height: 48px;
}

.coffee-visit-planner .button:disabled {
  border-color: #d8cec4;
  background: #d8cec4;
  color: #746b65;
  cursor: not-allowed;
}

.coffee-visit-status,
.coffee-visit-error {
  min-height: 18px;
  margin: 9px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.coffee-visit-status {
  color: #665a54;
}

.coffee-visit-error {
  color: #8d271a;
}

.coffee-plan-confirmation {
  padding: 20px;
  animation: coffee-plan-reveal 180ms ease-out both;
}

.coffee-plan-check {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 50%;
  background: #a84725;
  color: #fffaf2;
}

.coffee-plan-confirmation h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.45rem, 6.2vw, 1.75rem);
  line-height: 1.08;
}

#coffee-plan-result-title:focus-visible {
  outline: none;
  text-decoration: underline 2px #a84725;
  text-underline-offset: 5px;
}

.coffee-plan-confirmation > p:not(.eyebrow, .coffee-plan-memory, .sr-only) {
  margin: 0;
  color: #655852;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.coffee-plan-confirmation dl {
  display: grid;
  gap: 0;
  margin: 18px 0 14px;
  border-block: 1px solid rgb(49 31 25 / 12%);
}

.coffee-plan-confirmation dl div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
}

.coffee-plan-confirmation dl div + div {
  border-top: 1px solid rgb(49 31 25 / 10%);
}

.coffee-plan-confirmation dt {
  color: #756861;
  font-size: 0.75rem;
}

.coffee-plan-confirmation dd {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 750;
}

.coffee-plan-confirmation dd small {
  color: #756861;
  font-size: 0.75rem;
  font-weight: 500;
}

.coffee-plan-memory {
  margin: 0 0 15px;
  color: #756861;
  font-size: 0.75rem;
  line-height: 1.45;
}

.coffee-plan-edit {
  width: 100%;
  min-height: 44px;
  margin-top: 5px;
  border: 0;
  background: transparent;
  color: #77371f;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.coffee-empty {
  display: grid;
  justify-items: start;
  padding: 22px;
}

.coffee-empty > span {
  margin-bottom: 18px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 2rem;
  line-height: 1;
}

.coffee-empty h2 {
  margin: 4px 0 8px;
  font-size: 1.6rem;
}

.coffee-empty > p:not(.eyebrow) {
  margin: 0 0 18px;
  color: #655852;
  font-size: 0.8125rem;
  line-height: 1.5;
}

@keyframes coffee-plan-reveal {
  from { opacity: 0.72; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 350px) {
  .coffee-detail-copy,
  .coffee-menu-preview,
  .coffee-match,
  .coffee-visit-planner,
  .coffee-plan-confirmation {
    padding: 15px;
  }

  .coffee-demo-label {
    top: 15px;
    right: 15px;
  }
}

@container coffee-match (width < 19em) {
  .coffee-match-options {
    grid-template-columns: 1fr;
  }

  .coffee-match-options label {
    min-height: 56px;
  }

  .coffee-match-route {
    grid-template-columns: 1fr;
  }

  .coffee-match-route .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .coffee-plan-confirmation { animation: none; }
}

@media (forced-colors: active) {
  .coffee-detail-hero,
  .coffee-menu-preview,
  .coffee-match,
  .coffee-visit-planner,
  .coffee-plan-confirmation,
  .coffee-empty,
  .coffee-visit-option,
  .coffee-selection-summary {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  .coffee-visit-radio,
  .coffee-plan-check,
  .coffee-match-options label > span,
  .coffee-match-heading > span,
  .coffee-match-result {
    border: 2px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }

  .coffee-match::after { display: none; }
}
