/* ============================================================
   TIKKA MASALA CHAT CORNER — Main CSS Design System
   Premium Indian Street Food aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

/* ── Design Tokens ── */
:root {
  --primary:       #C81E2B;
  --primary-dark:  #A51520;
  --primary-light: #E63845;
  --secondary:     #1E1E1E;
  --accent:        #FDE8E8;
  --accent-light:  #FFF0F0;
  --bg:            #FFFFFF;
  --bg-alt:        #FAF9F2;
  --card:          #FAF9F2;
  --text-dark:     #1E1E1E;
  --text-body:     #555555;
  --text-muted:    #888888;
  --border:        #EAEAEA;
  --success:       #2E7D32;
  --warning:       #E65100;
  --error:         #B71C1C;
  --info:          #0277BD;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.04);
  --shadow-md:  0 4px 6px rgba(0,0,0,.04);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.04);
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  25px;

  --transition: 0.25s cubic-bezier(.4,0,.2,1);
  --font-main: 'Inter', sans-serif;
  --font-display: 'Playfair Display', serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body.customer-nav-open { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

/* ── Typography ── */
h1,h2,h3,h4,h5,h6 { font-family: var(--font-main); color: var(--text-dark); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.75rem); }

p { color: var(--text-body); }
.text-muted { color: var(--text-muted); font-size: .9rem; }
.text-center { text-align: center; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover:not(:disabled) { background: #000; color: #fff; }

.btn-accent {
  background: var(--accent);
  color: var(--primary);
}
.btn-accent:hover:not(:disabled) { background: #FDE8E8; color: var(--primary-dark); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--secondary);
  color: var(--secondary);
}
.btn-outline:hover:not(:disabled) { background: var(--secondary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-body);
}
.btn-ghost:hover { background: var(--border); }

.btn-sm { padding: .5rem 1.1rem; font-size: .85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-icon { padding: .6rem; border-radius: 50%; }

/* ── Form Elements ── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-dark);
}
.form-control {
  width: 100%;
  padding: .8rem 1.1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: .95rem;
  background: #fff;
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200,16,46,.12);
}
.form-error { color: var(--error); font-size: .82rem; margin-top: .3rem; }
.form-hint { color: var(--text-muted); font-size: .82rem; margin-top: .3rem; }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-body { padding: 1.5rem; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .8rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-primary   { background: rgba(200,16,46,.12);  color: var(--primary); }
.badge-success   { background: rgba(46,125,50,.12);   color: var(--success); }
.badge-warning   { background: rgba(245,197,24,.18);  color: #7A6000; }
.badge-error     { background: rgba(183,28,28,.12);   color: var(--error); }
.badge-info      { background: rgba(2,119,189,.12);   color: var(--info); }
.badge-secondary { background: rgba(232,119,34,.12);  color: var(--secondary); }

/* ── Status Badges ── */
.status-NEW              { background: rgba(2,119,189,.1);  color: var(--info); }
.status-PAYMENT_VERIFIED { background: rgba(46,125,50,.1);  color: var(--success); }
.status-ACCEPTED         { background: rgba(46,125,50,.15); color: #1B5E20; }
.status-PREPARING        { background: rgba(232,119,34,.15); color: var(--warning); }
.status-READY            { background: rgba(245,197,24,.2);  color: #7A6000; }
.status-OUT_FOR_DELIVERY { background: rgba(200,16,46,.12); color: var(--primary); }
.status-DELIVERED        { background: rgba(46,125,50,.15); color: var(--success); }
.status-CANCELLED        { background: rgba(183,28,28,.1);  color: var(--error); }

/* ── Alerts ── */
.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  border-left: 4px solid;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.alert-success { background: #E8F5E9; border-color: var(--success); color: #1B5E20; }
.alert-error   { background: #FFEBEE; border-color: var(--error);   color: var(--error); }
.alert-warning { background: #FFF3E0; border-color: var(--secondary); color: var(--warning); }
.alert-info    { background: #E3F2FD; border-color: var(--info);    color: #01579B; }
.alert.hidden  { display: none; }

/* ── Loading ── */
.spinner {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,249,242,.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.loading-overlay.hidden { display: none; }

/* ── Navigation ── */
.navbar {
  background: #FFFFFF;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.navbar-logo {
  width: 42px; height: 42px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}
.navbar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.brand-name,
.brand-full,
.brand-short {
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand-short { display: none; }
.brand-tagline {
  color: var(--text-muted);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.navbar-nav {
  display: none;
}
.nav-link {
  color: var(--secondary);
  padding: .5rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: .95rem;
  transition: all var(--transition);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: transparent;
}
.nav-link .badge-count {
  background: var(--accent);
  color: var(--primary);
  font-size: .65rem;
  font-weight: 800;
  padding: .15rem .45rem;
  border-radius: 999px;
  position: absolute;
  top: -5px; right: -10px;
}

/* ── Hamburger (all viewports) ── */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: .4rem;
  z-index: 220;
  position: relative;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--secondary);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Customer sidebar — lives on body, not inside sticky navbar */
.customer-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 190;
}
.customer-nav-overlay.active { display: block; }

.customer-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  max-width: 86vw;
  background: #1E1E1E;
  color: #fff;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform var(--transition);
  overflow-y: auto;
  font-family: var(--font-main);
  opacity: 1;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}
.customer-sidebar.open { transform: translateX(0); }

.customer-sidebar-brand {
  padding: 1.75rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.customer-sidebar-brand .sidebar-logo-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
}
.customer-sidebar-tmcc {
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.2;
}
.customer-sidebar-full {
  color: rgba(255,255,255,.85);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin-top: .15rem;
  line-height: 1.3;
}
.customer-sidebar-panel {
  color: rgba(255,255,255,.55);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: .35rem;
}
.customer-sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
}
.customer-sidebar-link {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .8rem 1.5rem;
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  margin: .1rem 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  position: relative;
}
.customer-sidebar-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.customer-sidebar-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  border-left-color: var(--accent);
  font-weight: 600;
}
.customer-sidebar-link .link-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.customer-sidebar-link .cart-badge {
  margin-left: auto;
  position: static;
  top: auto; right: auto;
}

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; width: 100%; min-width: 0; }
.container-sm { max-width: 600px; margin: 0 auto; padding: 0 1.5rem; width: 100%; min-width: 0; }

/* ── Section ── */
.section { padding: 4rem 0; }
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title h2 { margin-bottom: .5rem; }
.section-title p { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: .85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Toast Notifications ── */
#toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  pointer-events: none;
}
.toast {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: all;
  animation: slideInRight .3s ease;
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--primary);
}
.toast.toast-success { border-color: var(--success); }
.toast.toast-error   { border-color: var(--error); }
.toast.toast-warning { border-color: var(--secondary); }
.toast-icon { font-size: 1.4rem; flex-shrink: 0; }
.toast-msg  { flex: 1; font-size: .9rem; font-weight: 500; color: var(--text-dark); }
.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0;
}
.toast-cart-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.toast-view-cart {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
  font-size: .9rem;
  text-align: left;
  text-decoration: underline;
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes slideOutRight {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 1rem; opacity: .5; }
.empty-state h3 { margin-bottom: .5rem; color: var(--text-body); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn .2s ease;
}
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 1.2rem; font-weight: 700; color: var(--text-dark); }
.modal-close {
  background: none; border: none; cursor: pointer; font-size: 1.5rem;
  color: var(--text-muted); transition: color var(--transition);
}
.modal-close:hover { color: var(--error); }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 1rem; justify-content: flex-end; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Table ── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); -webkit-overflow-scrolling: touch; width: 100%; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.table th {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: .9rem 1.1rem;
  text-align: left;
  font-weight: 600;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.table td {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-body);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-alt); }
.table .actions { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Utility ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.p-2 { padding: 1rem; }
.hidden { display: none !important; }
.font-bold { font-weight: 700; }
.rounded-full { border-radius: 999px; }
.price { font-weight: 700; color: var(--primary); font-size: 1.1rem; }

/* ── OTP Input Boxes ── */
.otp-inputs {
  display: flex;
  gap: .75rem;
  justify-content: center;
  margin: 1rem 0;
}
.otp-box {
  width: 52px; height: 56px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  outline: none;
  transition: all var(--transition);
}
.otp-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(200,16,46,.12); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .brand-full { display: none; }
  .brand-short { display: block; font-size: 1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }

  /* Toast — prevent horizontal scroll */
  #toast-container {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }
  .toast {
    min-width: unset;
    max-width: 100%;
    width: 100%;
  }

  /* Modal fits viewport */
  .modal { max-height: 85vh; margin: 0 .5rem; }
  .modal-footer { flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; min-width: 100px; }
}

/* Small Mobile — 480px */
@media (max-width: 480px) {
  .navbar { padding: .65rem 1rem; }
  .brand-name, .brand-short { font-size: .95rem; }
  .brand-tagline { display: none; }
  .btn-lg { padding: .85rem 1.5rem; font-size: .95rem; }
  .btn { font-size: .9rem; padding: 10px 20px; }
  .container { padding: 0 1rem; }
  .container-sm { padding: 0 1rem; }

  /* OTP boxes — 6 boxes must fit ≤ 300px */
  .otp-inputs { gap: .4rem; }
  .otp-box { width: 40px; height: 44px; font-size: 1.2rem; }

  /* Card body tighter */
  .card-body { padding: 1rem; }
  .modal-body { padding: 1rem; }
  .modal-header { padding: 1rem; }
  .modal-footer { padding: .75rem; }

  /* Table responsive */
  .table { font-size: .8rem; }
  .table th, .table td { padding: .6rem .8rem; }
  .table th { font-size: .75rem; }

  /* Form elements */
  .form-control { padding: .7rem; font-size: .95rem; }
  .form-label { font-size: .85rem; }

  /* Alert */
  .alert { font-size: .85rem; padding: .75rem 1rem; }

  /* Badges */
  .badge { font-size: .65rem; padding: .25rem .6rem; }
}

/* Extra small — 360px */
@media (max-width: 360px) {
  .otp-box { width: 36px; height: 40px; font-size: 1rem; }
  .otp-inputs { gap: .3rem; }
}
