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

body {
  font-family: 'Poppins', sans-serif;
  background-color: #FFF8F0;
  color: #4A2C1F;
}

.header {
  text-align: center;
  padding: 40px 20px 20px;
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: #C1502E;
}

.subtitle {
  color: #8B5E4A;
  margin-top: 8px;
  font-size: 1rem;
}

.search-section {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  flex-wrap: wrap;
}

#searchInput {
  width: 320px;
  padding: 12px 18px;
  border: 2px solid #E8C4A0;
  border-radius: 30px;
  font-size: 1rem;
  outline: none;
  font-family: 'Poppins', sans-serif;
  transition: border-color 0.3s;
}

#searchInput:focus {
  border-color: #C1502E;
}

#searchBtn {
  padding: 12px 28px;
  background-color: #C1502E;
  color: #fff;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

#searchBtn:hover {
  background-color: #A33D1F;
}

.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 20px 30px;
}

.tab {
  padding: 8px 20px;
  border: 2px solid #E8C4A0;
  border-radius: 20px;
  background: #fff;
  color: #8B5E4A;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.tab.active,
.tab:hover {
  background-color: #C1502E;
  color: #fff;
  border-color: #C1502E;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  padding: 0 40px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.recipe-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(193, 80, 46, 0.1);
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

.recipe-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(193, 80, 46, 0.2);
}

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

.recipe-card-info {
  padding: 14px 16px;
}

.recipe-card-info h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #4A2C1F;
}

.recipe-card-info span {
  font-size: 0.85rem;
  color: #C1502E;
  font-weight: 600;
}

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

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

.fav-btn.active {
  color: #C1502E;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(74, 44, 31, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #FFF8F0;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: #8B5E4A;
}

.modal-content h2 {
  font-family: 'Playfair Display', serif;
  color: #C1502E;
  margin-bottom: 6px;
}

.modal-content .modal-category {
  color: #8B5E4A;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.modal-content img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 16px;
}

.modal-content h4 {
  margin: 16px 0 8px;
  color: #4A2C1F;
}

.modal-content ul {
  padding-left: 20px;
}

.modal-content ul li {
  margin-bottom: 6px;
}

.modal-content p {
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 480px) {
  #searchInput {
    width: 100%;
  }
  .header h1 {
    font-size: 2rem;
  }
}