:root {
  --bg: #111327;
  --bg-dark: #0C0D1E;
  --accent: #D97706;
  --accent-dark: #BF571B;
  --text: #F2D091;
  --text-muted: #b6ab83;
  --border: #2E3155;
  --card: #1A1C3A;
  --radius-cat: 22px;
  --radius-plato: 10px;
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sticky header + nav ---------- */
.menu-sticky {
  position: sticky;
  top: 0;
  z-index: 20;
}

/* ---------- Header ---------- */
.menu-header {
  background: var(--bg-dark);
  color: var(--text);
  padding: 1.1rem 1.25rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.menu-header h1 { font-family: var(--font-heading); font-size: 1.7rem; letter-spacing: 0.5px; }
.menu-header .sub { color: var(--accent); font-size: 0.8rem; letter-spacing: 2px; text-transform: uppercase; margin-top: 0.3rem; }

/* ---------- View toggle ---------- */
.view-toggle {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  padding: 3px;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: none;
  background: transparent;
  color: #C6B98C;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s;
}

.view-btn svg { width: 16px; height: 16px; }

.view-btn:hover { color: #fff; }

.view-btn.active { background: var(--accent); color: var(--bg-dark); }
.view-btn.active:hover { color: var(--bg-dark); }

/* ---------- Category nav ---------- */
.cat-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1rem;
}

.cat-nav-inner {
  display: flex;
  flex: 1;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-chip {
  flex: 0 0 auto;
  padding: 0.45rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}

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

/* ---------- Body ---------- */
.menu-body { max-width: 900px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.categoria { margin-bottom: 2.5rem; scroll-margin-top: 160px; }

.categoria-titulo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--accent);
}

.categoria-titulo::before,
.categoria-titulo::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Category overview ---------- */
.cat-overview { margin-bottom: 3rem; }

.cat-overview-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.cat-card-img {
  width: 100%;
  height: 200px;
  border-radius: var(--radius-plato);
  overflow: hidden;
}

.cat-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.cat-card:hover .cat-card-img img { transform: scale(1.06); }

.cat-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.25rem 0;
  min-width: 0;
}

.cat-card-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
  transition: color 0.2s;
}

.cat-card:hover .cat-card-name { color: var(--accent); }

.cat-card-ornament {
  display: block;
  width: 84px;
  height: auto;
  color: var(--accent);
  opacity: 0.6;
  margin: 0.2rem 0 0.15rem;
}

.cat-card-count {
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Dish cards ---------- */
.platos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }

.plato-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-plato);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
  transition: transform 0.15s, box-shadow 0.15s;
}

.plato-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45); }

.plato-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--border);
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}

.plato-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.plato-media.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--text-muted);
  cursor: default;
  background: linear-gradient(135deg, #1A1C3A, #23264A);
  text-align: center;
  padding: 0.5rem;
  overflow: hidden;
}

.plato-media.placeholder .icon { font-size: 2rem; opacity: 0.5; }
.plato-media.placeholder .label { font-size: 0.8rem; letter-spacing: 0.5px; line-height: 1.3; }

.plato-info { padding: 1rem 1.1rem 1.2rem; }

.plato-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }

.plato-top h3 { font-size: 1.02rem; font-weight: 700; }

.plato-precio { font-weight: 700; color: var(--accent); white-space: nowrap; }

.plato-info p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.35rem; }

/* ---------- List view ---------- */
body.view-list .platos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

body.view-list .plato-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

body.view-list .plato-card:hover { transform: none; }

body.view-list .plato-media {
  order: 2;
  width: 100px;
  height: 100px;
  flex: 0 0 100px;
  aspect-ratio: auto;
  align-self: center;
  margin: 0.6rem;
  border-radius: 10px;
}

body.view-list .plato-info {
  order: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 1.1rem;
}

body.view-list .plato-media.placeholder .icon { font-size: 1.4rem; }
body.view-list .plato-media.placeholder .label { font-size: 0.7rem; }

/* ---------- Footer ---------- */
.menu-footer { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 1.5rem 1rem; }

.menu-flourish {
  display: block;
  margin: 0 auto 1rem;
  color: var(--accent);
  width: 120px;
  height: auto;
  opacity: 0.9;
}

.aviso-alergenos { font-size: 0.8rem; margin-top: 1rem; }

.cargando { text-align: center; color: var(--text-muted); padding: 3rem 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

/* ---------- Responsive ---------- */
@media (min-width: 640px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
  .cat-card { flex-direction: row; align-items: center; }
  .cat-card-img { flex: 0 0 80px; width: 80px; height: 80px; }
  .cat-card-body { gap: 0.3rem; padding: 0 0 0 1.1rem; }
  .cat-card-name { font-size: 1.3rem; line-height: 1.2; }
}

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