/* ============================================
   CLEAN MOBILE MEAL CARD FIX
   Simple, working solution without complexity
   ============================================ */

@media (max-width: 575px) {
  /* Reset any problematic styles */
  .optimized-meal-card,
  .optimized-meal-card * {
    position: static !important;
    overflow: visible !important;
    z-index: auto !important;
    isolation: auto !important;
  }

  /* Meal card - simple container */
  .optimized-meal-card {
    display: block;
    margin-bottom: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
  }

  /* Meal header - clean and simple */
  .optimized-meal-header {
    padding: 12px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Meal content - NO HEIGHT RESTRICTIONS */
  .optimized-meal-content {
    display: block;
    padding: 0;
    background: white;
    border-radius: 0 0 8px 8px;
    /* NO max-height, NO overflow hidden */
  }

  /* Each food item */
  .food-item {
    padding: 12px;
    border-bottom: 1px solid #f3f4f6;
  }

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

  /* Food name */
  .food-item strong {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 4px;
  }

  /* Calories and macros line */
  .food-item .d-block.d-sm-none.small.text-muted {
    display: block !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-bottom: 8px;
    line-height: 1.4;
  }

  /* Serving controls */
  .food-item .d-block.d-sm-none.mt-2 {
    display: block !important;
    margin-top: 8px !important;
  }

  .food-item input[type="number"] {
    width: 60px;
    height: 32px;
    padding: 4px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
  }

  /* Hide desktop layout completely */
  .food-item .d-none.d-sm-flex {
    display: none !important;
  }

  /* Ensure proper spacing for empty meals */
  .optimized-meal-empty {
    padding: 20px;
    text-align: center;
    color: #6b7280;
  }

  /* Clean button styles */
  .optimized-meal-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Meal status text */
  .optimized-meal-status {
    font-size: 13px;
    color: #6b7280;
  }
}

/* Ensure no overlap between sections */
.meals-container {
  display: block;
}

.meals-container > * {
  display: block;
  margin-bottom: 16px;
}

.snacks-section {
  display: block;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 2px solid #f3f4f6;
}

/* Section titles */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
  padding: 0 12px;
}