/* Base */
:root{
  --menu-bg:var(--color-bg);
  --panel:var(--color-surface);
  --ink:var(--color-text);
  --muted:var(--color-text-muted);
  --chip:#f1f3f8;
  --chip-active:var(--color-brand-900);
  --chip-ink:var(--color-text);
  --chip-ink-active:#ffffff;
  --shadow:0 6px 20px rgba(17,24,39,.08);
  --header-total:130px; /* fallback */
}
*{box-sizing:border-box}
html,body{height:100%}

button { touch-action: manipulation; }

body{font-family:Arial,'Noto Sans Sinhala','Noto Sans Tamil','Segoe UI',sans-serif;color:var(--ink)}
.bg-menu{background:var(--menu-bg)}
.card-soft{background:var(--panel);border:0;border-radius:18px;box-shadow:var(--shadow)}

/* Fixed header */
.site-header{
  position:fixed;top:0;left:0;right:0;z-index:2000;background:#fff;
  box-shadow:0 1px 0 rgba(17,24,39,.06);
}
body.has-fixed-header{padding-top:var(--header-total)}

/* Category bar */
.category-shell{position:relative;background:#fff;padding:0px 0px;overflow:hidden;border-top:0px solid #eef0f5;border-bottom:1px solid #eef0f5}
.category-bar{display:flex;gap:.5rem;overflow-x:auto;overscroll-behavior-x:contain;scroll-behavior:smooth;padding:6px 5px;scrollbar-width:none}
.category-bar::-webkit-scrollbar{display:none}
.cat{
  flex:0 0 auto;
  border:1px solid transparent;
  background:var(--chip);
  color:var(--chip-ink);
  padding:.55rem .9rem;
  border-radius:999px;
  font-weight:600;
  letter-spacing:.2px;
  transition:all .2s ease;
  box-shadow:0 1px 0 rgba(17,24,39,.04);
  --bs-btn-color: var(--chip-ink);
  --bs-btn-bg: var(--chip);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--chip-ink);
  --bs-btn-hover-bg: var(--chip);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--chip-ink-active);
  --bs-btn-active-bg: var(--chip-active);
  --bs-btn-active-border-color: var(--chip-active);
}
.cat:hover{transform:translateY(-1px)}
.cat.active{background:var(--chip-active);color:var(--chip-ink-active) !important;box-shadow:0 6px 18px rgba(17,24,39,.18)}
.cat-nudge{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:999px;border:0;background:#fff;box-shadow:var(--shadow);display:grid;place-items:center;z-index:3;opacity:.95}
.cat-nudge.left{left:10px}.cat-nudge.right{right:10px}
.fade-left,.fade-right{position:absolute;top:0;width:64px;height:100%;pointer-events:none;z-index:2}
.fade-left{left:0;background:linear-gradient(90deg,#fff,transparent)}
.fade-right{right:0;background:linear-gradient(270deg,#fff,transparent)}

/* Sections */
.section{scroll-margin-top:var(--header-total);margin-bottom:2.5rem}
.section h2{font-weight:600;letter-spacing:.2px;}
.menu-card{border:0;border-radius:18px;background:#fff;box-shadow:var(--shadow)}
.price{font-weight:700}

.dropdown-menu {width: 80%; margin: 0 auto; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* Toast Notifications */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 16px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  max-width: 300px;
  pointer-events: none;
}

.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}

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

.toast-content i {
  font-size: 16px;
  flex-shrink: 0;
}

.toast-success {
  background-color: #28a745;
}

.toast-error {
  background-color: #dc3545;
}

.toast-info {
  background-color: #007bff;
}

/* Processing state for buttons */
.btn-basket:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  position: relative;
}

.btn-basket:disabled::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  margin: auto;
  border: 2px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

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

/* Global processing overlay (optional) */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9998;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.processing-overlay.show {
  display: flex;
}

.processing-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Mobile improvements */
@media (max-width: 576px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .category-bar {
    padding: 4px 8px;
  }

  .cat {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }

  .menu-card {
    margin-bottom: 0.75rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .item-img {
    width: 60px !important;
    height: 60px !important;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
  }

  .btn-basket {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }

  .toast-notification {
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
  }
}

/* Touch-friendly improvements */
.btn-step {
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: bold;
}

.qty-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-wrap input {
  width: 50px;
  text-align: center;
  font-weight: 600;
}

/* Better focus states for accessibility */
.btn:focus,
input:focus,
textarea:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #007bff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.item-img{ width:88px; height:88px; border-radius:10%; object-fit:cover; box-shadow:0 6px 18px rgba(0,0,0,.10);}
.price-row{ display:flex; align-items:baseline; column-gap:10px; padding-left:10px; padding-right:10px; padding-bottom:10px; margin-top:-5px; justify-content: flex-end;}
.price-row small{ color:#7a8598; font-weight:500; margin-right:0px; font-size:9pt;}
.price-row .amount{ font-weight:500; color:#1f2430; font-size:10pt; }

.add-btn{ width:30px;height:30px;border-radius:50%; border:1px solid #e6e9ef; background:#fff; color:#6b7280; box-shadow:inset 0 -2px 6px rgba(0,0,0,.04), 0 4px 10px rgba(0,0,0,.06); transition:transform .12s ease, box-shadow .12s ease, color .12s ease, background .12s ease; font-weight:500; margin-top:-5px;}
.add-btn:hover{ transform:translateY(-1px); box-shadow:inset 0 -1px 4px rgba(0,0,0,.04), 0 8px 18px rgba(0,0,0,.10); color:#FFFFFF; background:#000000; }

.btn-bell{ color:red;}