/* ==========================================================================
   STORE STYLESHEET
   --------------------------------------------------------------------------
   HOW TO EDIT QUICKLY
   - Colors, sizes, corners and shadows live in the TOKENS block just below.
     Change a value there and it updates everywhere.
   - Each section after that is labeled; use Ctrl+F on the section name.

   SECTIONS
    1. Tokens           7. Cards & dishes        13. Admin panel
    2. Base             8. Cart & tables         14. Reservation tables
    3. Buttons & forms  9. Login / register      15. Cashier
    4. Navigation      10. Order tracking        16. Utilities
    5. Layout & text   11. Badges & pills        17. Mobile
    6. Home page       12. Alerts & stock        18. Print
   ========================================================================== */


/* 1. TOKENS — edit these first ============================================ */
:root {
  /* Brand colors */
  --g:  #0b5d32;   /* main green: buttons, links, prices */
  --gd: #073d22;   /* dark green: navigation, sidebar, hover */
  --or: #f5a623;   /* orange accent: focus ring, badges */
  --rd: #d93a3a;   /* red: errors, occupied tables */
  --on-g:  #ffffff;   /* text on main color (auto-set by the admin theme) */
  --on-gd: #ffffff;   /* text on dark color (auto-set by the admin theme) */

  /* Page colors (soft tones are easier on the eyes than pure white/black) */
  --bg: #f3f8f4;   /* page background */
  --surface: #ffffff;   /* cards, panels, inputs */
  --tx: #1c2b22;   /* main text */
  --mu: #52645a;   /* muted / secondary text */
  --bd: #cfdcd3;   /* borders and dividers */

  /* Status colors */
  --ok:        #2f9e5b;  --ok-bg:     #e3f6e8;
  --warn:      #f5a623;  --warn-bg:   #fff3cd;
  --danger:    #d93a3a;  --danger-bg: #fde2e2;
  --info-bg:   #d9ecff;  --info-tx:   #1d5a99;

  /* Shape */
  --radius-sm: 10px;     /* buttons, inputs */
  --radius:    16px;     /* cards, panels */
  --radius-lg: 20px;     /* hero, banners, forms */
  --radius-pill: 30px;   /* chips */

  /* Shadows */
  --shadow:    0 2px 10px rgba(11, 93, 50, .08);
  --shadow-lg: 0 10px 40px rgba(11, 93, 50, .15);

  /* Type */
  --font: 'Segoe UI', system-ui, sans-serif;
  --base-size: 18px;
  --line: 1.5;

  /* Layout */
  --max-width: 1280px;
  --card-min: 290px;     /* smallest card width in grids */
}


/* 2. BASE ================================================================= */
* {
  box-sizing: border-box;
  margin: 0;
}

html {
  font-size: var(--base-size);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--tx);
  line-height: var(--line);
}

a {
  color: var(--g);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

button,
input,
select {
  font: inherit;
}

h1 { font-size: 3.2rem; line-height: 1.1; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }


/* 3. BUTTONS & FORM FIELDS ================================================ */
.btn {
  background: var(--g);
  color: var(--on-g);
  border: 0;
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.btn:hover       { background: var(--gd); color: var(--on-gd); }
.btn.out         { background: var(--surface); color: var(--g); border: 2px solid var(--g); }
.btn.w           { width: 100%; }
.btn.sm          { padding: 11px; width: calc(100% - 28px); margin: 0 14px; }  /* card button */
.btn.big         { padding: 18px 30px; font-size: 1.2rem; }                      /* cashier button */

input,
select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--bd);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--tx);
}

/* Keyboard focus ring */
input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid var(--or);
}

/* Inputs inside tables are smaller */
td input,
td select {
  padding: 9px 10px;
  width: auto;
  max-width: 190px;
}

.lbl {
  display: block;
  font-weight: 700;
  margin: 16px 0 8px;
}

/* Form grid (admin "add" forms, reservation form) */
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 16px;
}


/* 4. NAVIGATION (customer top bar) ======================================== */
nav {
  background: var(--gd);
  color: var(--on-gd);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 26px;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 5;
  font-size: 1.05rem;
}

nav a          { color: var(--on-gd); font-weight: 400; opacity: .85; }
nav a.on,
nav a:hover    { opacity: 1; font-weight: 700; }

/* Store logo + name (editable from Admin > Store Settings) */
nav .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
nav .logo small {
  display: block;
  margin-top: 4px;
  font-size: .65rem;
  letter-spacing: 5px;
  font-weight: 400;
  text-transform: uppercase;
}

/* Logo image (used in nav, receipts, login, admin, cashier) */
.lg {
  object-fit: contain;
  border-radius: var(--radius-sm);
  vertical-align: middle;
}

/* Little count bubble (cart, notifications) */
.badge {
  background: var(--or);
  color: #000;
  border-radius: 12px;
  font-size: .8rem;
  padding: 2px 9px;
  margin-left: 4px;
  font-weight: 700;
}


/* 5. LAYOUT & TEXT HELPERS ================================================ */
main {
  max-width: var(--max-width);
  margin: auto;
  padding: 32px 28px;
}

/* Section heading row: title on the left, link on the right */
.hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 40px 0 18px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr));
  gap: 22px;
}

/* Two columns: main content + side panel (cart, etc.) */
.cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 26px;
}

.empty {
  text-align: center;
  color: var(--mu);
  padding: 50px;
  font-size: 1.2rem;
}


/* 6. HOME PAGE ============================================================ */
.hero {
  background: linear-gradient(120deg, var(--gd), var(--g));
  color: var(--on-gd);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.hero p {
  max-width: 480px;
  margin: 14px 0 24px;
  font-size: 1.2rem;
  opacity: .92;
}
.hero .big {
  font-size: 170px;
  line-height: 1;
}

/* Filter chips (cuisines, tabs, toggles) */
.chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}
.chip {
  border: 2px solid var(--bd);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tx);
  cursor: pointer;
}
.chip.on {
  background: var(--g);
  color: var(--on-g);
  border-color: var(--g);
}
label.chip { display: inline-block; font-size: .9rem; padding: 8px 14px; }  /* file-upload buttons */
a.chip     { display: inline-block; }

/* Search + sort + diet row on Restaurants page */
.tools {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin: 16px 0;
}


/* 7. CARDS & DISHES ======================================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  overflow: hidden;
  padding-bottom: 16px;
  position: relative;
  box-shadow: var(--shadow);
}
.card .img {
  height: 170px;
  font-size: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--h, 35) 80% 88%);   /* soft tint per restaurant */
  cursor: pointer;
}
.card b   { display: block; padding: 12px 14px 0; font-size: 1.25rem; }
.card .sub{ display: block; padding: 2px 14px 6px; color: var(--mu); }
.card .pr { display: block; padding: 0 14px 10px; font-weight: 800; font-size: 1.3rem; color: var(--g); }

/* Dish/restaurant photos fill their box */
.img img,
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Favorite heart button */
.heart {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 46px;
  height: 46px;
  background: var(--surface);
  border: 0;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

/* Quantity stepper on dish cards: [-] [ 1 ] [+] */
.qs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 12px;
}
.qs input { text-align: center; padding: 10px; width: 100%; }
.qs .chip { padding: 8px 16px; font-size: 1.3rem; }

/* Restaurant page header */
.banner {
  display: flex;
  gap: 28px;
  align-items: center;
  position: relative;
  border-radius: var(--radius-lg);
  padding: 34px;
  background: hsl(var(--h) 80% 88%);
}
.banner .big {
  font-size: 120px;
  line-height: 1;
}

/* Small square dish picture (cart, admin tables) */
.thumb {
  width: 72px;
  height: 72px;
  flex: none;
  overflow: hidden;
  border-radius: 12px;
  font-size: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fde9c9;
}


/* 8. CART, TABLES & TOTALS ================================================ */
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: left;
  color: var(--mu);
  padding: 10px;
}
td {
  padding: 14px 10px;
  border-top: 1px solid var(--bd);
  font-size: 1.05rem;
}

.item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
}

/* Quantity box in the cart */
.q {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 2px solid var(--bd);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-weight: 700;
}
.q button { border: 0; background: none; color: var(--tx); cursor: pointer; font-size: 1.5rem; padding: 0 6px; }
.q .qn    { border: 0; }
td .qn    { width: 76px; text-align: center; padding: 6px; }

/* Row of equal-width choice buttons (order type, tip) */
.seg { display: flex; gap: 10px; }
.seg .chip { flex: 1; text-align: center; border-radius: var(--radius-sm); }

/* Price summary lines */
.sum {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 1.05rem;
}
.sum.t {
  font-size: 1.6rem;
  font-weight: 800;
  border-top: 2px solid var(--bd);
  margin-top: 10px;
  padding-top: 14px;
}


/* 9. LOGIN / REGISTER ===================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth form {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg);
  padding: 44px;
  display: grid;
  gap: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth p   { color: var(--mu); }
.err      { color: var(--rd); min-height: 22px; font-weight: 600; }


/* 10. ORDER TRACKING ====================================================== */
/* Vertical timeline */
.tl { margin: 26px 0 0 8px; }
.st {
  display: flex;
  gap: 18px;
  padding-bottom: 34px;
  position: relative;
  font-size: 1.15rem;
}
.st small { color: var(--mu); font-size: 1rem; }
.st:not(:last-child):before {          /* connecting line */
  content: '';
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 3px;
  background: var(--bd);
}
.dot {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 4px solid var(--bd);
  background: var(--surface);
  color: var(--on-g);
}
.st.done .dot                    { background: var(--g); border-color: var(--g); }
.st.cur .dot                     { border-color: var(--g); }
.st.done:not(:last-child):before { background: var(--g); }

/* Horizontal progress bar with step labels */
.sbar {
  height: 20px;
  background: var(--bd);
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0 8px;
}
.sbar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ok), var(--g));
  border-radius: 12px;
  transition: width .4s;
}
.slbl {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: .85rem;
  color: var(--mu);
}
.slbl .on { color: var(--g); font-weight: 700; }

/* "Order placed" confirmation page */
.ok {
  text-align: center;
  max-width: 640px;
  margin: 40px auto;
}
.ok .tick {
  font-size: 110px;
  color: var(--g);
  line-height: 1;
}


/* 11. BADGES & PILLS ====================================================== */
.pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: .95rem;
  font-weight: 700;
  background: #ffe9bf;     /* default: waiting / placed */
  color: #8a5a00;
}
.pill.s2 { background: var(--info-bg); color: var(--info-tx); }   /* out for delivery */
.pill.s3 { background: #d4f2dd; color: var(--g); }                /* done / ok */


/* 12. ALERTS & STOCK WARNINGS ============================================= */
.alert {
  background: var(--warn-bg);
  border: 2px solid var(--or);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  font-weight: 600;
}
.warnbox {
  background: var(--danger-bg);
  border-color: var(--rd);
  font-size: 1.1rem;
}

/* Warning icon: gentle fade (was a harsh blink) */
.warn {
  display: inline-block;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  50% { opacity: .5; }
}

/* Small horizontal bar in reports */
.bar {
  height: 16px;
  min-width: 3px;
  background: var(--g);
  border-radius: 8px;
}

/* Popup message at the bottom of the screen */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gd);
  color: var(--on-gd);
  padding: 16px 30px;
  border-radius: 12px;
  font-size: 1.1rem;
  opacity: 0;
  transition: .3s;
  pointer-events: none;
  z-index: 9;
}
#toast.on { opacity: 1; }


/* 13. ADMIN PANEL ========================================================= */
.adm {
  display: grid;
  grid-template-columns: 260px 1fr;   /* sidebar width | content */
  min-height: 100vh;
}
.adm aside {
  background: var(--gd);
  color: var(--on-gd);
  padding: 26px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.adm aside .brand {                      /* logo + store name at the top */
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.1;
}
.adm aside a {
  display: block;
  color: var(--on-gd);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 400;
  font-size: 1.1rem;
  opacity: .85;
}
.adm aside a.on {
  background: var(--g);
  color: var(--on-g);
  font-weight: 700;
  opacity: 1;
}

/* Dashboard number cards */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 20px 0;
}
.stats .panel b {
  display: block;
  font-size: 2.4rem;
}


/* 14. RESERVATION TABLE BOARD ============================================= */
.tt {
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  border: 3px solid;
  line-height: 1.5;
}
.tt.free { background: var(--ok-bg);     border-color: var(--ok); }
.tt.busy { background: var(--danger-bg); border-color: var(--rd); }
.tt.res  { background: #fff1d6;          border-color: var(--or); }
.tt.off  { background: #e6e6e6;          border-color: #999; }


/* 15. CASHIER ============================================================= */
.ctop {
  background: var(--gd);
  color: var(--on-gd);
  display: flex;
  gap: 22px;
  align-items: center;
  padding: 16px 32px;
  font-size: 1.2rem;
}
.ctop a { color: var(--on-gd); font-weight: 400; }

/* Row of action buttons on an order */
.cbtn {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}


/* 16. UTILITIES =========================================================== */
.noprint { }   /* hidden when printing (see section 18) */


/* 17. MOBILE (screens under 800px) ======================================== */
@media (max-width: 800px) {
  .cols,
  .adm,
  .tools,
  .stats        { grid-template-columns: 1fr; }

  h1            { font-size: 2.3rem; }
  nav           { gap: 14px; padding: 12px 16px; }
  main          { padding: 20px 14px; }
  .hero .big    { display: none; }
  .banner .big  { font-size: 70px; }

  /* Admin sidebar becomes a normal block on top instead of a full-height column */
  .adm aside    { position: static; height: auto; }
}


/* 18. PRINT (receipts & reports) ========================================== */
@media print {
  nav,
  .noprint,
  .adm aside { display: none !important; }
  .adm       { display: block; }
  body       { background: #fff !important; }
}


/* Accessibility: respect "reduce motion" system setting */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
