@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg-main: #fcf9f2; /* Very light warm cream */
  --bg-secondary: #f4ecdf; /* Slightly darker cream for header/hero bg */
  --bg-card: #ffffff;
  
  --text-maroon: #4a1515; /* Brand dark red/maroon */
  --text-dark: #2c2420; /* Dark brown/grey for body text */
  --text-muted: #5c504a; /* Muted text for descriptions */
  
  --accent-gold: #c69a40; /* Mustard/Gold button color */
  --accent-gold-hover: #b08736;
  
  --border: #e6dac6;
  --success: #10b981;
  --error: #ef4444;

  --font-serif: 'Libre Baskerville', serif;
  --font-sans: 'Nunito', sans-serif;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M50 10C55 30 70 45 90 50C70 55 55 70 50 90C45 70 30 55 10 50C30 45 45 30 50 10Z" fill="none" stroke="%23ebdcc2" stroke-width="1" opacity="0.3"/></svg>');
  background-size: 200px 200px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--text-maroon);
}

/* --- TOP HEADER --- */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-secondary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.icon-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--accent-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn {
  background: var(--accent-gold);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.25rem;
}

.logo {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo-icon {
  font-size: 2rem;
  color: var(--text-maroon);
}
.logo h1 {
  font-size: 1.2rem;
  letter-spacing: 1px;
  margin: 2px 0 0;
}
.logo span {
  font-size: 0.7rem;
  color: var(--text-maroon);
  letter-spacing: 2px;
}

.nav-actions {
  display: flex;
  gap: 12px;
}
.cart-btn {
  position: relative;
  color: var(--text-maroon);
}
.cart-btn .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--text-maroon);
  color: white;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- HERO SECTION --- */
.hero {
  position: relative;
  margin: 1rem;
  border-radius: 16px;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  background-color: #5a4033; /* fallback */
}
.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(74, 21, 21, 0.4), rgba(44, 36, 32, 0.8));
  z-index: 2;
}
.hero-content {
  position: relative;
  z-index: 3;
  color: white;
}
.hero-content h2 {
  color: white;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hero-content p {
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  opacity: 0.9;
}
.primary-btn {
  background: var(--accent-gold);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(198, 154, 64, 0.4);
}

/* --- CONTAINER --- */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

/* --- MENU HEADER & FILTERS --- */
.menu-header-title h2 {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1rem;
}
.menu-header-title h2 span {
  font-size: 1.2rem;
  font-family: var(--font-sans);
  letter-spacing: 1px;
  color: var(--text-maroon);
}
.menu-header-title h2 i {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.category-filters {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 1rem;
  scrollbar-width: none; /* Firefox */
}
.category-filters::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--accent-gold);
  color: var(--text-maroon);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active {
  background: var(--accent-gold);
  color: white;
}

/* --- MENU SECTION TITLES --- */
.section-title {
  font-size: 1.4rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-maroon);
}

/* --- MENU CARDS --- */
.menu-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 12px;
  margin-bottom: 1rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.item-photo {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-secondary);
}
.item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}
.item-name {
  font-size: 1rem;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
}
.item-price {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1rem;
}
.item-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-bottom: 8px;
  flex: 1;
}
.item-actions {
  display: flex;
  justify-content: flex-end;
}
.add-btn {
  background: var(--accent-gold);
  color: white;
  border: none;
  padding: 4px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(198, 154, 64, 0.3);
}

.sold-out {
  opacity: 0.6;
}
.sold-out-text {
  color: var(--error);
  font-size: 0.8rem;
  font-weight: 700;
}


/* --- ADMIN PANEL --- */
.admin-login {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  max-width: 320px;
  margin: 20vh auto 0;
  text-align: center;
}

.input-field {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-main);
  color: var(--text-dark);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  margin-bottom: 1rem;
}
.input-field:focus {
  border-color: var(--accent-gold);
}

.admin-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.admin-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.admin-item-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.stock-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.stock-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-maroon);
  font-weight: 700;
  font-size: 1.1rem;
}
.stock-btn:hover {
  background: var(--bg-secondary);
}
.stock-input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-dark);
  outline: none;
}
.editable-price {
  background: var(--bg-main);
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  font-weight: 700;
}

/* Admin Add Form */
.admin-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 2rem;
}
.admin-form h3 {
  margin-bottom: 12px;
}
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-muted);
}
textarea.input-field {
  resize: vertical;
  min-height: 60px;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border);
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-maroon);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
