/* ═══════════════════════════════════════════════════════════════════
   My Foods – unified food guide organized by category
   ═══════════════════════════════════════════════════════════════════ */

/* ── Practitioner guidance banner ── */
.my-foods-guidance {
  padding: 0.85rem 1.15rem;
  margin-bottom: 1.25rem;
  border-radius: 0.75rem;
  background: transparent;
  border-left: 3px solid oklch(var(--p));
}

.my-foods-guidance__text {
  font-size: 0.85rem;
  font-style: italic;
  line-height: 1.5;
  color: oklch(var(--bc) / 0.75);
}

/* ── Categories container ── */
.my-foods-categories {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Section card (one per category) ── */
.my-foods-section {
  border-radius: 1rem;
}

.my-foods-section__header {
  padding: 1rem 1.25rem 0.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.my-foods-section__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: oklch(var(--bc));
}

.my-foods-section__counts {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.my-foods-count {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
}

.my-foods-count--favor {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

.my-foods-count--avoid {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* ── Divider between favor and reduce/avoid groups ── */
.my-foods-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 1.25rem;
}

.my-foods-divider::before,
.my-foods-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: oklch(var(--bc) / 0.08);
}

.my-foods-divider__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: oklch(var(--bc) / 0.5);
}

/* ── Food grid (3-column) ── */
.my-foods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 0.25rem;
  padding: 0.75rem 1rem 1.25rem;
}

/* Reduce/avoid grid: desaturated + slightly faded */
.my-foods-grid--unfavor {
  padding-top: 0.25rem;
}

.my-foods-grid--unfavor .my-foods-item__image {
  filter: saturate(0.55) brightness(0.95);
}

.my-foods-grid--unfavor .my-foods-item__name {
  color: oklch(var(--bc) / 0.65);
}

/* ── Individual food item ── */
.my-foods-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
}

.my-foods-item__circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.my-foods-item__circle:hover {
  transform: scale(1.05);
}

/* ── Verdict-based border ring (thick, clearly colored) ── */
.my-foods-item__circle--favor {
  border: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.my-foods-item__circle--reduce {
  border: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.04);
}

.my-foods-item__circle--avoid {
  border: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.04);
}

/* ── Food image ── */
.my-foods-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.my-foods-item__circle--loaded {
  animation: my-foods-fade-in 0.4s ease;
}

@keyframes my-foods-fade-in {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Initial letter (no image) ── */
.my-foods-item__initial {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.my-foods-item__initial--favor  { color: #22c55e; }
.my-foods-item__initial--reduce { color: #f59e0b; }
.my-foods-item__initial--avoid  { color: #ef4444; }

/* ── Food name ── */
.my-foods-item__name {
  font-size: 0.78rem;
  font-weight: 500;
  color: oklch(var(--bc));
  line-height: 1.2;
  max-width: 100px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Clickable food item cursor ── */
.my-foods-item[role="button"] {
  cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   Food detail modal
   ══════════════════════════════════════════════════════ */

.my-foods-modal {
  border-radius: 1.25rem;
  max-height: 85vh;
  overflow-y: auto;
}

.my-foods-modal__image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: color-mix(in srgb, var(--food-accent, oklch(var(--b3))) 12%, oklch(var(--b2)));
}

.my-foods-modal__cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.my-foods-modal__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--food-accent, oklch(var(--bc) / 0.3));
  opacity: 0.5;
}

.my-foods-modal__body {
  padding: 1.5rem 1.5rem 2rem;
}

.my-foods-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.my-foods-modal__title {
  font-size: 1.35rem;
  font-weight: 700;
  color: oklch(var(--bc));
}

.my-foods-modal__verdict-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.my-foods-modal__category {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: oklch(var(--bc) / 0.55);
  margin-bottom: 0.75rem;
}

.my-foods-modal__properties {
  font-size: 0.95rem;
  font-style: italic;
  color: oklch(var(--bc) / 0.7);
  line-height: 1.5;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid oklch(var(--bc) / 0.1);
}

.my-foods-modal__reasons {
  margin-bottom: 1rem;
}

.my-foods-modal__section-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: oklch(var(--bc) / 0.6);
  margin-bottom: 0.5rem;
}

.my-foods-modal__reason-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.my-foods-modal__reason {
  font-size: 1rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.5rem;
  line-height: 1.45;
}

.my-foods-modal__reason--favor {
  background: rgba(34, 197, 94, 0.08);
  color: oklch(var(--bc) / 0.85);
  border-left: 3px solid #22c55e;
}

.my-foods-modal__reason--reduce {
  background: rgba(245, 158, 11, 0.08);
  color: oklch(var(--bc) / 0.85);
  border-left: 3px solid #f59e0b;
}

.my-foods-modal__reason--avoid {
  background: rgba(239, 68, 68, 0.07);
  color: oklch(var(--bc) / 0.85);
  border-left: 3px solid #ef4444;
}

.my-foods-modal__reason-detail {
  margin-top: 0.35rem;
}

.my-foods-modal__reason-detail p {
  font-size: 0.95rem;
  font-weight: 400;
  color: oklch(var(--bc) / 0.7);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.my-foods-modal__reason-detail p:last-child {
  margin-bottom: 0;
}

.my-foods-modal__section {
  margin-bottom: 1.5rem;
}

.my-foods-modal__section-text {
  font-size: 0.95rem;
  color: oklch(var(--bc) / 0.75);
  line-height: 1.6;
}

.my-foods-modal__substitutes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.my-foods-modal__sub-tag {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  background: oklch(var(--b2));
  color: oklch(var(--bc) / 0.7);
}

/* ── Quick facts card (grocery modal) ── */
.my-foods-modal__quick-facts {
  display: grid;
  gap: 0;
  padding: 0.25rem 0;
  border-radius: 0.75rem;
  background: oklch(var(--su) / 0.06);
  margin-bottom: 1.5rem;
}

.my-foods-modal__quick-fact {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.85rem 1rem;
}

.my-foods-modal__quick-fact + .my-foods-modal__quick-fact {
  border-top: 1px solid oklch(var(--bc) / 0.06);
}

.my-foods-modal__quick-fact-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: oklch(var(--bc) / 0.55);
}

.my-foods-modal__quick-fact-text {
  font-size: 0.9rem;
  color: oklch(var(--bc) / 0.8);
  line-height: 1.45;
}

.my-foods-modal__divider {
  height: 1px;
  background: oklch(var(--bc) / 0.1);
  margin-bottom: 1.25rem;
}

/* ── Responsive ── */
@media (min-width: 640px) {
  .my-foods-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem 0.5rem;
  }

  .my-foods-item__circle {
    width: 96px;
    height: 96px;
  }

  .my-foods-item__name {
    font-size: 0.85rem;
    max-width: 120px;
  }
}

@media (min-width: 1024px) {
  .my-foods-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
