/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(60,48,40,0.35);
  backdrop-filter: blur(4px);
  z-index: 200;
  justify-content: center;
  align-items: flex-end;
}
.modal-overlay.open {
  display: flex;
}
.modal-overlay.top {
  align-items: flex-start;
  padding-top: 10vh;
}
.modal-overlay.top .modal {
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(60, 48, 40, 0.15);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease-out;
  box-shadow: 0 -4px 24px rgba(60, 48, 40, 0.12);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* Shopping list - Summary header */
.shop-summary {
  display: flex;
  justify-content: space-around;
  text-align: center;
  padding: 12px;
  margin-bottom: 16px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
}
.shop-summary-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
.shop-summary-label {
  font-size: 0.7rem;
  color: var(--text2);
  margin-top: 2px;
}

/* Shopping list - Category groups */
.shop-category {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.shop-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.shop-category-header:hover {
  background: var(--border);
}
.shop-category-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shop-category-icon {
  font-size: 1.1rem;
}
.shop-category-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}
.shop-category-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 600;
}
.shop-category-chevron {
  font-size: 0.8rem;
  color: var(--text2);
  transition: transform 0.2s;
}
.shop-category.collapsed .shop-category-chevron {
  transform: rotate(-90deg);
}
.shop-category-items {
  padding: 4px 14px;
}
.shop-category.collapsed .shop-category-items {
  display: none;
}

/* Shopping list - Ingredient items */
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}
.shop-item:last-child { border-bottom: none; }
.shop-item input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.shop-item-name {
  flex: 1;
  color: var(--text);
  transition: all 0.15s;
}
.shop-item-qty {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.78rem;
  white-space: nowrap;
  margin-left: 8px;
}
.shop-item.checked .shop-item-name {
  text-decoration: line-through;
  color: var(--text2);
  opacity: 0.6;
}
.shop-item.checked .shop-item-qty {
  text-decoration: line-through;
  opacity: 0.6;
}
