* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #faf7f2;
  color: #2c2c2c;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  background: linear-gradient(135deg, #d45d3b 0%, #c0392b 100%);
  color: #fff;
  text-align: center;
  padding: 60px 20px 40px;
}

.header h1 {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 30px;
}

.search-bar input {
  width: 100%;
  max-width: 500px;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  outline: none;
  transition: background 0.3s;
}

.search-bar input::placeholder { color: rgba(255,255,255,0.6); }
.search-bar input:focus { background: rgba(255,255,255,0.25); }

.filter-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tag {
  padding: 8px 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 25px;
  background: transparent;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tag:hover, .tag.active {
  background: #fff;
  color: #c0392b;
  border-color: #fff;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 30px;
  padding: 50px 0;
}

.recipe-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.recipe-card-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.recipe-card-body {
  padding: 20px;
}

.recipe-card-body h2 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.recipe-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 10px;
}

.recipe-card-body p {
  font-size: 0.93rem;
  color: #666;
  line-height: 1.5;
}

.recipe-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f0f0f0;
}

.btn-open {
  background: #d45d3b;
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-open:hover { background: #c0392b; }

.btn-fav {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.2s;
  line-height: 1;
}

.btn-fav:hover { transform: scale(1.2); }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 20px;
  max-width: 720px;
  width: 100%;
  position: relative;
  animation: modalIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
}

.modal-close:hover { background: rgba(0,0,0,0.7); }

.modal-img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.modal-body {
  padding: 30px;
}

.modal-body h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.modal-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: #888;
}

.modal-body h3 {
  font-size: 1.1rem;
  margin: 20px 0 10px;
  color: #d45d3b;
}

.ingredients-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}

.ingredients-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 0.95rem;
}

.ingredients-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  background: #d45d3b;
  border-radius: 50%;
}

.instructions-list {
  list-style: none;
  counter-reset: step;
}

.instructions-list li {
  counter-increment: step;
  padding: 8px 0 8px 40px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.6;
}

.instructions-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 28px;
  height: 28px;
  background: #d45d3b;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.footer {
  text-align: center;
  padding: 30px;
  color: #999;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
}

@media (max-width: 768px) {
  .header h1 { font-size: 2rem; }
  .recipes-grid { grid-template-columns: 1fr; }
  .ingredients-list { grid-template-columns: 1fr; }
  .modal-img { height: 220px; }
  .modal-body { padding: 20px; }
  .modal-body h2 { font-size: 1.4rem; }
}
