* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Helvetica Neue, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a;
  background: #f8fafc;
}

/* Container */
main.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Search row */
.search-row {
  width: 100%;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.search {
  width: 100%;
  max-width: 400px;
  padding: 0.5em 1em;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Products grid using flex */
.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  width: 100%;
}

/* Product card responsiveness */
.product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: box-shadow 0.2s;
  width: 300px;
  min-width: 260px;
  max-width: 100%;
  margin: 0.5rem 0;
}

.product-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.media {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.content {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
}

.product-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.9rem;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  background: #eee;
}

.actions {
  margin-bottom: 0.5rem;
}

.btn {
  padding: 0.5em 1em;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background: #0078d4;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #005fa3;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 2rem 0;
}

/* Status message */
.status {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .product-card {
    width: 45vw;
    min-width: 200px;
  }
}

@media (max-width: 600px) {
  .products-grid {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  .product-card {
    width: 90vw;
    min-width: 0;
  }
  .search {
    max-width: 100%;
    font-size: 0.95rem;
  }
  .content {
    padding: 0.7rem;
  }
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 0 28px;
}
.pagination button {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: white;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.pagination button[disabled] {
  opacity: 0.5;
  cursor: default;
}
.pagination .page-info {
  color: #475569;
  font-size: 14px;
}

.pagination .page-numbers {
  display: flex;
  gap: 8px;
}
.pagination .page-number.is-active {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: white;
}

/* --- Card --- */
.product-card {
  display: flex;
  width: 100%;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(2, 6, 23, 0.05);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px 0 40px;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.08);
}
.media {
  aspect-ratio: 16/10;
  background: #f1f5f9;
}
.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.content {
  padding: 12px 14px 16px;
}
.product-title {
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 8px;
}
.product-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.actions {
  margin-top: 10px;
}
.btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: white;
  color: #0f172a;
  padding: 8px 12px;
  border-radius: 10px;
  width: 100%;
  cursor: pointer;
}
.btn:hover {
  background: #f1f5f9;
}
.badge {
  font-size: 12px;
  color: #0f172a;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 4px 8px;
}
.badge.time::before {
  content: "⏱ ";
}
.badge.servings::before {
  content: "🍽 ";
}
