@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Inter:wght@100..900&display=swap');

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

body {
  background-color: #f5f5f0;
  color: #1a1a1a;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Cormorant Garamond", serif;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: rgba(245, 245, 240, 0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
}

.header-content {
  padding: 1.5rem 0;
}

.brand-section {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .brand-section {
    flex-direction: row;
    align-items: center;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  width: 3rem;
  height: 3rem;
  background-color: #5A5A40;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.search-section {
  flex: 1;
  max-width: 28rem;
}

.search-input-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  font-size: 1rem;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #5A5A40;
  box-shadow: 0 0 0 4px rgba(90, 90, 64, 0.1);
}

.categories-nav {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.categories-nav::-webkit-scrollbar { display: none; }
.categories-nav { -ms-overflow-style: none; scrollbar-width: none; }

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9ca3af;
  padding-right: 0.5rem;
  border-right: 1px solid #e5e7eb;
}

.category-pill {
  padding: 0.5rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  background-color: #ffffff;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}

.category-pill:hover { background-color: #f9fafb; }

.category-pill.active {
  background-color: #5A5A40;
  color: #ffffff;
  border-color: #5A5A40;
  box-shadow: 0 10px 15px -3px rgba(90, 90, 64, 0.2);
}

.main-content {
  margin-top: 2rem;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.results-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
}

.results-count {
  margin-left: 0.75rem;
  font-size: 0.875rem;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  color: #9ca3af;
  font-weight: 400;
}

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-secondary:hover { background-color: #f9fafb; }

.meals-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 640px) { .meals-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .meals-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .meals-grid { grid-template-columns: repeat(4, 1fr); } }

.meal-card {
  background-color: #ffffff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.2s;
  cursor: pointer;
}

.meal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.meal-image-container {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
}

.meal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.meal-card:hover .meal-image { transform: scale(1.1); }

.meal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s;
}

.meal-card:hover .meal-overlay { background-color: transparent; }

.meal-info {
  padding: 1rem;
}

.meal-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.loader-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
  gap: 1rem;
}

.animate-spin {
  animation: spin 1s linear infinite;
  color: #5A5A40;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
  text-align: center;
}

.empty-icon {
  width: 5rem;
  height: 5rem;
  background-color: #f3f4f6;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  margin-bottom: 1rem;
}

.filter-text {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.loader-text {
  color: #6b7280;
  font-weight: 500;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.empty-subtitle {
  color: #6b7280;
  margin-top: 0.5rem;
}

.modal-wrapper {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

@media (min-width: 640px) { .modal-wrapper { padding: 1.5rem; } }

.modal-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  width: 100%;
  max-width: 56rem;
  max-height: 90vh;
  background-color: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) { .modal-content { flex-direction: row; } }

.modal-image-section {
  width: 100%;
  height: 16rem;
  position: relative;
}

@media (min-width: 768px) { .modal-image-section { width: 50%; height: auto; } }

.modal-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-badges {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: 0.5rem;
}

.badge {
  padding: 0.25rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5A5A40;
}

.modal-details-section {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}

.btn-close {
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s;
  border: none;
  background: none;
}

.btn-close:hover { background-color: #f3f4f6; }

.modal-section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5A5A40;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "";
  width: 2rem;
  height: 1px;
  background-color: rgba(90, 90, 64, 0.3);
}

.ingredients-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) { .ingredients-grid { grid-template-columns: repeat(2, 1fr); } }

.ingredient-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #f3f4f6;
}

.ingredient-name { font-weight: 500; color: #374151; }
.ingredient-measure { font-size: 0.875rem; color: #9ca3af; }

.instructions-text {
  color: #4b5563;
  line-height: 1.625;
  white-space: pre-line;
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

.btn-youtube {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #dc2626;
  color: #ffffff;
  border-radius: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s;
  box-shadow: 0 10px 15px -3px rgba(220, 38, 38, 0.2);
}

.btn-youtube:hover { background-color: #b91c1c; }

.footer {
  margin-top: 5rem;
  border-top: 1px solid #e5e7eb;
  padding: 3rem 0;
  background-color: #ffffff;
}

.footer-content {
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #5A5A40;
  margin-bottom: 1rem;
}

.footer-title {
  font-size: 1.25rem;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
}

.footer-text {
  font-size: 0.875rem;
  color: #9ca3af;
}

.modal-details-section::-webkit-scrollbar { width: 6px; }
.modal-details-section::-webkit-scrollbar-track { background: transparent; }
.modal-details-section::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.modal-details-section::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
