:root {
  --pink: #fb4c97;
  --pink-dark: #d93a7e;
  --text: #222;
  --muted: #666;
  --card: #fff;
  --form-bg: rgba(255, 255, 255, 0.95);
  --surface-2: #f7f7f7;
  --border: #eee;
  --input-border: #ccc;
  --chip-bg: rgba(255, 255, 255, 0.85);
  --badge-bg: #e3f5df;
  --success-bg: #e3f5df;
  --green: #247d18;
  --error: #c62828;
  --page-shade: rgba(0, 0, 0, 0);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --pink-dark: #ff7ab3;
  --text: #ececf1;
  --muted: #a7a7b3;
  --card: #1e1e24;
  --form-bg: rgba(30, 30, 36, 0.96);
  --surface-2: #2a2a32;
  --border: #33333c;
  --input-border: #4a4a55;
  --chip-bg: rgba(30, 30, 36, 0.85);
  --badge-bg: #1c3a1f;
  --success-bg: #16331a;
  --green: #7fd47a;
  --error: #ff8a80;
  --page-shade: rgba(0, 0, 0, 0.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif;
  color: var(--text);
  background-color: var(--pink);
  background-image: linear-gradient(var(--page-shade), var(--page-shade)), url("img/background.jpg");
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

main {
  flex: 1;
}

:root[lang="ar"] body {
  font-family: Tahoma, Arial, sans-serif;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Header ---------- */
header {
  background-color: var(--pink);
  color: white;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom-left-radius: 25px;
  border-bottom-right-radius: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.logo {
  color: white;
  font-size: 26px;
  font-weight: bold;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a,
.cart-button {
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 20px;
  transition: background-color 0.2s ease;
}

nav a:hover,
nav a[aria-current="page"],
.cart-button:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.cart-button {
  background: white;
  color: var(--pink);
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.cart-button:hover {
  background: #ffe3ef;
}

.toggle {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: bold;
  font-family: inherit;
  cursor: pointer;
}

.toggle:hover {
  background: rgba(255, 255, 255, 0.35);
}

.cart-count {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  margin-inline-start: 4px;
  border-radius: 11px;
  background: var(--pink);
  color: white;
  font-size: 13px;
  text-align: center;
}

/* ---------- Hero and toolbar ---------- */
.hero {
  max-width: 720px;
  margin: 30px auto 0;
  text-align: center;
  color: white;
  padding: 24px 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.45);
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 5vw, 40px);
}

.hero p {
  margin: 0;
  font-size: 18px;
}

.toolbar {
  max-width: 1200px;
  margin: 20px auto 0;
  padding: 0 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

#search {
  width: 100%;
  max-width: 480px;
  padding: 12px 18px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  border: 2px solid white;
  background: var(--chip-bg);
  color: var(--pink-dark);
  font-weight: bold;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

.chip[aria-pressed="true"] {
  background: var(--pink);
  color: white;
}

/* ---------- Menu ---------- */
.menu {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
  padding: 30px;
}

.dish {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dish:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.dish img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.dish-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dish-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dish h2 {
  margin: 0;
  font-size: 19px;
}

.badge {
  background: var(--badge-bg);
  color: var(--green);
  font-size: 12px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 10px;
}

.dish-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  margin: 8px 0 14px;
  flex: 1;
}

.dish-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price {
  font-weight: bold;
  font-size: 18px;
  color: var(--pink-dark);
}

.empty {
  text-align: center;
  color: var(--muted);
}

main > .empty {
  color: white;
  font-size: 18px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* ---------- Buttons ---------- */
.primary {
  background-color: var(--pink);
  color: white;
  border: none;
  padding: 12px;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.primary:hover {
  background-color: var(--pink-dark);
}

.primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.primary.whatsapp {
  background-color: #1f9e55;
}

.primary.whatsapp:hover {
  background-color: #17804a;
}

.primary.whatsapp:disabled {
  background-color: #ccc;
}

.note {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 0;
}

.success a {
  color: var(--green);
  font-weight: bold;
}

.primary.small {
  width: auto;
  padding: 8px 14px;
  font-size: 14px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #ffd54f;
  outline-offset: 2px;
}

/* ---------- Cart ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
}

.cart {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(380px, 100%);
  background: var(--card);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
}

.cart.open {
  transform: translateX(0);
}

[dir="rtl"] .cart {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
}

[dir="rtl"] .cart.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.cart-header h2 {
  margin: 0;
}

.icon-button {
  background: none;
  border: none;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.cart-items {
  list-style: none;
  margin: 0;
  padding: 10px 20px;
  overflow-y: auto;
  flex: 1;
}

.cart-items li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cart-items img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.quantity button:hover {
  border-color: var(--pink);
}

.cart-footer {
  padding: 16px 20px 22px;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  margin-bottom: 12px;
}

/* ---------- Booking form ---------- */
.form-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 16px;
}

.form-container {
  background: var(--form-bg);
  padding: 28px;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.form-container h1 {
  margin: 0 0 4px;
  text-align: center;
}

.hint {
  text-align: center;
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 14px;
}

.form-container label {
  display: block;
  margin-top: 12px;
  font-weight: bold;
  font-size: 14px;
}

.form-container input {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: var(--card);
  color: var(--text);
}

.form-container input[aria-invalid="true"] {
  border-color: var(--error);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.error {
  color: var(--error);
  font-size: 13px;
  margin: 4px 0 0;
  min-height: 1em;
}

.form-container .primary {
  margin-top: 20px;
}

.success {
  background: var(--success-bg);
  color: var(--green);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  line-height: 1.4;
}

.success p {
  margin: 6px 0 0;
}

/* ---------- Footer ---------- */
footer {
  background-color: var(--pink);
  color: white;
  text-align: center;
  padding: 15px 0;
  font-size: 14px;
  margin-top: 40px;
  border-radius: 30px 30px 0 0;
}

footer p {
  margin: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  header {
    justify-content: center;
    padding: 12px 16px;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu,
  .toolbar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    margin: 20px 16px 0;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}
