:root {
  --primary-blue: #00205b;
  --brand-orange: #e68632;
  --light-pink: #fbe1ea;
  --light-peach: #fbedE0;
  --dark-blue: #395c9c;
  --border: #d9d9d9;
  --radius: 10px;
  --bg: #ffffff;
  --text: #00205b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Poppins",
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* header */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-blue);
  color: #fff;
  padding: 10px 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

.icon-button {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}

/* flexible logo for any aspect ratio */
.logo {
  max-height: 40px;
  width: auto;
  border-radius: 0;
  object-fit: contain;
  display: block;
}

/* layout */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px 10px;   /* no top padding */
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 4px 0 0;        /* no extra space below */
}

@media (max-width: 640px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .view-toggle {
    align-self: flex-end;
  }
}

/* search */

.search-wrap {
  position: relative;
  flex: 1 1 240px;
}

/* short, flat search bar */
.search-input {
  width: 100%;
  padding: 2px 30px 2px 10px;
  border: 1px solid #fbdac1;
  border-radius: 12px;
  background: #fff7f0;
  font-size: 12px;
}

/* clear‑button behaviour */

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

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

.search-clear::before {
  content: "✕";
  font-size: 12px;
  line-height: 1;
  color: #9ca3af;
}

/* view toggle */

.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.view-label {
  font-size: 12px;
  color: #4b5563;
}

.view-btn {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  padding: 4px 8px;
  font-size: 11px;
  background: #fff;
  cursor: pointer;
}

.view-btn-active {
  background: #fbe1ea;
  border-color: #f97316;
}

/* category chips */

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 4px;       /* directly under search */
}

.chip {
  border-radius: 999px;
  border: 1px solid #fbdac1;
  background: #fff7f0;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.chip-active {
  background: #fbe1ea;
  border-color: #f97316;
}

/* sections */

.category-section {
  margin-top: 4px;
  margin-bottom: 24px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(to right, #fff7f0, #fff);
}

.category-header h2 {
  margin: 0;
  font-size: 18px;
}

.category-count {
  font-size: 12px;
  color: #888;
}

/* grid + cards */

.card-grid {
  display: grid;
  gap: 12px;
}

@media (max-width: 480px) {
  .card-grid.card-grid-tiles,
  .card-grid.card-grid-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 768px) {
  .card-grid.card-grid-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card.card-list {
  display: grid;
  grid-template-columns: 1.3fr 1.7fr;
}

@media (max-width: 640px) {
  .card.card-list {
    grid-template-columns: 1fr;
  }
}

.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.card-image-wrap {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: #f9fafb;
}

@media (min-width: 1024px) {
  .card-image-wrap {
    height: 180px;
  }
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-price {
  position: absolute;
  right: 8px;
  top: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
}

.card-media-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
}

.card-body {
  padding: 10px 12px 12px;
  background: #fffdf9;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.card-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: #666;
}

.card-tags {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid var(--border);
}

.tag-veg {
  border-color: #16a34a;
  color: #15803d;
  background: #dcfce7;
}

.tag-nonveg {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fee2e2;
}

.tag-light {
  background: var(--light-peach);
  color: var(--dark-blue);
}

/* overlay */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.overlay.hidden {
  display: none;
}

.overlay-inner {
  background: #000;
  color: #fff;
  max-width: 960px;
  width: 100%;
  max-height: 100vh;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1.7fr 1.1fr;
  padding: 12px env(safe-area-inset-right) 12px env(safe-area-inset-left);
}

@media (max-width: 768px) {
  .overlay-inner {
    height: 100%;
    border-radius: 12px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

.overlay-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: none;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
}

.overlay.hidden .overlay-close {
  display: none;
}

.overlay-media {
  position: relative;
  background: #000;
}

.media-container {
  width: 100%;
  height: 100%;
}

.media-item {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-item.hidden {
  display: none;
}

/* arrows */

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}

.nav-btn.prev {
  left: 10px;
}

.nav-btn.next {
  right: 10px;
}

@media (max-width: 640px) {
  .nav-btn {
    width: 28px;
    height: 28px;
  }
}

.overlay-info {
  background: #fff;
  color: var(--text);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.overlay-header h2 {
  margin: 0;
  font-size: 18px;
}

.overlay-category {
  margin: 2px 0 0;
  font-size: 12px;
  color: #888;
}

.overlay-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-orange);
}

.overlay-description {
  font-size: 13px;
}

.overlay-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
