/* ============================================
   MA POPOTE - Reusable Component Styles
   Source: Design System Tokens (tokens.css)
   Style: Nature Distilled + Soft UI Evolution
   ============================================ */

/* ============================================
   1. BUTTONS
   ============================================ */

/* Base button */
[class*="btn-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

[class*="btn-"]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

[class*="btn-"]:active {
  transform: scale(0.97);
}

[class*="btn-"]:disabled,
[class*="btn-"].disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary button - Gold CTA */
.btn-primary {
  background-color: var(--accent-cta);
  color: var(--text-on-accent);
  border-color: var(--accent-cta);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--accent-cta-hover);
  border-color: var(--accent-cta-hover);
  box-shadow: var(--shadow-md);
}

/* Secondary button - Terracotta border */
.btn-secondary {
  background-color: transparent;
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-secondary:hover {
  background-color: var(--accent-primary-light);
  border-color: var(--accent-primary-hover);
  color: var(--accent-primary-hover);
}

/* Ghost button - No border, terracotta text */
.btn-ghost {
  background-color: transparent;
  color: var(--accent-primary);
  border-color: transparent;
  padding: 0.75rem 1rem;
}

.btn-ghost:hover {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary-hover);
}

/* Danger button - Error red */
.btn-danger {
  background-color: var(--accent-error);
  color: var(--text-on-accent);
  border-color: var(--accent-error);
}

.btn-danger:hover {
  background-color: #B42B2B;
  border-color: #B42B2B;
  box-shadow: var(--shadow-md);
}

/* Size variants */
.btn-sm {
  font-size: var(--text-sm);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  font-size: var(--text-lg);
  padding: 1rem 2rem;
  border-radius: var(--radius-lg);
}

/* Icon button - Round */
.btn-icon {
  width: var(--touch-target);
  height: var(--touch-target);
  padding: 0;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border);
  flex-shrink: 0;
}

.btn-icon:hover {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Floating Action Button */
.btn-fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-lg));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  padding: 0;
  border-radius: var(--radius-full);
  background-color: var(--accent-cta);
  color: var(--text-on-accent);
  border-color: var(--accent-cta);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-fixed);
  font-size: var(--text-xl);
}

.btn-fab:hover {
  background-color: var(--accent-cta-hover);
  border-color: var(--accent-cta-hover);
  box-shadow: var(--shadow-xl);
  transform: scale(1.05);
}

.btn-fab:active {
  transform: scale(0.95);
}


/* ============================================
   2. CARDS
   ============================================ */

/* Base card */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* Recipe card - Image top, title, meta */
.card-recipe {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-spring);
}

.card-recipe:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-recipe .card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.card-recipe .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card-recipe:hover .card-image img {
  transform: scale(1.05);
}

.card-recipe .card-image .card-badges {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.card-recipe .card-image .card-favorite {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-spring);
}

.card-recipe .card-image .card-favorite:hover {
  color: var(--accent-error);
  transform: scale(1.1);
}

.card-recipe .card-image .card-favorite.active {
  color: var(--accent-error);
  background-color: var(--accent-error-light);
}

.card-recipe .card-body {
  padding: var(--space-md);
}

.card-recipe .card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-recipe .card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.card-recipe .card-meta span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ---- Recipe Card (used by RecipeCard component) ---- */

.recipe-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-spring),
    border-color var(--transition-base);
}

.recipe-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--border-strong);
}

/* Link wrapper — removes default link styling */
.recipe-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

/* Image wrapper */
.recipe-card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--bg-warm);
}

.recipe-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.recipe-card:hover .recipe-card-image {
  transform: scale(1.06);
}

/* Image placeholder */
.recipe-card-image.recipe-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-warm);
  color: var(--text-tertiary);
}

/* Favorite button — overlaid on image */
.recipe-favorite-btn {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-spring);
  z-index: 2;
  padding: 0;
}

.recipe-favorite-btn:hover {
  color: var(--accent-error);
  transform: scale(1.12);
  background-color: rgba(255, 255, 255, 1);
}

.recipe-favorite-btn.is-favorite {
  color: var(--accent-error);
  background-color: var(--accent-error-light);
}

.recipe-favorite-btn.is-favorite svg {
  fill: currentColor;
}

/* Card content area */
.recipe-card-content {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Title */
.recipe-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin: 0;
  line-height: var(--leading-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta row — time, difficulty, servings inline */
.recipe-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.recipe-card-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  white-space: nowrap;
  line-height: 1;
}

.recipe-card-meta .meta-item svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Star rating */
.recipe-rating {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 0.7rem;
  line-height: 1;
}

.recipe-rating .star-filled {
  color: var(--accent-cta);
}

.recipe-rating .star-empty {
  color: var(--border);
}

.recipe-rating .rating-value {
  font-family: var(--font-body);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin-left: 4px;
}

/* Tags/chips row */
.recipe-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.recipe-tags .chip-sm {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-weight: var(--weight-medium);
  background-color: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  line-height: 1.3;
}

/* Actions footer */
.recipe-card-actions {
  padding: var(--space-xs) var(--space-md) var(--space-md);
  display: flex;
}

.recipe-card-actions .btn {
  flex: 1;
  justify-content: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast);
}

.recipe-card-actions .btn:hover {
  background-color: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary-hover);
}

.recipe-card-actions .btn svg {
  width: 14px;
  height: 14px;
}

/* Override btn sub-elements inside recipe card actions */
.recipe-card-actions .btn .btn-icon,
.recipe-card-actions .btn .btn-text {
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  line-height: inherit;
  font-size: inherit;
}

/* Action card - Icon + text, clickable */
.card-action {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
}

.card-action:hover {
  background-color: var(--bg-warm);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.card-action .card-action-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.card-action .card-action-text {
  flex: 1;
}

.card-action .card-action-text h4 {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 2px 0;
}

.card-action .card-action-text p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.card-action .card-action-arrow {
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  transition: transform var(--transition-fast);
}

.card-action:hover .card-action-arrow {
  transform: translateX(4px);
  color: var(--accent-primary);
}

/* Info card - Bordered, light bg */
.card-info {
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.card-info strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

/* Meal card - Meal slot with image */
.card-meal {
  position: relative;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  overflow: hidden;
  cursor: pointer;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.card-meal:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

.card-meal.filled {
  border-style: solid;
  border-color: var(--border);
}

.card-meal .card-meal-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-meal .card-meal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card-meal:hover .card-meal-image img {
  transform: scale(1.05);
}

.card-meal .card-meal-body {
  padding: var(--space-sm) var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-meal .card-meal-body h4 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 4px 0;
  line-height: var(--leading-snug);
}

.card-meal .card-meal-body p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
}

.card-meal .card-meal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  gap: var(--space-sm);
  color: var(--text-tertiary);
  text-align: center;
}

.card-meal .card-meal-empty .icon {
  font-size: var(--text-2xl);
  opacity: 0.5;
}

.card-meal .card-meal-empty span {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}


/* ============================================
   3. INPUTS
   ============================================ */

/* Text input */
.input {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  line-height: var(--leading-normal);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
  outline: none;
}

.input::placeholder {
  color: var(--text-tertiary);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
  background-color: var(--bg-surface);
}

.input:disabled {
  background-color: var(--bg-warm);
  color: var(--text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Input group - With label */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.input-group label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.input-group .input-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* Error state */
.input-error .input,
.input.input-error {
  border-color: var(--accent-error);
  background-color: var(--accent-error-light);
}

.input-error .input:focus,
.input.input-error:focus {
  box-shadow: 0 0 0 3px var(--accent-error-light);
}

.input-error .input-message {
  font-size: var(--text-xs);
  color: var(--accent-error);
  font-weight: var(--weight-medium);
  margin-top: 2px;
}

/* Textarea */
.textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  line-height: var(--leading-relaxed);
  min-height: 120px;
  resize: vertical;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  outline: none;
}

.textarea::placeholder {
  color: var(--text-tertiary);
}

.textarea:hover {
  border-color: var(--border-strong);
}

.textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

/* Select */
.select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  line-height: var(--leading-normal);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B5E4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base);
  outline: none;
}

.select:hover {
  border-color: var(--border-strong);
}

.select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  user-select: none;
}

.checkbox input[type="checkbox"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.checkbox input[type="checkbox"]:hover {
  border-color: var(--accent-primary);
}

.checkbox input[type="checkbox"]:checked {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 6px;
  height: 10px;
  border: solid var(--text-on-accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Radio */
.radio {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  user-select: none;
}

.radio input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast);
}

.radio input[type="radio"]:hover {
  border-color: var(--accent-primary);
}

.radio input[type="radio"]:checked {
  border-color: var(--accent-primary);
}

.radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
}

.radio input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Toggle switch */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  appearance: none;
  width: 44px;
  height: 24px;
  border-radius: var(--radius-full);
  background-color: var(--border-strong);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background-color var(--transition-base);
}

.toggle-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-spring);
}

.toggle-switch input[type="checkbox"]:checked {
  background-color: var(--accent-success);
}

.toggle-switch input[type="checkbox"]:checked::after {
  transform: translateX(20px);
}

.toggle-switch input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Range slider */
.slider-range {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-base);
}

.slider-range::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  border: 3px solid var(--bg-surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform var(--transition-spring);
}

.slider-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  border: 3px solid var(--bg-surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

.slider-range:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}


/* ============================================
   4. CHIPS / TAGS
   ============================================ */

/* Base chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.375rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background-color: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.chip:hover {
  background-color: var(--accent-primary-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.chip:active {
  transform: scale(0.95);
}

/* Active chip */
.chip-active,
.chip.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--text-on-accent);
}

.chip-active:hover,
.chip.active:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
  color: var(--text-on-accent);
}

/* Chip group */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

/* Dietary chips */
.chip[data-diet="vegetarien"],
.chip-vegetarien {
  background-color: var(--accent-success-light);
  border-color: var(--accent-success);
  color: var(--accent-success);
}

.chip[data-diet="vegan"],
.chip-vegan {
  background-color: rgba(34, 139, 34, 0.12);
  border-color: #228B22;
  color: #228B22;
}

.chip[data-diet="sans-gluten"],
.chip-sans-gluten {
  background-color: var(--accent-warning-light);
  border-color: var(--accent-warning);
  color: #B45309;
}

.chip[data-diet="halal"],
.chip-halal {
  background-color: var(--accent-info-light);
  border-color: var(--accent-info);
  color: var(--accent-info);
}

.chip[data-diet="sans-lactose"],
.chip-sans-lactose {
  background-color: rgba(147, 51, 234, 0.12);
  border-color: #9333EA;
  color: #7C3AED;
}

.chip[data-diet="bio"],
.chip-bio {
  background-color: rgba(22, 163, 74, 0.12);
  border-color: #16A34A;
  color: #15803D;
}


/* ============================================
   5. MODAL
   ============================================ */

/* Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--transition-slow),
    visibility var(--transition-slow);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Backdrop — used by showModal()/hideModal() with display:none/flex toggling */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

/* Modal box */
.modal {
  background-color: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  z-index: var(--z-modal);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition:
    transform var(--transition-spring),
    opacity var(--transition-slow);
}

.modal-overlay.open .modal,
.modal-backdrop .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Modal header */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
}

.modal-header .modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background-color: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.modal-header .modal-close:hover {
  background-color: var(--accent-error-light);
  color: var(--accent-error);
}

/* Modal body */
.modal-body {
  padding: var(--space-xl);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
}

/* Modal footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}


/* ============================================
   6. TOAST
   ============================================ */

/* Toast container */
.toast-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-sm);
  pointer-events: none;
}

/* Base toast */
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--border-strong);
  min-width: 320px;
  max-width: 420px;
  pointer-events: auto;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  animation: toast-slide-in var(--transition-spring) forwards;
}

.toast.exiting {
  animation: toast-slide-out var(--transition-slow) forwards;
}

.toast .toast-icon {
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.toast .toast-content {
  flex: 1;
}

.toast .toast-content strong {
  display: block;
  font-weight: var(--weight-semibold);
  margin-bottom: 2px;
}

.toast .toast-dismiss {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-xs);
  border-radius: var(--radius-sm);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.toast .toast-dismiss:hover {
  color: var(--text-primary);
  background-color: var(--bg-warm);
}

/* Toast variants */
.toast-success {
  border-left-color: var(--accent-success);
}

.toast-success .toast-icon {
  color: var(--accent-success);
}

.toast-error {
  border-left-color: var(--accent-error);
}

.toast-error .toast-icon {
  color: var(--accent-error);
}

.toast-info {
  border-left-color: var(--accent-info);
}

.toast-info .toast-icon {
  color: var(--accent-info);
}

.toast-warning {
  border-left-color: var(--accent-warning);
}

.toast-warning .toast-icon {
  color: var(--accent-warning);
}

/* Toast animations */
@keyframes toast-slide-in {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toast-slide-out {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}


/* ============================================
   7. BADGE
   ============================================ */

/* Counter badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--text-on-accent);
  background-color: var(--accent-error);
  border-radius: var(--radius-full);
  line-height: 1;
}

/* Notification dot */
.badge-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--accent-error);
  border: 2px solid var(--bg-surface);
  flex-shrink: 0;
}

/* Larger tag badge */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.625rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--accent-primary);
  background-color: var(--accent-primary-light);
  border-radius: var(--radius-full);
  line-height: var(--leading-normal);
  white-space: nowrap;
}

.badge-tag.success {
  color: var(--accent-success);
  background-color: var(--accent-success-light);
}

.badge-tag.warning {
  color: var(--accent-warning);
  background-color: var(--accent-warning-light);
}

.badge-tag.error {
  color: var(--accent-error);
  background-color: var(--accent-error-light);
}

.badge-tag.info {
  color: var(--accent-info);
  background-color: var(--accent-info-light);
}


/* ============================================
   8. AVATAR
   ============================================ */

/* Base avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  color: var(--text-on-accent);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Size variants */
.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--text-lg);
  border-width: 3px;
}

/* Avatar group */
.avatar-group {
  display: flex;
  align-items: center;
}

.avatar-group .avatar {
  margin-left: -10px;
  transition: transform var(--transition-fast);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

.avatar-group .avatar:hover {
  transform: translateY(-2px);
  z-index: 1;
}

.avatar-group .avatar-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--bg-warm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border: 2px solid var(--bg-surface);
  margin-left: -10px;
}


/* ============================================
   9. PROGRESS BAR
   ============================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cta));
  border-radius: var(--radius-full);
  transition: width var(--transition-spring);
  position: relative;
  min-width: 0;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-bar.large {
  height: 12px;
}

.progress-bar.small {
  height: 4px;
}

/* Progress with label */
.progress-labeled {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.progress-labeled .progress-info {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.progress-labeled .progress-info strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}


/* ============================================
   10. SPINNER / LOADER
   ============================================ */

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinner.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.spinner.spinner-gold {
  border-top-color: var(--accent-cta);
}

.spinner.spinner-white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: var(--text-on-accent);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Full-page loader */
.loader-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-overlay-blur);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  z-index: var(--z-modal);
}

.loader-overlay .loader-text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-inverse);
  font-weight: var(--weight-medium);
}


/* ============================================
   11. DIVIDER
   ============================================ */

.divider {
  width: 100%;
  height: 1px;
  background-color: var(--border);
  border: none;
  margin: var(--space-lg) 0;
}

.divider-text {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  margin: var(--space-lg) 0;
  white-space: nowrap;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--border);
}


/* ============================================
   12. EMPTY STATE
   ============================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  max-width: 400px;
  margin: 0 auto;
}

.empty-state .empty-illustration {
  width: 120px;
  height: 120px;
  margin-bottom: var(--space-lg);
  opacity: 0.6;
  color: var(--text-tertiary);
  font-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state .empty-illustration img,
.empty-state .empty-illustration svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.empty-state p {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0 0 var(--space-xl) 0;
}


/* ============================================
   13. TABS
   ============================================ */

.tabs {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--border);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
  margin-bottom: -2px;
  border-bottom: 2px solid transparent;
}

.tab-item:hover {
  color: var(--accent-primary);
  background-color: var(--accent-primary-light);
}

.tab-item.active {
  color: var(--accent-primary);
  font-weight: var(--weight-semibold);
  border-bottom-color: var(--accent-primary);
}

.tab-item .tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background-color: var(--border);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tab-item.active .tab-badge {
  background-color: var(--accent-primary);
  color: var(--text-on-accent);
}


/* ============================================
   14. ACCORDION
   ============================================ */

.accordion {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  background-color: var(--bg-surface);
  border: none;
  cursor: pointer;
  text-align: left;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast);
}

.accordion-trigger:hover {
  background-color: var(--bg-warm);
  color: var(--accent-primary);
}

.accordion-trigger::after {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(45deg);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base);
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.accordion-trigger:hover::after {
  border-color: var(--accent-primary);
}

.accordion-item.open .accordion-trigger::after {
  transform: rotate(-135deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-content-inner {
  padding: 0 var(--space-lg) var(--space-lg) var(--space-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}


/* ============================================
   15. NAVIGATION ITEMS
   ============================================ */

/* Sidebar nav item */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 0.625rem var(--space-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
}

.nav-item.active {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
  font-weight: var(--weight-semibold);
}

.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.nav-item .nav-label {
  flex: 1;
}

.nav-item .nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background-color: var(--accent-error);
  color: var(--text-on-accent);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Bottom nav item (mobile) */
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: var(--weight-medium);
  color: var(--text-tertiary);
  text-decoration: none;
  cursor: pointer;
  min-width: var(--touch-target);
  min-height: var(--touch-target);
  position: relative;
  transition:
    color var(--transition-fast);
}

.bottom-nav-item .bottom-nav-icon {
  font-size: var(--text-xl);
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-spring);
}

.bottom-nav-item:hover {
  color: var(--accent-primary);
}

.bottom-nav-item.active {
  color: var(--accent-primary);
  font-weight: var(--weight-semibold);
}

.bottom-nav-item.active .bottom-nav-icon {
  transform: scale(1.1);
}

.bottom-nav-item .bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 20px);
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background-color: var(--accent-error);
  border: 2px solid var(--bg-surface);
}


/* ============================================
   16. SEARCH BAR
   ============================================ */

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-bar .search-icon {
  position: absolute;
  left: var(--space-md);
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.search-bar .input {
  padding-left: 2.75rem;
  padding-right: 2.75rem;
  background-color: var(--bg-warm);
  border-color: transparent;
  border-radius: var(--radius-full);
}

.search-bar .input:hover {
  background-color: var(--bg-surface);
  border-color: var(--border);
}

.search-bar .input:focus {
  background-color: var(--bg-surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.search-bar .input:focus ~ .search-icon {
  color: var(--accent-primary);
}

.search-bar .search-clear {
  position: absolute;
  right: var(--space-sm);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  transition:
    color var(--transition-fast),
    background-color var(--transition-fast);
}

.search-bar .search-clear:hover {
  color: var(--text-primary);
  background-color: var(--border);
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  max-height: 360px;
  overflow-y: auto;
  padding: var(--space-xs);
}

.search-results .search-result-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background-color var(--transition-fast);
}

.search-results .search-result-item:hover {
  background-color: var(--bg-warm);
}

.search-results .search-result-item .result-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

.search-results .search-result-item .result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.search-results .search-result-item .result-info {
  flex: 1;
  min-width: 0;
}

.search-results .search-result-item .result-info h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results .search-result-item .result-info p {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 2px 0 0 0;
}

.search-results .search-no-results {
  padding: var(--space-xl);
  text-align: center;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}


/* ============================================
   17. RECIPE-SPECIFIC COMPONENTS
   ============================================ */

/* Nutri-Score badges */
.nutri-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
  color: var(--text-on-accent);
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

.nutri-score-a {
  background-color: #1B8A3B;
}

.nutri-score-b {
  background-color: #7AC142;
  color: var(--text-primary);
}

.nutri-score-c {
  background-color: #FFC107;
  color: var(--text-primary);
}

.nutri-score-d {
  background-color: #F5821E;
}

.nutri-score-e {
  background-color: #E63027;
}

/* Nutri-score inline group */
.nutri-score-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nutri-score-group .nutri-score {
  border-radius: 0;
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
  opacity: 0.4;
}

.nutri-score-group .nutri-score.active {
  opacity: 1;
  transform: scale(1.15);
  z-index: 1;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Difficulty badge */
.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.625rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.difficulty-badge.easy {
  background-color: var(--accent-success-light);
  color: var(--accent-success);
}

.difficulty-badge.medium {
  background-color: var(--accent-warning-light);
  color: #B45309;
}

.difficulty-badge.hard {
  background-color: var(--accent-error-light);
  color: var(--accent-error);
}

/* Time badge */
.time-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.25rem 0.625rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  background-color: var(--bg-warm);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.time-badge .time-icon {
  font-size: var(--text-sm);
}

/* Cost badge */
.cost-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0.25rem 0.625rem;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.cost-badge.cheap {
  background-color: var(--accent-success-light);
  color: var(--accent-success);
}

.cost-badge.moderate {
  background-color: var(--accent-warning-light);
  color: #B45309;
}

.cost-badge.expensive {
  background-color: var(--accent-primary-light);
  color: var(--accent-primary);
}

.cost-badge .cost-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background-color: currentColor;
}

.cost-badge .cost-dot.inactive {
  opacity: 0.25;
}


/* ============================================
   18. PRICING CARD
   ============================================ */

.pricing-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  text-align: center;
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-base);
}

.pricing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

/* Featured pricing card */
.pricing-card.featured {
  border-color: var(--accent-cta);
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: scale(1.03);
}

.pricing-card.featured:hover {
  box-shadow: var(--shadow-xl);
  transform: scale(1.05);
}

.pricing-card.featured::before {
  content: attr(data-badge);
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 1rem;
  background-color: var(--accent-cta);
  color: var(--text-on-accent);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  border-radius: var(--radius-full);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-card .pricing-tier {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.pricing-card .pricing-price {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.pricing-card .pricing-price .currency {
  font-size: var(--text-xl);
  vertical-align: super;
  margin-right: 2px;
}

.pricing-card .pricing-price .period {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-normal);
  color: var(--text-tertiary);
}

.pricing-card .pricing-description {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  line-height: var(--leading-relaxed);
}

.pricing-card .pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-xl) 0;
  text-align: left;
  flex: 1;
}

.pricing-card .pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: var(--leading-normal);
}

.pricing-card .pricing-features li::before {
  content: '\2713';
  color: var(--accent-success);
  font-weight: var(--weight-bold);
  flex-shrink: 0;
  margin-top: 1px;
}

.pricing-card .pricing-features li.excluded {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.pricing-card .pricing-features li.excluded::before {
  content: '\2717';
  color: var(--text-tertiary);
}

.pricing-card .pricing-cta {
  margin-top: auto;
}

/* Featured card CTA emphasis */
.pricing-card.featured .btn-primary {
  box-shadow: var(--shadow-md);
}


/* ============================================
   UTILITY: Responsive adjustments
   ============================================ */

@media (max-width: 768px) {
  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: calc(var(--bottom-nav-height) + var(--space-md));
  }

  .toast {
    min-width: auto;
    max-width: none;
  }

  .modal {
    max-width: none;
    margin: var(--space-md);
    max-height: 90vh;
  }

  .modal-overlay,
  .modal-backdrop {
    padding: var(--space-md);
  }

  .btn-fab {
    bottom: calc(var(--bottom-nav-height) + var(--space-md));
    right: var(--space-md);
    width: 52px;
    height: 52px;
  }

  .search-bar .input {
    font-size: var(--text-base);
  }

  .pricing-card.featured {
    transform: scale(1);
  }

  .pricing-card.featured:hover {
    transform: translateY(-4px);
  }
}
