/* ============================================
   Reusable Components
   ============================================ */

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--accent-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

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

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

.btn-success {
  background: var(--accent-tertiary);
  color: var(--text-inverse);
}
.btn-success:hover {
  background: var(--accent-tertiary-hover);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--color-protein);
  color: var(--text-inverse);
}
.btn-danger:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 8px 18px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 16px 36px;
  font-size: var(--text-base);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* FAB */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-md));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: all var(--duration-fast) var(--ease-out);
  z-index: 50;
}
.fab:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-xl);
}
.fab svg {
  width: 24px;
  height: 24px;
}

/* === Cards === */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out);
}

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

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

.card-flat {
  box-shadow: none;
}
.card-flat:hover {
  box-shadow: var(--shadow-sm);
  transform: none;
}

/* === Inputs === */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-md);
  background: var(--surface-input);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease-out);
}
.input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}
.input::placeholder {
  color: var(--text-tertiary);
}

.textarea {
  min-height: 100px;
  padding: var(--space-sm) var(--space-md);
  resize: vertical;
  height: auto;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888A0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* === Toggle Pills === */
.pill-group {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.pill {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.pill:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.pill.active {
  background: var(--accent-primary);
  color: var(--text-inverse);
  border-color: var(--accent-primary);
}

/* === Option Cards (for questionnaire) === */
.option-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

.option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md);
  background: var(--surface-card);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  text-align: center;
}
.option-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.option-card.selected {
  border-color: var(--accent-primary);
  background: var(--accent-primary-light);
  box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.option-card .option-icon {
  font-size: 2.5rem;
}

.option-card .option-label {
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.option-card .option-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

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

.badge-success {
  background: rgba(76, 175, 80, 0.12);
  color: #2E7D32;
}

.badge-warning {
  background: rgba(255, 179, 0, 0.15);
  color: #F57F17;
}

.badge-danger {
  background: rgba(229, 57, 53, 0.12);
  color: #C62828;
}

/* Macro badge row */
.macro-badges {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.macro-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

.macro-badge.cal { background: rgba(255, 107, 53, 0.1); color: var(--color-calories); }
.macro-badge.pro { background: rgba(229, 57, 53, 0.1); color: var(--color-protein); }
.macro-badge.carb { background: rgba(255, 179, 0, 0.1); color: var(--color-carbs); }
.macro-badge.fat { background: rgba(123, 31, 162, 0.1); color: var(--color-fat); }

/* === Modals === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-md);
  animation: backdropIn var(--duration-normal) var(--ease-out);
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn var(--duration-normal) var(--ease-spring);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: var(--space-lg) var(--space-lg) var(--space-sm);
}

.modal-header h2 {
  font-size: var(--text-xl);
}

.modal-body {
  padding: var(--space-sm) var(--space-lg);
}

.modal-footer {
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.modal-lg {
  max-width: 700px;
}

.modal-full {
  max-width: 95vw;
  max-height: 95vh;
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--surface-elevated);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  min-width: 280px;
  max-width: 400px;
  animation: toastIn var(--duration-normal) var(--ease-spring);
}

.toast.success { border-left-color: var(--accent-tertiary); }
.toast.error { border-left-color: var(--color-protein); }
.toast.warning { border-left-color: var(--color-carbs); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100%); }
}

/* === Progress Bar === */
.progress-bar {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}

/* === Checkbox === */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.checkbox {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  flex-shrink: 0;
}

.checkbox.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.checkbox.checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.checkbox-label {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.checkbox-label.checked {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.empty-state h3 {
  margin-bottom: var(--space-sm);
}

.empty-state p {
  max-width: 320px;
  margin-bottom: var(--space-lg);
  font-size: var(--text-sm);
}

/* === Search Bar === */
.search-bar {
  position: relative;
}

.search-bar .search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
}

.search-bar .input {
  padding-left: 44px;
}

/* === Error text === */
.error-text {
  color: var(--color-protein);
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
}

/* === Tag list === */
.tag-list {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* === Divider === */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-lg) 0;
}

/* === Slider === */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

/* === Grid helpers === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); }

/* === Flex helpers === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* === Barcode Scanner === */
.scanner-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #000;
}

.scanner-video {
  width: 100%;
  display: block;
  max-height: 300px;
  object-fit: cover;
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.scanner-frame {
  width: 200px;
  height: 200px;
  border: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  animation: scanPulse 2s ease-in-out infinite;
}

.scanner-hint {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.8);
  margin-top: var(--space-sm);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.scanner-no-camera {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  gap: var(--space-sm);
  color: var(--text-secondary);
}

.scanner-manual {
  padding: var(--space-sm) 0;
}

.scanner-result {
  padding: var(--space-md) 0;
}

.scanner-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-xl) 0;
  color: var(--text-secondary);
}

.scanner-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.scanner-found {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.scanner-found-header {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.scanner-found-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
}

.scanner-found-name {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.scanner-found-brand {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.scanner-found-macros {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.scanner-macro-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.scanner-macro-item.cal { background: rgba(255,107,53,0.1); }
.scanner-macro-item.pro { background: rgba(229,57,53,0.1); }
.scanner-macro-item.carb { background: rgba(255,179,0,0.1); }
.scanner-macro-item.fat { background: rgba(123,31,162,0.1); }

.scanner-macro-val {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
}

.scanner-macro-label {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.scanner-calculated {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.scanner-not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
  gap: var(--space-sm);
  text-align: center;
}

/* === Food Logger === */
.food-logger-macros {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.food-logger-macro-input {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.food-logger-macro-input label {
  font-size: var(--text-xs);
  white-space: nowrap;
  min-width: 70px;
}

.food-logger-macro-input .input {
  flex: 1;
  min-width: 0;
}

.macro-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.food-logger-presets {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.pill-sm {
  padding: 4px 12px;
  font-size: var(--text-xs);
  border-radius: var(--radius-full);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

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

/* === Animations === */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes scanPulse {
  0%, 100% { border-color: var(--accent-primary); opacity: 1; }
  50% { border-color: var(--accent-secondary, var(--accent-primary)); opacity: 0.5; }
}

/* === Chat Assistant === */
.chat-bubble {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-out);
  z-index: 1000;
}

.chat-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.chat-bubble.active {
  background: var(--text-tertiary);
}

.chat-panel {
  position: fixed;
  bottom: 160px;
  right: 20px;
  width: 380px;
  max-height: 520px;
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1001;
  border: 1px solid var(--border-light);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--accent-primary);
  color: white;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.chat-header h4 {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: white;
}

.chat-status {
  font-size: var(--text-xs);
  opacity: 0.8;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.chat-close-btn {
  color: white !important;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: 200px;
  max-height: 320px;
}

.chat-message {
  display: flex;
  max-width: 85%;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message-content {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message.user .chat-message-content {
  background: var(--accent-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.bot .chat-message-content {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-suggestions {
  display: flex;
  gap: var(--space-xs);
  padding: 0 var(--space-md) var(--space-sm);
  flex-wrap: wrap;
}

.chat-suggestion {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--radius-full);
  background: var(--accent-primary-light);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  font-family: inherit;
  white-space: nowrap;
}

.chat-suggestion:hover {
  background: var(--accent-primary);
  color: white;
}

.chat-input-area {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border-light);
  background: var(--surface-card);
}

.chat-input {
  flex: 1;
  height: 40px;
  min-width: 0;
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Typing indicator */
.chat-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.chat-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: chatTyping 1.2s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chatSlideDown {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

@keyframes chatTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* === Food Search === */
.food-search-bar {
  position: relative;
  margin-bottom: var(--space-md);
}

.food-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.food-search-icon {
  position: absolute;
  left: var(--space-sm);
  color: var(--text-tertiary);
  pointer-events: none;
  z-index: 1;
}

.food-search-input {
  padding-left: calc(var(--space-sm) + 26px) !important;
  padding-right: var(--space-xl) !important;
}

.food-search-spinner {
  position: absolute;
  right: var(--space-sm);
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.food-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
}

.food-search-result {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration-fast);
}

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

.food-search-result:hover {
  background: var(--surface-secondary);
}

.food-result-info { flex: 1; min-width: 0; }

.food-result-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.food-result-brand {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-left: var(--space-xs);
  font-weight: var(--weight-regular);
}

.food-result-macros {
  display: flex;
  gap: var(--space-xs);
  margin-top: 2px;
  flex-wrap: wrap;
}

.food-result-macro {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.food-result-macro.cal { background: rgba(245,124,0,0.12); color: var(--color-calories); }
.food-result-macro.pro { background: rgba(211,47,47,0.12); color: var(--color-protein); }
.food-result-macro.carb { background: rgba(245,127,23,0.12); color: var(--color-carbs); }
.food-result-macro.fat { background: rgba(106,27,154,0.12); color: var(--color-fat); }
.food-result-per { font-size: 10px; color: var(--text-tertiary); align-self: center; }

.food-search-empty {
  padding: var(--space-md);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.food-search-source {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--space-xs);
  text-align: center;
}
