/* CSS Variables for Light and Dark Mode */
:root {
  /* Light Mode Colors */
  --primary-color: #6c5ce7;
  --primary-hover: #5f3dc4;
  --secondary-color: #fd79a8;
  --accent-color: #00b894;
  --warning-color: #fdcb6e;
  --danger-color: #e84393;

  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-light: #b2bec3;
  --text-white: #ffffff;

  --border-color: #ddd;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 5px 20px rgba(0, 0, 0, 0.15);
  --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.2);

  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;

  --transition: all 0.3s ease;

  /* Glassmorphism Navbar Colors */
  --bg-rgb-light: 255, 255, 255;
  --bg-rgb-dark: 18, 18, 18;

  /* Navbar offset to account for fixed navbar height and keep content below it */
  --navbar-height: 80px; /* default desktop */
}

/* Dark Mode Colors */
html[data-theme="dark"] {
  --primary-color: #74b9ff;
  --primary-hover: #0984e3;
  --secondary-color: #fd79a8;
  --accent-color: #00b894;
  --warning-color: #fdcb6e;
  --danger-color: #e84393;

  --bg-primary: #1a1a1a;
  --bg-secondary: #2d3436;
  --bg-tertiary: #636e72;
  --bg-gradient: linear-gradient(135deg, #2d3436 0%, #636e72 100%);

  --text-primary: #ddd;
  --text-secondary: #b2bec3;
  --text-light: #74b9ff;
  --text-white: #ffffff;

  --border-color: #636e72;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 5px 20px rgba(0, 0, 0, 0.4);
  --shadow-heavy: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* CSS for All - modern, mobile-first */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-weight: 400;
  padding-top: var(--navbar-height);
  transition: padding-top 0.25s ease;
}

/* Remove extra black gap under fixed navbar caused by sibling margins */
/* This override ensures pages are positioned right below the fixed navbar
   while body padding (using --navbar-height) handles the offset. */
.navbar + .food-search,
.navbar + .container,
.navbar + section {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Also reset any leftover inline-like spacing selectors added earlier */
.navbar + .food-search[style],
.navbar + .container[style] {
  margin-top: 0 !important;
}

/* Fluid container with comfortable max width */
.container {
  width: 92%;
  max-width: 1100px; /* slightly narrower so cards look larger */
  margin: 0 auto;
  padding: 1rem 0;
}

/* Images and media */
.img-responsive,
img,
video,
iframe {
  display: block;
  max-width: 100%;
  height: auto;
}
.img-curve {
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-light);
}

/* Text alignment helpers */
.text-right {
  text-align: right;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-white {
  color: var(--text-white);
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center; /* vertical centering */
  justify-content: center; /* horizontal centering */
  text-align: center; /* fallback for non-flex contexts */
  gap: 0.5rem;
}

/* Ensure native button and input-based buttons center their content */
button,
input[type="button"],
input[type="submit"],
.btn {
  display: inline-flex; /* allow vertical/horizontal centering */
  align-items: center;
  justify-content: center;
  text-align: center;
}
.btn-primary {
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--text-white);
  box-shadow: var(--shadow-light);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* Theme toggle */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Headlines */
h1,
h2,
h3 {
  font-weight: 700;
  color: var(--text-primary);
}
h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
h3 {
  font-size: 1.125rem;
}

.float-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-md);
  transition: var(--transition);
}
.float-container:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-heavy);
}
.float-text {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
}

fieldset {
  border: 1px solid var(--border-color);
  padding: 1rem;
  border-radius: 10px;
  background: var(--bg-secondary);
}

/* CSS for navbar section */
.navbar {
  background: var(--bg-primary);
  box-shadow: var(--shadow-light);
  padding: 0.25rem 0;
  position: relative;
  z-index: 1000;
  backdrop-filter: blur(6px);
  transition: background 0.3s ease, backdrop-filter 0.3s ease,
    box-shadow 0.3s ease;
  height: var(--navbar-height);
  min-height: var(--navbar-height);
  display: flex;
  align-items: center;
}
.navbar.scrolled {
  background: rgba(var(--bg-rgb-light), 0.25);
  backdrop-filter: blur(40px) saturate(1.8) brightness(1.15);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
}
.logo img {
  max-height: 44px;
  transition: var(--transition);
}
.logo img:hover {
  transform: scale(1.1);
}

/* Dark mode logo adjustment - invert colors to make black text white */
html[data-theme="dark"] .logo img {
  filter: invert(1) brightness(1.2);
}

.menu {
  flex: 1;
}
.menu ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
}

/* When menu has text-right class, align items to the right */
.menu.text-right ul {
  justify-content: flex-end;
}

.menu ul li {
  display: inline-block;
  font-weight: 600;
}

.menu ul li a {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
}

.menu ul li a:hover {
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--text-white);
  transform: translateY(-2px);
}

.navbar .theme-toggle {
  margin-left: 0.5rem;
}

/* Navbar Controls Container */
.navbar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Language Selector */
.language-selector {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
}

.language-selector:hover {
  background: var(--bg-tertiary);
  border-color: var(--primary-color);
}

.language-selector:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2);
}

/* RTL (Arabic) Support */
.rtl {
  direction: rtl;
}

/* Mobile Menu Toggle Button (Hamburger Menu) */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger-line {
  width: 100%;
  height: 3px;
  background: var(--text-primary);
  border-radius: 3px;
  transition: var(--transition);
}

/* Hamburger Animation */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* CSS for Food Search Section */

.food-search {
  background: var(--bg-gradient);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  padding: 3.5rem 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48vh; /* controls vertical space; adjust if needed */
  padding: 0; /* remove asymmetric padding */
}

/* make overlay sit behind content */
.food-search::before {
  z-index: 0;
}

/* ensure container/content sit above the overlay and are centered */
.food-search .container {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 1rem;
  padding: 0 1rem; /* small horizontal breathing room */
}

/* Center the search form itself and make it a single centered row */
.food-search form,
.food-search > .container > form {
  width: 100%;
  max-width: 900px;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2; /* ensure form is on top */
}

.food-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 220px;
  padding: 18px 22px;
  border-radius: 12px;
  border: none;
  outline: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.95);
}

.food-search input[type="submit"],
.food-search .btn {
  flex: 0 0 auto;
  padding: 12px 20px;
  border-radius: 12px;
}

/* Responsive: make hero slightly taller on small screens and stack form vertically */
@media (max-width: 768px) {
  .food-search {
    min-height: 40vh;
  }
  .food-search form {
    flex-direction: column;
    gap: 0.75rem;
  }
  .food-search input[type="search"] {
    width: 100%;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  }
}
.food-search::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.food-search .container {
  display: flex;
  align-items: center; /* vertical centering */
  justify-content: center; /* horizontal centering */
  min-height: calc(var(--navbar-height) * 3.5); /* give the hero some height */
  padding: 2rem 0; /* reduce top/bottom padding for tighter layout */
}

.food-search h2 {
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
}

/* Make sure overlay doesn't block centering */
.food-search::before {
  z-index: 1;
}

/* Grid layouts for categories and food cards */
.categories .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.food-menu {
  padding: 1.25rem 0;
}
.food-menu .food-menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
.food-menu .food-menu-box {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border-radius: 12px;
  background: var(--bg-secondary);
}
.food-menu .food-menu-img img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  aspect-ratio: 4/3;
  border-radius: 8px;
}

/* Specific styles for Pepperoni Pizza card */
.food-menu-box:nth-child(3) .food-menu-img img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  aspect-ratio: 4/3;
  border-radius: 8px;
}

/* Touch targets and accessible spacing */
.menu ul li a,
.btn {
  min-height: 44px;
  padding: 0.6rem 1rem;
}

/* Word-break and overflow handling */
* {
  word-break: break-word;
}
html,
body {
  overflow-x: hidden;
}

/* Breakpoints */
@media (max-width: 1024px) {
  .container {
    width: 94%;
  }
  .food-menu .food-menu-img img {
    width: 100px;
    height: auto;
    aspect-ratio: 4/3;
  }
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  .menu {
    display: none;
    width: 100%;
  }
  .menu.active {
    display: block;
  }
  /* Stack and stretch menu items to full width */
  .menu ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
    padding: 0.5rem 0 2rem;
    margin: 0;
    width: 100%;
  }
  .menu ul li {
    width: 100%;
  }
  .menu ul li a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 18px;
    text-align: left;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
  }
  /* Ensure active panel doesn't constrain width */
  .menu.active .menu-logo {
    display: block;
  }
  .navbar .container {
    align-items: flex-start;
  }
  .navbar-controls {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }
  .food-menu .food-menu-box {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

/* When navbar-controls are moved into the menu (mobile), make them full width and stacked */
@media (max-width: 768px) {
  .menu .navbar-controls {
    position: static;
    width: 100%;
    display: flex;
    gap: 0.6rem;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 0 24px;
    margin-top: 0.5rem;
    background: transparent;
    box-shadow: none;
  }

  .menu .navbar-controls .language-selector,
  .menu .navbar-controls .theme-toggle {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start; /* left aligned like links */
    padding: 14px 18px; /* match menu item padding */
    border-radius: 10px; /* pill radius */
    background: rgba(0, 0, 0, 0.06); /* same subtle pill bg as links */
    color: var(--text-white);
    font-weight: 600; /* match menu link weight */
    font-size: 1rem;
    min-height: 44px; /* same touch height used elsewhere */
    box-shadow: none;
  }

  /* Language select: remove native appearance, add white caret and spacing */
  .menu .navbar-controls .language-selector {
    padding-right: 40px; /* room for caret */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    /* white caret SVG */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23fff' d='M6 8L0 0h12z'/></svg>");
  }

  /* Theme toggle: match pill layout, keep icon left-aligned like menu text */
  .menu .navbar-controls .theme-toggle {
    gap: 0.5rem;
    justify-content: flex-start;
    padding-left: 18px; /* align icon with link text */
  }
}

@media (max-width: 480px) {
  h2 {
    font-size: 1.25rem;
  }
  .food-menu .food-menu-img img {
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
  }
  .logo img {
    max-height: 38px;
  }
}

/* Small utility */
.hidden {
  display: none !important;
}

.food-search h2 {
  color: var(--text-white);
  margin-bottom: 2rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.food-search input[type="search"] {
  width: 50%;
  padding: 15px 20px;
  font-size: 1rem;
  border: none;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-medium);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.food-search input[type="search"]:focus {
  outline: none;
  box-shadow: var(--shadow-heavy);
  transform: scale(1.02);
}

/* CSS for Categories */

.categories {
  padding: 2.5rem 0;
  background: var(--bg-secondary);
}

/* Centered responsive grid for category cards: make cards stretch to fill columns
   so left/right gutters are balanced and cards appear larger on wide screens. */
.categories .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  align-items: center;
  justify-items: stretch; /* stretch cards to fill their column */
}

.box-3 {
  width: 100%;
  max-width: none; /* allow box to grow to the full column width */
  position: relative;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.02));
}

.box-3:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-heavy);
}

.box-3 img {
  width: 100%;
  height: auto;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: var(--transition);
  display: block;
}
.box-3:hover img {
  transform: scale(1.06);
}

.box-3 .float-text {
  left: 1rem;
  bottom: 1rem;
}

/* CSS for Food Menu */
.food-menu {
  background: var(--bg-primary);
  padding: 0.75rem 0 1rem;
}

/* Grid for food cards, centered, 2-3 per row */
.food-menu .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
}

/* Reset category grid row behavior so cards don't force extra vertical space */
.categories .container {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(320px, 1fr)
  ); /* larger cards */
  gap: 1rem;
  align-items: center;
  justify-items: stretch; /* stretch cards to fill their column */
}

/* Modern responsive typography for section headings */
.food-menu h2,
.categories h2 {
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1.2;
}

/* Keep default row sizing for food menu cards to avoid extra vertical space */

/* Slightly larger images and padding on wide screens for better rhythm */
@media (min-width: 1100px) {
  .food-menu .container {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .food-menu-box {
    grid-template-columns: 140px 1fr;
    padding: 1.25rem;
  }
  .food-menu-img {
    width: 140px;
  }
  .box-3 img {
    aspect-ratio: 16/10;
  }
}

@media (min-width: 769px) and (max-width: 1099px) {
  /* Two columns layout for medium screens */
  .food-menu .container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible focus state for keyboard users */
a:focus-visible,
.btn:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-color) 60%, transparent);
  outline-offset: 3px;
}

.food-menu-box {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.6rem;
  align-items: center; /* a bit tighter vertically */
  padding: 0.6rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.food-menu-box:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--primary-color);
}

.food-menu-img {
  width: 120px;
  display: block;
}
.food-menu-img img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--border-radius-md);
}

.food-menu-desc {
  margin: 0;
}

.food-menu-desc h4 {
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.food-price {
  font-size: 1.25rem;
  margin: 2% 0;
  color: var(--accent-color);
  font-weight: 700;
}
.food-detail {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Headings centered for sections */
.categories h2,
.food-menu h2 {
  text-align: center;
  margin-bottom: 0.75rem;
}

/* Make section headings occupy the full grid row when inside a grid container
   so the headings appear above the card grid instead of on the same row. */
.categories .container > h2,
.food-menu .container > h2 {
  grid-column: 1 / -1;
  justify-self: center; /* keep heading centered */
  width: 100%;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .food-menu .container {
    grid-template-columns: 1fr;
  }
  .food-menu-box {
    grid-template-columns: 1fr;
  }
  .food-menu-img img {
    width: 100%;
    height: auto;
  }
  .box-3 img {
    height: 180px;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .categories .container {
    grid-template-columns: repeat(2, 1fr);
  }
}
.food-detail {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* CSS for Social */
.social {
  background: var(--bg-gradient);
  padding: 3% 0;
}

.social ul {
  list-style-type: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
}
.social ul li {
  display: inline;
}

.social ul li a {
  display: inline-block;
  padding: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.social ul li a:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-3px) scale(1.1);
}

.social ul li img {
  width: 40px;
  height: 40px;
  transition: var(--transition);
  border-radius: 8px;
}

.social ul li img:hover {
  transform: scale(1.2);
  filter: brightness(1.1);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  padding: 2% 0;
  border-top: 1px solid var(--border-color);
}

.footer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* for Order Section */
.order {
  width: 50%;
  margin: 0 auto;
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
}
.input-responsive {
  width: 96%;
  padding: 12px;
  margin-bottom: 3%;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
}

.input-responsive:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.order-label {
  margin-bottom: 1%;
  font-weight: 600;
  color: var(--text-primary);
}

/* CSS for Mobile Size or Smaller Screen */

@media only screen and (max-width: 768px) {
  .logo {
    width: 80%;
    float: none;
    margin: 1% auto;
    text-align: center;
  }

  .menu {
    width: 100%;
    float: none;
  }

  .menu ul {
    text-align: center;
    flex-direction: column;
    gap: 1rem;
  }

  .navbar .theme-toggle {
    float: none;
    margin: 20px auto;
    display: block;
    width: fit-content;
  }

  .navbar-controls {
    float: none;
    justify-content: center;
    margin: 10px auto;
    width: fit-content;
  }

  .language-selector {
    font-size: 11px;
    padding: 3px 6px;
  }

  .food-search input[type="search"] {
    width: 90%;
    padding: 2%;
    margin-bottom: 3%;
  }

  .btn {
    width: 91%;
    padding: 2%;
  }

  .food-search {
    padding: 10% 0;
  }

  .categories {
    padding: 20% 0;
  }
  h2 {
    margin-bottom: 10%;
    font-size: 2rem;
  }
  .box-3 {
    width: 100%;
    margin: 0; /* let grid handle spacing */
  }

  .food-menu {
    padding: 20% 0;
  }

  .food-menu-box {
    width: 90%;
    padding: 5%;
    margin-bottom: 5%;
  }

  .food-menu-img {
    width: 100%;
    float: none;
    margin-bottom: 1rem;
  }

  .food-menu-desc {
    width: 100%;
    float: none;
    margin-left: 0;
  }

  .social {
    padding: 5% 0;
  }

  .social ul {
    flex-direction: row;
    gap: 1rem;
  }

  .order {
    width: 100%;
    margin: 2rem 0;
    padding: 1rem;
  }
}

/* Increase navbar height slightly for better spacing */
:root {
  --navbar-height: 64px; /* increased slightly from 56px to 64px */
}

@media only screen and (max-width: 768px) {
  :root {
    --navbar-height: 52px;
  }
}

@media only screen and (max-width: 480px) {
  :root {
    --navbar-height: 48px;
  }
}

/* Loading Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Cart Page Styles */
.cart-section {
  padding: 4% 0;
  background: var(--bg-primary);
  min-height: 60vh;
}

.cart-container {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

/* Cart Items */
#cart-items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
}

.cart-item:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-2px);
}

.cart-item-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
}

.cart-item-details h4 {
  color: var(--text-primary);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.cart-item-details .item-price {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1.1rem;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.quantity-btn:hover {
  background: var(--primary-color);
  color: var(--text-white);
  transform: scale(1.1);
}

.quantity {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  min-width: 2rem;
  text-align: center;
}

.cart-item-total .item-total {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent-color);
}

.remove-btn {
  width: 35px;
  height: 35px;
  border: none;
  background: var(--danger-color);
  color: var(--text-white);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.remove-btn:hover {
  background: #c0392b;
  transform: scale(1.1);
}

/* Cart Summary */
.cart-summary {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.summary-box {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
}

.summary-box h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
  font-size: 1.4rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  border-bottom: none;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 2px solid var(--primary-color);
}

.cart-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-cart-content h3 {
  color: var(--text-primary);
  font-size: 2rem;
  margin-bottom: 1rem;
}

.empty-cart-content p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* Cart Counter in Navigation */
.cart-counter {
  background: var(--danger-color);
  color: var(--text-white);
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 0.8rem;
  margin-left: 5px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.menu ul li a.active {
  background: linear-gradient(
    45deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: var(--text-white);
  border-radius: var(--border-radius-sm);
}

/* Make sure food-menu grid rule is defined at top-level (it was accidentally nested above) */
.food-menu .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

/* ===== Visual polish & utilities ===== */
/* Small rounded badge used for categories or featured items */
.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: var(--text-white);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--shadow-light);
  z-index: 4;
}

.box-3 .badge {
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
}

/* Make category cards feel more even in height on larger screens */
.box-3 {
  min-height: clamp(180px, 22vh, 320px);
}

/* Ensure food menu cards have a stable, compact height while allowing growth */
.food-menu-box {
  min-height: 110px;
}

/* Slightly tighten the spacing between Food Menu heading and its cards */
.food-menu .container > h2 {
  margin-bottom: 0.5rem;
}

/* Subtle image hover on food items for micro-interaction */
.food-menu-img img {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.food-menu-box:hover .food-menu-img img {
  transform: scale(1.04);
  box-shadow: var(--shadow-light);
}

/* Stronger visible focus for primary buttons */
.btn-primary:focus-visible {
  outline: 3px solid
    color-mix(in srgb, var(--primary-color) 40%, var(--text-white) 10%);
  outline-offset: 3px;
}
@media only screen and (max-width: 768px) {
  .cart-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cart-item {
    grid-template-columns: 60px 1fr auto;
    gap: 0.5rem;
    padding: 1rem;
  }

  .cart-item-quantity {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 1rem;
  }

  .cart-item-total {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 0.5rem;
  }

  .cart-item-remove {
    position: absolute;
    top: 10px;
    right: 10px;
  }

  .cart-item {
    position: relative;
  }

  .summary-box {
    padding: 1.5rem;
  }
}

/* Checkout Page Styles */
.checkout-section {
  padding: 4% 0;
  background: var(--bg-primary);
  min-height: 80vh;
}

.checkout-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  margin-top: 2rem;
}

/* Checkout Summary */
.checkout-summary {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.checkout-summary .summary-box {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.checkout-item:last-child {
  border-bottom: none;
  margin-bottom: 1rem;
}

.checkout-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.item-name {
  font-weight: 600;
  color: var(--text-primary);
}

.item-quantity {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.item-price {
  font-weight: 700;
  color: var(--accent-color);
}

.summary-totals {
  border-top: 2px solid var(--border-color);
  padding-top: 1rem;
  margin-top: 1rem;
}

/* Payment Form */
.payment-form {
  background: var(--bg-secondary);
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-medium);
  border: 1px solid var(--border-color);
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-input {
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-input.error {
  border-color: var(--danger-color);
  box-shadow: 0 0 0 3px rgba(232, 67, 147, 0.1);
}

.field-error {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Security Badges */
.security-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.security-badge {
  background: var(--accent-color);
  color: var(--text-white);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Stripe Card Element */
.stripe-card-element {
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--bg-primary);
  transition: var(--transition);
}

.stripe-card-element:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.error-message {
  color: var(--danger-color);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

/* Payment Methods */
.payment-methods {
  margin-top: 1rem;
  text-align: center;
}

.payment-methods span {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: block;
}

.payment-icons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.payment-icons img {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
}

.payment-icons img:hover {
  transform: scale(1.1);
}

/* Submit Button */
.btn-large {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-large:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid var(--text-white);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* Success Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal.show {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-primary);
  padding: 3rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-heavy);
  text-align: center;
  max-width: 500px;
  width: 90%;
  transform: translateY(30px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.success-animation {
  margin-bottom: 2rem;
}

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-color);
  color: var(--text-white);
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  animation: bounce 0.6s ease-out;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.modal-content h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.order-details {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 2rem;
}

.order-details p {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-actions .btn {
  flex: 1;
  max-width: 150px;
}

/* ensure modal action buttons center their content */
.modal-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Mobile Responsiveness */
@media only screen and (max-width: 768px) {
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .security-badges {
    justify-content: center;
  }

  .payment-icons {
    gap: 0.25rem;
  }

  .payment-icons img {
    width: 35px;
    height: 35px;
  }

  .modal-content {
    padding: 2rem;
    margin: 1rem;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-actions .btn {
    max-width: none;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet Styles (769px - 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
  .container {
    width: 90%;
    padding: 2%;
  }

  /* Categories - 2 cards per row on tablets */
  .box-3 {
    width: 45%;
    margin: 2.5%;
  }

  /* Food Menu - 2 cards per row on tablets */
  .food-menu-box {
    width: 45%;
    margin: 2.5%;
  }

  /* Navbar adjustments */
  .navbar-controls {
    gap: 8px;
  }

  .language-selector {
    font-size: 12px;
    padding: 4px 8px;
  }

  .theme-toggle {
    width: 32px;
    height: 32px;
  }
}

/* Mobile Styles (max-width: 768px) */
@media only screen and (max-width: 768px) {
  /* Container adjustments */
  .container {
    width: 95%;
    padding: 3%;
  }

  /* Typography adjustments */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
  }

  h3 {
    font-size: 1.4rem;
  }

  /* Navbar Mobile */
  .navbar {
    padding: 10px 0;
  }

  .navbar .container {
    position: relative;
  }

  .logo {
    width: auto;
    float: left;
    text-align: left;
    margin-bottom: 0;
  }

  .logo img {
    max-width: 120px;
  }

  /* Show mobile menu toggle button */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Hide menu and controls by default on mobile */
  .menu {
    display: none;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius-md);
    margin-top: 10px;
    z-index: 1000;
  }

  /* Show menu when active */
  .menu.active {
    display: block;
  }

  .menu ul {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1rem;
    margin: 0;
  }

  .menu ul li {
    list-style: none;
  }

  .menu ul li a {
    padding: 12px 16px;
    display: block;
    border-radius: var(--border-radius-sm);
    background: var(--bg-secondary);
    margin-bottom: 8px;
    transition: var(--transition);
    color: var(--text-primary);
    text-decoration: none;
  }

  .menu ul li a:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateX(5px);
  }

  /* Close mobile menu when clicking menu items */
  .menu ul li a {
    cursor: pointer;
  }

  /* Hide navbar controls by default on mobile */
  .navbar-controls {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary);
    box-shadow: var(--shadow-medium);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-top: 10px;
    gap: 15px;
    flex-direction: column;
    align-items: center;
    z-index: 1000;
  }

  /* Show controls when active */
  .navbar-controls.active {
    display: flex;
  }

  .language-selector {
    font-size: 11px;
    padding: 6px 10px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
  }

  /* Hero Section Mobile */
  .food-search {
    padding: 15% 0;
  }

  .food-search h3 {
    font-size: 1.5rem;
    line-height: 1.4;
  }

  .food-search input[type="search"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }

  /* Categories Mobile - 1 card per row */
  .categories {
    padding: 10% 0;
  }

  .box-3 {
    width: 100%;
    margin: 0 0 2rem 0;
  }

  /* Food Menu Mobile - 1 card per row */
  .food-menu {
    padding: 10% 0;
  }

  .food-menu-box {
    width: 100%;
    margin: 0 0 2rem 0;
    padding: 1.5rem;
    flex-direction: column;
    text-align: center;
  }

  .food-menu-img {
    width: 100%;
    max-width: 200px;
    margin: 0 auto 1rem auto;
  }

  .food-menu-desc {
    width: 100%;
    margin-left: 0;
  }

  /* Cart Mobile */
  .cart-section {
    padding: 8% 0;
  }

  .cart-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cart-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
  }

  .cart-item-image {
    margin: 0 auto;
  }

  .cart-item-quantity {
    justify-content: center;
    margin: 1rem 0;
  }

  .cart-item-total {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
  }

  .cart-item-remove {
    text-align: center;
  }

  /* Checkout Mobile */
  .checkout-section {
    padding: 8% 0;
  }

  .checkout-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .checkout-form input,
  .checkout-form select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Social Media Mobile */
  .social {
    padding: 8% 0;
  }

  .social ul {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  /* Order/Contact Mobile */
  .order {
    padding: 8% 0;
  }

  .order-form {
    width: 100%;
  }

  .order-form input,
  .order-form textarea {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Small Mobile Styles (max-width: 480px) */
@media only screen and (max-width: 480px) {
  .container {
    width: 98%;
    padding: 1%;
  }

  /* Even smaller typography */
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  /* Compact navbar */
  .navbar {
    padding: 8px 0;
  }

  .logo img {
    max-width: 120px;
  }

  .menu ul li a {
    padding: 8px;
    font-size: 14px;
  }

  .navbar-controls {
    gap: 10px;
  }

  .language-selector {
    font-size: 10px;
    padding: 4px 6px;
  }

  .theme-toggle {
    width: 30px;
    height: 30px;
  }

  /* Compact spacing */
  .food-search {
    padding: 12% 0;
  }

  .categories,
  .food-menu {
    padding: 8% 0;
  }

  .box-3,
  .food-menu-box {
    margin-bottom: 1.5rem;
  }

  /* Smaller buttons */
  .btn {
    padding: 10px;
    font-size: 14px;
  }

  /* Compact cart */
  .cart-item {
    padding: 1rem;
  }

  .quantity-btn {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
}

/* Large Desktop Styles (min-width: 1400px) */
@media only screen and (min-width: 1400px) {
  .container {
    max-width: 1300px;
  }

  /* Categories - 4 cards per row on large screens */
  .box-3 {
    width: auto; /* let grid define columns on very large screens */
    margin: 0;
  }

  /* Food Menu - 3 cards per row with more space */
  .food-menu-box {
    width: auto; /* rely on grid for layout */
    margin: 0;
  }
}

/* Card caption backdrop for better contrast on images */
.float-text {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.2));
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  display: inline-block;
  font-size: 1rem;
}

/* Entrance utility for subtle staggered reveals */
.card-entrance {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.6s ease-out forwards;
}
.card-entrance:nth-child(1) {
  animation-delay: 0.06s;
}
.card-entrance:nth-child(2) {
  animation-delay: 0.12s;
}
.card-entrance:nth-child(3) {
  animation-delay: 0.18s;
}

/* Ensure badges don't overlap on very small screens */
@media only screen and (max-width: 480px) {
  .badge {
    top: 8px;
    right: 8px;
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  .float-text {
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
  }
}

/* Glassmorphism Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(var(--bg-rgb-light), 0.15);
  backdrop-filter: blur(35px) saturate(1.6) brightness(1.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: background 0.3s ease, backdrop-filter 0.3s ease,
    box-shadow 0.3s ease;
}

.navbar.scrolled {
  background: rgba(var(--bg-rgb-light), 0.25);
  backdrop-filter: blur(40px) saturate(1.8) brightness(1.15);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark mode support */
body.dark-mode .navbar {
  background: rgba(var(--bg-rgb-dark), 0.15);
}

body.dark-mode .navbar.scrolled {
  background: rgba(var(--bg-rgb-dark), 0.25);
}

/* Compact navbar override — placed late to override earlier values */
:root {
  --navbar-height: 64px; /* increased slightly from 56px to 64px */
}

/* Enforce compact sizing */
.navbar {
  height: var(--navbar-height) !important;
  min-height: var(--navbar-height) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  align-items: center;
}

/* Make container align to full navbar height */
.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
}

/* Scale logo to fit the compact navbar */
.navbar .logo img {
  max-height: calc(var(--navbar-height) - 12px);
  width: auto;
  display: block;
}

/* Tighter mobile toggle size */
.mobile-menu-toggle {
  width: calc(var(--navbar-height) - 12px);
  height: calc(var(--navbar-height) - 12px);
  padding: 4px;
}

/* Ensure menu/controls still fit inside the compact navbar */
.navbar .menu,
.navbar .navbar-controls {
  margin-top: 0;
}

/* Responsive reductions */
@media only screen and (max-width: 768px) {
  :root {
    --navbar-height: 52px;
  }
  .navbar .logo img {
    max-height: calc(var(--navbar-height) - 10px);
  }
  .mobile-menu-toggle {
    width: calc(var(--navbar-height) - 10px);
    height: calc(var(--navbar-height) - 10px);
  }
}

@media only screen and (max-width: 480px) {
  :root {
    --navbar-height: 48px;
  }
  .navbar .logo img {
    max-height: calc(var(--navbar-height) - 8px);
  }
  .mobile-menu-toggle {
    width: calc(var(--navbar-height) - 8px);
    height: calc(var(--navbar-height) - 8px);
  }
}

/* Navbar link contrast fixes to avoid purple-on-purple collisions */
/* Apply dark text for navbar links in light mode and keep light text in dark mode */
/* Default (light) */
.navbar a,
.navbar .menu ul li a,
.navbar .menu ul li a:link,
.navbar .menu ul li a:visited,
.navbar .theme-toggle,
.navbar .language-selector {
  color: var(--text-primary) !important;
}

/* Make sure logo link text (if any) is also dark in light mode */
.navbar .logo a,
.navbar .logo a:hover {
  color: var(--text-primary) !important;
}

/* Active link styling: readable on glass background */
.navbar .menu ul li a.active {
  background: linear-gradient(
    90deg,
    rgba(108, 92, 231, 0.95),
    rgba(99, 102, 241, 0.95)
  );
  color: var(--text-white) !important;
  padding: 8px 12px;
  border-radius: 8px;
}

/* Dark mode: use light text on navbar */
html[data-theme="dark"] .navbar a,
body.dark-mode .navbar a,
html[data-theme="dark"] .navbar .theme-toggle,
body.dark-mode .navbar .theme-toggle {
  color: var(--text-white) !important;
}
