#Recipe {
  width: min(1600px, 99%);
  margin: 0 auto 40px;
  box-sizing: border-box;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  font-family: var(--cs-font);
}

#abc1.recipe-hero {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  /* Override legacy #abc1 { padding: 10px } in css.css */
  padding: 0 0 4px;
}

#abc2.recipe-shell {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.recipe-hero {
  width: 100%;
  padding: 0;
}

.recipe-hero__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
}

/* Title row + rating on one band so stars align with the dish title, not the countdown */
.recipe-hero__top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

/* Meta row under the title: chef credit + order-close badge */
.recipe-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  width: 100%;
}

.recipe-hero__chef {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: #4c6173;
}

.recipe-hero__chef label {
  cursor: pointer;
}

.recipe-hero__chef #Creator {
  color: #1f2937;
}

.recipe-hero__chef-chat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recipe-hero__chef-chat i {
  font-size: 20px;
  color: #b3b000;
  cursor: pointer;
}

.recipe-hero__proof {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid #f0d9c0;
  border-radius: 999px;
  background: #fff8f0;
  font-size: 0.8rem;
  color: #8a5a2b;
  white-space: nowrap;
}

.recipe-hero__proof i {
  color: #d4762a;
}

.recipe-hero__proof--yours {
  border-color: #8fbc8f;
  background: #f6faf6;
  color: #2f6b3a;
}

.recipe-hero__proof--yours i {
  color: #3d8b4a;
}

.recipe-hero__proof--pending {
  border-color: #d4a27a;
  background: #fffdf8;
  color: #7a3e2d;
}

.recipe-hero__proof--pending i {
  color: #c0392b;
}

.recipe-hero__countdown {
  width: auto;
  max-width: 100%;
}

.recipe-hero__countdown .recipe-order-info__time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid #e7e3c6;
  border-radius: 999px;
  background: #fffdf1;
  font-size: calc(0.85rem * 5 / 6);
  font-weight: 500;
  color: #4b5563;
}

.recipe-hero__countdown .recipe-order-info__time b,
.recipe-hero__countdown .recipe-order-info__time a {
  font-weight: 600;
  color: #1f2937;
}

.recipe-hero__countdown-suffix {
  font-weight: 500;
  color: #6b7280;
}

.recipe-hero__row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}

.recipe-hero__subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 2px;
  color: #4c6173;
  font-size: 0.84rem;
}

.recipe-hero__subtitle--inline {
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  white-space: nowrap;
  min-width: 0;
}

.recipe-hero__distance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.recipe-hero__like {
  margin: 0;
}

.recipe-hero__rating {
  flex-shrink: 0;
  float: none;
  width: auto;
  max-width: min(280px, 100%);
  margin-top: 0;
  padding: 8px 14px 10px;
  border: 1px solid #e7e3c6;
  border-radius: 14px;
  background: #fffdf1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: none;
}

.recipe-hero__rating-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.recipe-hero__rating-stars {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
  width: 100%;
  min-height: 1.5em;
}

.recipe-hero__rating-label {
  margin-right: 0;
  font-size: 0.83rem;
  font-weight: 600;
}

.recipe-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 26px 26px;
  border: 1px solid #ece8c8;
  border-radius: 26px;
  background: linear-gradient(180deg, #fffef4 0%, #fffbe3 100%);
  box-shadow: 0 22px 55px rgba(87, 76, 19, 0.08);
  box-sizing: border-box;
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(340px, 480px) minmax(440px, 1fr) minmax(310px, 360px);
  column-gap: 14px;
  row-gap: 2px;
  align-items: start;
  min-width: 0;
}

.recipe-media-card {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 16px;
  align-self: start;
  overflow: hidden;
}

#img-previewRead {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  float: none;
  border-radius: 14px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.recipe-media-card:hover #img-previewRead {
  transform: scale(1.03);
}

.recipe-content-column {
  display: grid;
  gap: 3px;
  align-content: start;
}

.recipe-panel.recipe-description-panel {
  padding: 4px 8px 2px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.recipe-panel.recipe-ingredients-panel {
  padding: 8px 18px 16px;
}

.recipe-ingredients-panel .recipe-panel__title {
  margin-bottom: 8px;
}

.recipe-panel {
  padding: 18px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.recipe-panel__title {
  margin-bottom: 12px;
}

.recipe-description-panel #Description {
  display: block;
  margin-right: 0;
  color: var(--cs-body);
  font-size: 1.02rem;
  line-height: 1.65;
  margin-bottom: 0;
}

.recipe-ingredients-list__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.recipe-ingredient-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
}

/* Possible allergens stand out and are sorted first */
.recipe-ingredient-chip--allergen {
  border-color: #f0c5a0;
  background: #fff7ee;
  color: #9a4a12;
}

.recipe-ingredient-chip--allergen::before {
  content: "\26A0";
  margin-right: 5px;
  font-size: 0.75em;
}

/* Collapsed list: chips beyond the cap hide until "+ N more" is clicked */
.recipe-ingredient-chip--hidden {
  display: none;
}

.recipe-ingredients-list__grid--expanded .recipe-ingredient-chip--hidden {
  display: inline-flex;
}

.recipe-ingredient-chip--toggle {
  border-color: #c9c44a;
  background: #fffdf1;
  color: #807d00;
  cursor: pointer;
  user-select: none;
}

.recipe-ingredient-chip--toggle:hover {
  background: #fbf8d8;
}

.recipe-order-info {
  grid-column: 1 / 3;
  margin-top: -6px;
  padding-top: 4px;
  padding-bottom: 6px;
  line-height: 1.45;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

/* .highlight on same node uses line-height: 30px in css.css — resets it for this card */
.recipe-panel.recipe-order-info.highlight {
  line-height: 1.45;
}

.recipe-order-info #id_opened {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.3fr);
  gap: 18px 28px;
  align-items: start;
}

#localizationinfos {
  margin: 0;
  color: #4f6476;
}

.recipe-order-info__time {
  color: #111827;
  font-size: calc(0.98rem * 5 / 6);
  font-weight: 600;
  line-height: 1.45;
}

.recipe-order-info__delivery {
  color: #475569;
  line-height: 1.55;
  font-size: 0.83rem;
}

.recipe-order-panel__quantity-wrap {
  margin-top: 0;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.recipe-order-panel__quantity-label {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
}

.recipe-order-panel.recipe-panel {
  padding: 12px 14px;
}

.recipe-order-panel {
  position: sticky;
  top: 16px;
  min-width: 0;
  max-width: 100%;
  align-self: start;
  border-radius: 18px;
  border: 1px solid #e7df9d;
  background: linear-gradient(180deg, #ffffff 0%, #fffef5 100%);
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.1);
  box-sizing: border-box;
}

.recipe-order-panel__quantity-wrap,
.recipe-order-panel__submit {
  display: flex;
  justify-content: center;
  align-items: center;
}

.recipe-order-panel__submit {
  margin: 6px 0 4px;
}

.recipe-order-panel__summary {
  display: grid;
  gap: 3px;
  padding-bottom: 5px;
  margin-bottom: 5px;
  border-bottom: 1px solid #ece6bf;
}

.recipe-order-panel__priceblock {
  display: grid;
  gap: 4px;
}

.recipe-order-panel__price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.recipe-order-panel__price-label {
  color: #6b7280;
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recipe-order-panel__price {
  color: #111827;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.1;
}

.recipe-order-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid #d7e6d8;
  border-radius: 999px;
  background: #f2fbf2;
  color: #2f6b3e;
  font-size: 0.64rem;
  font-weight: 700;
}

.recipe-order-panel__title {
  margin-bottom: 4px;
  color: #111827;
  font-size: 0.96rem;
  font-weight: 700;
}

.recipe-quantity-setter.quantity-setter {
  display: inline-flex;
  align-items: stretch;
  margin-top: 0;
  padding: 0;
  height: 26px;
  border: 1px solid #dbe3ed;
  border-radius: 6px;
  background: #f8fafc;
  overflow: hidden;
  vertical-align: middle;
}

.recipe-quantity-setter.quantity-setter input {
  width: 32px;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 0.76rem;
  line-height: 26px;
  text-align: center;
  align-self: center;
  box-sizing: border-box;
  background: #fff;
}

.recipe-quantity-setter.quantity-setter .increment-btn,
.recipe-quantity-setter.quantity-setter button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 10px;
  width: auto;
  height: 100%;
  min-width: 26px;
  min-height: 0;
  font-size: 0.78rem;
  line-height: 1;
  box-sizing: border-box;
  flex-shrink: 0;
  border-radius: 0;
}

.recipe-order-panel__payment-methods {
  display: grid;
  gap: 5px;
  margin: 4px 0 0;
  padding: 8px 10px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #fafbfc;
  text-align: left;
  min-width: 0;
  max-width: 100%;
}

/* Beat #piczone label { text-align: justify } from css.css */
#piczone .recipe-order-panel__payment-methods,
#piczone .recipe-order-panel__payment-methods .recipe-payment-option {
  text-align: left;
}

.recipe-order-panel__payment-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 2px;
}

.recipe-order-panel .recipe-payment-option {
  display: grid;
  grid-template-columns: 16px minmax(44px, 58px) minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
  row-gap: 0;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.74rem;
  line-height: 1.3;
  color: #334155;
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.recipe-payment-option:has(input[type="radio"]:checked) {
  border-color: #c9c44a;
  background: #fffef8;
  box-shadow: 0 0 0 1px rgba(179, 176, 0, 0.15);
}

/* Reset global input { width:100% } (e.g. member.css) so radios stay compact */
.recipe-payment-option input[type="radio"] {
  width: auto;
  max-width: none;
  padding: 0;
  margin: 0;
  grid-row: 1 / -1;
  align-self: center;
  border: none;
  background: transparent;
  font-size: 1em;
  min-width: 18px;
  min-height: 18px;
}

.recipe-order-panel .recipe-payment-option__logo {
  display: block;
  width: 100%;
  max-width: 58px;
  height: 18px;
  object-fit: contain;
  object-position: left center;
}

.recipe-order-panel .recipe-payment-option span {
  min-width: 0;
  font-size: 0.64rem;
  line-height: 1.25;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.recipe-order-panel__status {
  display: grid;
  gap: 2px;
  margin: 3px 0 4px;
}

#servingavialcount,
#servingavialcount2,
#servingbought,
#id_closed {
  padding: 6px 10px;
  border: 1px solid #e6edf5;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.7rem;
}

#servingavialcount {
  background: linear-gradient(180deg, #f9fbff 0%, #f1f7ff 100%);
}

#servingavialcount2,
#id_closed {
  background: linear-gradient(180deg, #fff7f7 0%, #fff1f1 100%);
  border-color: #f0d2d2;
}

#servingbought {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: start;
  border: 1px solid #f0b2a8;
  background: linear-gradient(180deg, #fffaf2 0%, #fff3df 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

#servingbought label {
  display: block;
  color: #7a3e2d;
  font-size: 0.72rem;
  line-height: 1.45;
}

#alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
}

#submit {
  width: 100%;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(179, 176, 0, 0.35);
  white-space: normal;
  line-height: 1.25;
  word-wrap: break-word;
}

/* Beat global .button-6 sizing for the checkout CTA: the Buy button is the strongest element on the page */
#submit.button-6 {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.78rem;
  background-color: #b3b000;
  border-color: #a09e00;
  color: #fff;
}

#submit.button-6:hover,
#submit.button-6:focus {
  background-color: #c4c100;
  border-color: #a09e00;
  color: #fff;
}

#submit:disabled,
#submit.button-6:disabled {
  background-color: #b3b000;
  color: #fff;
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  border-color: transparent;
}

#RecipeName {
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  line-height: 1.2;
}

#DishCountry,
#MealCateg,
#dstnc {
  color: inherit;
  font-weight: 600;
}

/* Tablets / iPad: 3-col recipe grid is wider than viewport — stack before content clips */
@media only screen and (max-width: 1200px) {
  .recipe-hero__top {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .recipe-hero__rating {
    width: 100%;
    justify-content: center;
  }

  .recipe-hero__row,
  .recipe-hero__subtitle--inline {
    flex-wrap: wrap;
    white-space: normal;
  }

  /* Flatten middle column so description / ingredients can be placed independently */
  .recipe-content-column {
    display: contents;
  }

  .recipe-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 8px;
    grid-template-areas:
      "media media"
      "desc desc"
      "order order"
      "ingredients ingredients"
      "info info";
  }

  .recipe-order-panel__payment-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
  }

  .recipe-payment-option {
    padding: 8px 10px;
  }

  .recipe-media-card {
    grid-area: media;
    position: static;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .recipe-panel.recipe-description-panel {
    grid-area: desc;
  }

  .recipe-panel.recipe-ingredients-panel {
    grid-area: ingredients;
    min-width: 0;
  }

  .recipe-order-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    grid-area: order;
    min-width: 0;
  }

  #orderzone {
    max-width: 100%;
  }

  .recipe-order-info #id_opened {
    grid-template-columns: 1fr;
  }

  .recipe-order-info {
    grid-area: info;
  }
}

@media only screen and (max-width: 768px) {
  #Recipe {
    width: 96%;
  }

  /* Phone: order panel before ingredients so Buy stays above the fold */
  .recipe-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "media"
      "desc"
      "order"
      "ingredients"
      "info";
  }

  #abc2.recipe-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .recipe-panel,
  .recipe-media-card,
  .recipe-shell {
    padding: 16px;
  }

  .recipe-panel.recipe-order-info {
    padding: 4px 12px 6px;
    margin-top: -4px;
  }

  .recipe-panel.recipe-description-panel {
    padding: 4px 10px 2px;
  }

  .recipe-panel.recipe-ingredients-panel {
    padding: 8px 14px 14px;
  }

  .recipe-media-card {
    padding: 12px;
  }

  .recipe-hero__subtitle {
    font-size: 0.98rem;
  }

  .recipe-order-panel__price {
    font-size: 0.95rem;
  }

  .recipe-order-panel__price-label {
    font-size: 0.62rem;
  }

  .recipe-order-panel__badge {
    font-size: 0.6rem;
    padding: 2px 7px;
  }

  .recipe-quantity-setter.quantity-setter {
    height: 24px;
  }

  .recipe-quantity-setter.quantity-setter input {
    width: 30px;
    font-size: 0.72rem;
    line-height: 24px;
  }

  .recipe-quantity-setter.quantity-setter .increment-btn,
  .recipe-quantity-setter.quantity-setter button {
    min-width: 24px;
    padding: 0 8px;
    font-size: 0.74rem;
  }

  #submit,
  #submit.button-6 {
    min-height: 38px;
    padding: 7px 12px;
    font-size: 0.72rem;
    box-shadow: 0 4px 12px rgba(179, 176, 0, 0.3);
  }

  .recipe-order-panel__payment-methods {
    padding: 8px 10px;
    gap: 6px;
    margin: 6px 0 0;
  }

  .recipe-order-panel .recipe-payment-option {
    grid-template-columns: 18px minmax(48px, 64px) minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 0;
    padding: 7px 8px;
    min-height: 0;
  }

  .recipe-order-panel .recipe-payment-option input[type="radio"] {
    grid-column: auto;
    grid-row: auto;
    align-self: center;
    margin-top: 0;
  }

  .recipe-order-panel .recipe-payment-option__logo {
    grid-column: auto;
    grid-row: auto;
    max-width: 64px;
    height: 18px;
  }

  .recipe-order-panel .recipe-payment-option span {
    grid-column: auto;
    grid-row: auto;
    font-size: 0.66rem;
    line-height: 1.25;
  }
}

@media only screen and (max-width: 519px) {
  .recipe-order-panel__payment-methods {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 380px) {
  .recipe-payment-option__logo {
    max-width: min(96px, 38vw);
    height: 24px;
  }

  .recipe-payment-option span {
    font-size: 0.66rem;
  }
}
