/* --- Global Resets & Variables --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --dark-green: #0e3d26;
  --cream-bg: #fffcd1;
  --orange-primary: #ff7a00;
  --text-dark: #111111;
  --text-light: #ffffff;
  --text-muted: #706f5b;
  --white-bg: #ffffff;
}

body {
  font-family: "Plus Jakarta Sans", sans-serif;
  background-color: var(--cream-bg);
  color: var(--text-dark);
}

/* --- Navigation Header --- */
.header {
  background-color: var(--dark-green);
  color: var(--text-light);
  padding: 20px 80px;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
}

.navbar .logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.5px;
}

.navbar .logo a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-link {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.95;
  padding: 9px 18px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* Logged-in account chip (rendered by site.js) */
.nav-account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-light);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  background-color: rgba(255, 122, 0, 0.25);
  border: 1px solid rgba(255, 122, 0, 0.6);
}

.nav-logout-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-light);
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.nav-logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.22);
}

/* --- Search & Filter Utility Bar --- */
.utility-bar {
  background-color: var(--white-bg);
  padding: 14px 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 50;
}

.search-container {
  display: flex;
  align-items: center;
  background-color: #f1f1f1;
  border-radius: 30px;
  padding: 9px 18px;
  width: 340px;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-container:focus-within {
  background-color: #fff;
  box-shadow: 0 0 0 2px var(--orange-primary);
}

.search-icon {
  display: flex;
  align-items: center;
  color: #666;
  margin-right: 10px;
}

.search-container input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  color: var(--text-dark);
}

.clear-search[hidden] {
  display: none;
}

.clear-search {
  border: none;
  background: #ddd;
  color: #444;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.clear-search:hover {
  background: #ccc;
}

.filter-wrapper {
  position: relative;
  display: inline-block;
}

.filter-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #111;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.filter-btn:hover {
  background-color: #f5f5f5;
}

.arrow-icon {
  transition: transform 0.25s ease;
  display: flex;
}

.filter-btn.active .arrow-icon {
  transform: rotate(180deg);
}

/* Filter dropdown */
.filter-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 350px;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 100;
}

.filter-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.filter-section + .filter-section {
  margin-top: 20px;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #222;
}

.chip-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: #999;
}

.chip.active {
  background: var(--dark-green);
  color: #fff;
  border-color: var(--dark-green);
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 0.85rem;
  color: #222;
}

.filter-option:hover {
  background: #f5f5f5;
}

.filter-option input {
  display: none;
}

.filter-option .checkmark {
  opacity: 0;
  font-size: 0.8rem;
  color: var(--dark-green);
  font-weight: 700;
}

.filter-option:has(input:checked) {
  background: #f0f0f0;
  font-weight: 600;
}

.filter-option input:checked + .label-text + .checkmark {
  opacity: 1;
}

/* --- Browse Main Layout --- */
.browse-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 40px 80px;
}

/* Category tab row */
.main-category-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  border-bottom: 2px solid rgba(14, 61, 38, 0.1);
  padding-bottom: 16px;
  overflow-x: auto;
}

.tab-btn {
  padding: 11px 22px;
  border-radius: 30px;
  border: 2px solid var(--dark-green);
  background-color: transparent;
  color: var(--dark-green);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background-color: rgba(14, 61, 38, 0.05);
}

.tab-btn.active {
  background-color: var(--dark-green);
  color: var(--text-light);
  box-shadow: 0 4px 12px rgba(14, 61, 38, 0.15);
}

.view-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 24px;
  color: var(--dark-green);
  letter-spacing: -0.5px;
}

/* --- Restaurant Cards Grid --- */
.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px 20px;
  margin-bottom: 40px;
}

.food-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  animation: cardIn 0.4s ease forwards;
}

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

.food-card {
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  padding: 10px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.25s ease;
  height: 100%;
}

.food-card-link:hover .food-card {
  transform: translateY(-5px);
  background: #ffffff;
  border-color: var(--orange-primary);
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.14);
}

.image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background-color: #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.food-card-link:hover .image-wrapper img {
  transform: scale(1.05);
}

.badge-hours {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(14, 61, 38, 0.85);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.card-body {
  padding: 0 6px 6px 6px;
  text-align: left;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.card-label {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark-green);
  background: rgba(14, 61, 38, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.card-rating svg {
  color: #f5a623;
}

.card-sub {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- Empty search state --- */
.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  color: rgba(14, 61, 38, 0.35);
  margin-bottom: 14px;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark-green);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.95rem;
}

/* --- Map Search Anchor --- */
.map-link-wrapper {
  margin-top: 20px;
  margin-bottom: 40px;
}

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--dark-green);
  text-decoration: none;
  border-bottom: 3px solid var(--orange-primary);
  padding-bottom: 6px;
  transition: gap 0.2s ease;
}

.map-link:hover {
  gap: 16px;
}

.inline-arrow {
  display: flex;
}

/* --- Footer Section --- */
.footer {
  background-color: var(--dark-green);
  color: var(--text-light);
  padding: 70px 80px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
}

.footer-brand h3 {
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 24px;
}

.footer-brand h3 a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.social-icons {
  display: flex;
  gap: 16px;
  align-items: center;
}

.social-icons a {
  color: var(--text-light);
  opacity: 0.8;
  transition: opacity 0.2s ease;
  display: inline-flex;
}

.social-icons a:hover {
  opacity: 1;
}

.footer-links {
  display: flex;
  gap: 70px;
  flex-wrap: wrap;
}

.footer-column h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.9);
}

.footer-column ul {
  list-style: none;
}

.footer-column ul li {
  margin-bottom: 12px;
}

.footer-btn {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.footer-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
  .header, .utility-bar, .browse-container, .footer {
    padding-left: 40px;
    padding-right: 40px;
  }
}

@media (max-width: 768px) {
  .header, .utility-bar, .browse-container, .footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .utility-bar {
    gap: 10px;
  }

  .search-container {
    width: 100%;
  }

  .restaurant-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .footer-grid {
    flex-direction: column;
  }
}
