/* Le Panier Doré — barre d'infos + grille d'ingrédients (composant partagé) */

.rp-root {
  display: block;
  width: 100%;
  margin: 0.35rem 0 1.35rem;
}

.rp-toast {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%) translateY(120%);
  max-width: min(92vw, 22rem);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  background: var(--color-secondary-dark, #1b4332);
  color: #fffbf5;
  font-family: var(--font-main, system-ui, sans-serif);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 28px rgba(27, 67, 50, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.rp-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.rp-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.1rem;
  margin: 0.95rem 0 1.35rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--color-border, #e0d5c7);
  border-left: 4px solid var(--color-primary, #e85d04);
  border-radius: 16px;
  box-shadow: none;
}

.rp-chip {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  flex: 0 1 auto;
  padding: 0.2rem 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.rp-chip:hover {
  background: transparent;
}

.rp-chip__icon {
  display: none;
}

.rp-chip__label {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-light, #5a5a5a);
  white-space: nowrap;
}

.rp-chip__value {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-secondary-dark, #1b4332);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rp-chip--budget .rp-chip__value {
  color: var(--color-primary, #e85d04);
}

.rp-servings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
  margin-left: auto;
  padding: 0.2rem 0.3rem;
  background: var(--color-bg-alt, #f5efe6);
  border: none;
  border-radius: 999px;
  box-shadow: none;
}

.rp-servings__btn {
  flex: 0 0 auto;
  width: 1.95rem;
  height: 1.95rem;
  border: none;
  border-radius: 999px;
  background: var(--color-secondary-dark, #1b4332);
  color: #fffbf5;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.rp-servings__btn:hover {
  background: var(--color-secondary, #2d6a4f);
}

.rp-servings__btn:active {
  transform: scale(0.95);
}

.rp-servings__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.rp-servings__value {
  min-width: 5rem;
  padding: 0 0.15rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-secondary-dark, #1b4332);
  white-space: nowrap;
}

.rp-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-left: 0;
}

.rp-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  min-height: 2.2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.08);
  color: var(--color-secondary, #2d6a4f);
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.rp-action:hover {
  background: rgba(45, 106, 79, 0.14);
  color: var(--color-secondary-dark, #1b4332);
  transform: translateY(-1px);
}

.rp-action:active {
  transform: translateY(0);
}

.rp-action svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

.rp-action--fav {
  background: rgba(232, 93, 4, 0.1);
  color: var(--color-primary, #e85d04);
}

.rp-action--fav:hover {
  background: rgba(232, 93, 4, 0.18);
  color: var(--color-primary-dark, #c44900);
}

.rp-action--fav[aria-pressed="true"] {
  background: var(--color-primary, #e85d04);
  color: #fffbf5;
}

.rp-action--fav[aria-pressed="true"]:hover {
  background: var(--color-primary-dark, #c44900);
  color: #fffbf5;
}

.rp-action--fav[aria-pressed="true"] .rp-action__heart-outline {
  display: none;
}

.rp-action--fav:not([aria-pressed="true"]) .rp-action__heart-fill {
  display: none;
}

.rp-action--fav svg {
  width: 1.15rem;
  height: 1.15rem;
}

.rp-ingredients {
  margin: 0 0 1.25rem;
}

.rp-ingredients__title {
  margin: 0 0 0.85rem;
  font-family: var(--font-main, system-ui, sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-secondary-dark, #1b4332);
}

.rp-ingredients__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.recipe-card--modern .rp-ingredients__title::before {
  display: none;
}

.rp-ing {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fffdf9;
  border: 1px solid #e6d8c4;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(43, 43, 43, 0.05);
}

.rp-ing__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f3ebe0;
  overflow: hidden;
}

.rp-ing__media::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--color-primary, #e85d04);
  opacity: 0.85;
}

.rp-ing__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rp-ing__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0.65rem 0.8rem;
  min-height: 4.4rem;
}

.rp-ing__qty {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary, #e85d04);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.rp-ing__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-secondary-dark, #1b4332);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.rp-ingredients__note {
  margin: 0.85rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-secondary-dark, #1b4332);
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 900px) {
  .rp-bar {
    gap: 0.65rem 0.9rem;
  }

  .rp-chip {
    flex: 0 1 auto;
  }

  .rp-servings {
    margin-left: 0;
    flex: 1 1 auto;
  }

  .rp-ingredients__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .rp-bar {
    gap: 0.55rem 0.75rem;
    padding: 0.75rem 0.85rem;
  }

  .rp-chip {
    flex: 0 1 auto;
  }

  .rp-servings {
    flex: 1 1 100%;
    justify-content: space-between;
    order: 10;
  }

  .rp-actions {
    flex: 1 1 100%;
    justify-content: flex-end;
    padding-left: 0;
    order: 11;
  }

  .rp-action {
    flex: 0 0 auto;
    width: 2.4rem;
    height: 2.4rem;
    min-height: 2.4rem;
  }

  .rp-ingredients__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .rp-ing__body {
    min-height: 4.1rem;
    padding: 0.6rem 0.55rem 0.7rem;
  }
}

/* ---- Liste de courses (fiche recette) ---- */

.rp-ing {
  position: relative;
}

.rp-ing__have {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.35rem;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5dacb;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-secondary-dark, #1b4332);
  line-height: 1.2;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
}

.rp-ing__have input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  accent-color: var(--color-secondary, #2d6a4f);
  flex-shrink: 0;
}

.rp-shopping {
  margin-top: 1.15rem;
  padding: 1rem 0.95rem 1.05rem;
  border: 1px solid #e5dacb;
  border-radius: 1rem;
  background: #fffcf6;
}

.rp-shopping__title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-secondary-dark, #1b4332);
  line-height: 1.3;
}

.rp-shopping__servings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-bottom: 0.85rem;
}

.rp-shopping__servings-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-secondary, #2d6a4f);
}

.rp-shopping__servings-btns {
  display: inline-flex;
  gap: 0.35rem;
}

.rp-shopping__person {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #e5dacb;
  border-radius: 999px;
  background: #fff;
  color: var(--color-secondary-dark, #1b4332);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.rp-shopping__person.is-active {
  background: var(--color-secondary, #2d6a4f);
  border-color: var(--color-secondary, #2d6a4f);
  color: #fff;
}

.rp-shopping__add {
  width: 100%;
  min-height: 2.85rem;
}

.rp-shopping__feedback {
  margin: 0.7rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--color-secondary-dark, #1b4332);
}

.rp-shopping__feedback.is-ok a {
  color: var(--color-primary, #e85d04);
  font-weight: 700;
  text-underline-offset: 2px;
}

.rp-shopping__feedback.is-error {
  color: #8a1f1a;
}

@media (min-width: 700px) {
  .rp-shopping__add {
    width: auto;
    min-width: 16rem;
  }
}
