@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');
body {
    overflow-x: hidden;
}

p,
h1,
h2,
h3,
h4,
span,
div {
    overflow-wrap: anywhere;
}
:root {
  --primary: #ef0031;
  --text: #222;
  --muted: #666;
  --border: #ccc;
  --card-shadow: 0 3px 5px -1px rgb(0 0 0 / 20%), 0 5px 8px 0 rgb(0 0 0 / 14%),
    0 1px 14px 0 rgb(0 0 0 / 12%);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', Arial, sans-serif;
  color: var(--text);
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

.menu-container {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 12px 40px;
}

.menu-content {
  transition: opacity 0.18s ease;
}

.menu-container.is-loading .menu-content {
  opacity: 0.45;
  pointer-events: none;
}

.menu-heading {
  margin: 50px 0 5px;
}

.menu-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.category-card {
  position: relative;
  min-height: 200px;
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background-position: center;
  background-size: cover;
}

.category-card-overlay {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 10px;
  min-height: 65px;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
}

.category-carousel {
  display: flex;
  gap: 0;
  overflow-x: auto;
  margin: 50px -2px 0;
  padding: 10px 2px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.category-carousel-item {
  position: relative;
  flex: 0 0 210px;
  height: 140px;
  margin: 0 10px;
  scroll-snap-align: start;
  border-radius: 0;
  overflow: hidden;
}

.category-carousel-item.active .category-carousel-label span {
  border-bottom: 3px solid #fff;
  padding-bottom: 4px;
}

.category-carousel-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-carousel-label {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.category-carousel-all {
  flex: 0 0 115px;
  min-height: 140px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  scroll-snap-align: start;
}

.category-all-icon {
  font-size: 36px;
  line-height: 1;
}

.product-heading {
  margin-top: 28px;
}

.category-description {
  color: var(--muted);
  margin: 8px 0 0;
}

.menu-loader {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 900;
  transform: translate(-50%, -50%);
}

.menu-loader span {
  display: block;
  width: 42px;
  height: 42px;
  border: 4px solid rgba(239, 0, 49, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: menu-spin 0.7s linear infinite;
}

@keyframes menu-spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .category-carousel-item {
    flex-basis: calc(50vw - 30px);
    height: 125px;
  }
  .category-carousel-all { flex-basis: 105px; min-height: 125px; }
}

.product-card {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 10px;
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  background: #fff;
}

.product-card img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.product-price {
  color: var(--primary);
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}

.product-name {
  margin: 0 0 6px;
  font-size: 16px;
}

.product-description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-backdrop.open {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
}

.modal-content img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 12px;
}

.modal-close {
  float: right;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.admin-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.admin-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-nav form { margin: 0; }

.admin-nav a,
.admin-nav button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font: inherit;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border: 1px solid #ddd;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.admin-form {
  display: grid;
  gap: 12px;
  max-width: 520px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.admin-form button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.login-box {
  max-width: 420px;
  margin: 80px auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.error-text {
  color: #b00020;
  font-size: 14px;
}

.success-text {
  color: #0a7a2f;
  font-size: 14px;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--primary);
  font-weight: 600;
}
