/* ==========================================================================
   Cutigo — מערכת העיצוב
   כל המסכים נשענים על הקובץ הזה. שינוי כאן = שינוי בכל האפליקציה.
   מבוסס על ההחלטות ב-החלטות-Cutigo.md
   ========================================================================== */

:root {
  /* צבעים — ירוק וכתום שמורים לזמינות בלבד, אסור לקישוט */
  --bg:      #FFFFFF;
  --surf:    #F6F6F6;
  --ink:     #111111;
  --mid:     #6B6B6B;
  --border:  #E2E2E2;
  --accent:  #0A7EA4;
  --accent-soft: #E6F2F6;
  --green:   #048848;
  --green-soft: #E7F3EC;
  --orange:  #F0A030;
  --orange-soft: #FFF6EA;
  --gray:    #9A9A9A;
  --red:     #E11900;

  /* טיפוגרפיה — חמישה גדלים בלבד. מינימום 16px בכל מקום */
  --t-body:   16px;
  --t-lead:   18px;
  --t-title:  20px;
  --t-head:   24px;
  --t-hero:   32px;

  /* מרווחים — רק אלה */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px;

  --r-card: 12px;
  --r-btn:  14px;
  --r-sheet: 24px;

  --shadow-card: 0 2px 8px rgba(0,0,0,.06);
  --shadow-up:   0 -4px 16px rgba(0,0,0,.12);
  --shadow-pin:  0 2px 8px rgba(0,0,0,.20);

  --tap: 44px; /* שטח נגיעה מינימלי */
}

/* נעילת ערכת צבעים — בלי זה אנדרואיד כופה מצב כהה ושובר את העיצוב הבהיר */
:root { color-scheme: only light; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: #E9EBEA;
  font-family: 'Heebo', 'Segoe UI', system-ui, sans-serif;
  font-size: var(--t-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* מסגרת הטלפון — במחשב ממורכזת, בטלפון תופסת את כל המסך */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (min-width: 480px) {
  body { padding: var(--s5) 0; }
  .phone { min-height: 844px; height: 844px; border-radius: 28px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
}

/* ---------- כותרת ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s5) var(--s4) var(--s3);
  background: var(--bg);
  flex: 0 0 auto;
}
.topbar.shadow { box-shadow: var(--shadow-card); z-index: 5; }
.logo { font-size: var(--t-head); font-weight: 700; color: var(--accent); letter-spacing: -.5px; }
.topbar h1 { font-size: var(--t-head); font-weight: 700; margin: 0; }
.topbar .sub { font-size: var(--t-body); color: var(--mid); font-weight: 400; }
.spacer { flex: 1; }

.iconbtn {
  min-width: var(--tap); min-height: var(--tap);
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--ink); border-radius: 50%;
  text-decoration: none;
}
.iconbtn:active { background: var(--surf); }

/* אייקונים */
.mi {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal;
  font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap;
  direction: ltr; -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
}
.mi.sm { font-size: 20px; }
.mi.lg { font-size: 30px; }

/* ---------- שדה כתובת ---------- */
.field {
  flex: 1; display: flex; align-items: center; gap: var(--s2);
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 22px; padding: 0 var(--s4);
  height: var(--tap); font-size: var(--t-body); color: var(--ink);
}
.field .mi { color: var(--mid); }

/* ---------- שדה חיפוש ---------- */
.field input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  font-family: inherit; font-size: var(--t-body); color: var(--ink);
  height: var(--tap); padding: 0;
}
.field input:focus { outline: none; }
.field input::-webkit-search-cancel-button { display: none; }
.field:focus-within { border-color: var(--accent); }
.clearq {
  border: 0; background: none; color: var(--mid);
  min-width: 32px; min-height: 32px; display: grid; place-items: center;
  cursor: pointer; padding: 0;
}

/* ---------- כפתור "המיקום שלי" ---------- */
.fab {
  position: absolute; inset-inline-end: var(--s4); bottom: var(--s4);
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bg); border: 0; color: var(--ink);
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  display: grid; place-items: center; cursor: pointer;
  z-index: 450;
}
.fab:active { background: var(--surf); }

/* ---------- הנקודה שלי על המפה ---------- */
.me-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(10,126,164,.22);
  display: grid; place-items: center;
}
.me-dot i {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  display: block;
}

/* ---------- מצב ריק ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  text-align: center; padding: var(--s6) var(--s5);
  color: var(--mid);
}
.empty .mi { color: var(--border); }
.empty b { font-size: var(--t-lead); color: var(--ink); }
.empty .btn { margin-top: var(--s4); }

/* ---------- הודעה קצרה ---------- */
.toast {
  position: absolute; inset-inline: var(--s4); bottom: 30%;
  background: rgba(17,17,17,.94); color: #fff;
  border-radius: var(--r-card); padding: var(--s3) var(--s4);
  font-size: 15px; text-align: center; z-index: 950;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.toast.on { opacity: 1; }

/* ---------- מפה ---------- */
.map { position: relative; flex: 1 1 auto; min-height: 300px; background: var(--surf); }
.map .leaflet-container { width: 100%; height: 100%; background: #E9EDEB; }

.pin {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  border: 3px solid #fff; box-shadow: var(--shadow-pin);
  color: #fff; font-size: 22px;
}
.pin .mi { font-size: 24px; }
.pin.g { background: var(--green); }
.pin.o { background: var(--orange); }
.pin.x { background: var(--gray); }
.pin.a { background: var(--accent); }
.pin.home { background: var(--ink); width: 40px; height: 40px; }

/* ---------- מגירה נגררת ---------- */
.sheet {
  position: absolute; inset-inline: 0; bottom: 0;
  background: var(--bg);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: var(--shadow-up);
  z-index: 500;
  display: flex; flex-direction: column;
  height: 26%;            /* מתחילה נמוך — המפה היא העיקר. גרירה למעלה פותחת */
  min-height: 150px;
  transition: height .28s cubic-bezier(.32,.72,0,1);
  touch-action: none;
}
.sheet.open { height: 88%; }
.grabber { padding: var(--s3) 0 var(--s2); display: grid; place-items: center; cursor: grab; }
.grabber i { width: 48px; height: 5px; border-radius: 3px; background: var(--border); display: block; }
.sheet-head { display: flex; align-items: baseline; gap: var(--s3); padding: 0 var(--s4) var(--s3); }
.sheet-head h2 { font-size: var(--t-title); font-weight: 700; margin: 0; }
.sheet-head .count { font-size: 14px; color: var(--mid); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: var(--s5); }

/* ---------- שורת ספר ---------- */
.barber {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4);
  border-top: 1px solid var(--border);
  text-decoration: none; color: inherit;
  min-height: 86px;
}
.barber:first-child { border-top: 0; }
.barber:active { background: var(--surf); }
.avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--surf); border: 3px solid var(--gray);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700; color: var(--mid);
  flex: 0 0 auto; overflow: hidden;
}
.avatar.g { border-color: var(--green); }
.avatar.o { border-color: var(--orange); }
.avatar.x { border-color: var(--gray); }
.barber .info { flex: 1; min-width: 0; }
.barber .name { font-size: var(--t-lead); font-weight: 700; }
.barber .meta, .barber .rate { font-size: 14px; color: var(--mid); margin-top: 2px; }
.barber .right { text-align: left; flex: 0 0 auto; }

.state { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.state::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.state.g { color: var(--green); }
.state.o { color: var(--orange); }
.state.x { color: var(--gray); }
.eta { font-size: 14px; font-weight: 500; margin-top: var(--s2); }

/* ---------- שבב ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px var(--s3); border-radius: 999px;
  font-size: 14px; font-weight: 500;
}
.chip.g { background: var(--green-soft); color: var(--green); }
.chip.o { background: var(--orange-soft); color: var(--orange); }
.chip.x { background: var(--surf); color: var(--gray); }
.chip.new { background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* ---------- תוכן ---------- */
.scroll { flex: 1 1 auto; overflow-y: auto; }
.pad { padding: 0 var(--s4); }
.sect-title { font-size: var(--t-title); font-weight: 700; margin: var(--s5) 0 var(--s3); }
.hr { height: 1px; background: var(--border); margin: var(--s5) 0; }
.muted { color: var(--mid); font-size: 14px; }
.center { text-align: center; }

/* ---------- גלריה ---------- */
.gallery { display: grid; grid-template-columns: 1fr 82px 78px; gap: var(--s2); }
.gallery .big { grid-row: span 2; aspect-ratio: 1; }
.ph {
  background: #DADDE0; border-radius: var(--r-card);
  display: grid; place-items: center; color: #fff;
}
.ph.small { height: 82px; }
.more {
  background: var(--surf); border: 1px solid var(--border);
  border-radius: var(--r-card); display: grid; place-items: center;
  font-size: var(--t-lead); font-weight: 700; color: var(--mid);
}

/* ---------- טבלת שירותים ---------- */
.srv {
  display: flex; align-items: center; gap: var(--s2);
  background: var(--surf); border-radius: 10px;
  padding: var(--s3); margin-bottom: var(--s2);
  min-height: var(--tap);
}
.srv .nm { flex: 1; font-weight: 500; }
.srv .tm { width: 72px; text-align: center; font-size: 14px; color: var(--mid); }
.srv .pr { width: 76px; text-align: left; font-weight: 700; color: var(--accent); }
/* שירות שאפשר לבחור */
button.srv {
  width: 100%; font-family: inherit; font-size: var(--t-body);
  color: var(--ink); border: 1.5px solid transparent; cursor: pointer;
  text-align: right;
}
button.srv.on { border-color: var(--accent); background: var(--accent-soft); }
button.srv.on .nm { font-weight: 700; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- כפתורים ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  width: 100%; min-height: 56px;
  border: 0; border-radius: var(--r-btn);
  font-family: inherit; font-size: var(--t-lead); font-weight: 700;
  cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:active { background: #000; }
.btn.ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--border); min-height: 52px; font-weight: 500; font-size: var(--t-body); }
.btn.ghost:active { background: var(--surf); }
.btn.dashed {
  background: var(--accent-soft); color: var(--accent);
  border: 1.5px dashed var(--accent); min-height: 48px; font-size: var(--t-body);
}
.btn.text { background: none; color: var(--mid); font-weight: 500; font-size: var(--t-body); min-height: var(--tap); }
.btn.money {
  flex-direction: column; gap: var(--s1);
  background: var(--accent); color: #fff;
  min-height: 196px; border-radius: 20px;
}
.btn.money .amount { font-size: 60px; font-weight: 700; line-height: 1.1; }
.btn.money .what { font-size: 17px; font-weight: 500; }
.btn.money .hint {
  margin-top: var(--s2); background: rgba(255,255,255,.22);
  border-radius: 999px; padding: 6px var(--s4);
  font-size: 15px; font-weight: 700;
}
.btn.money:active { filter: brightness(.94); }

.footer-actions { flex: 0 0 auto; padding: var(--s3) var(--s4) var(--s5); background: var(--bg); }

/* ---------- שורת פרט ---------- */
.detail {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surf); border-radius: var(--r-card);
  padding: var(--s3) var(--s4); margin-bottom: var(--s2);
}
.detail .mi { color: var(--accent); }
.detail .t { font-size: 17px; font-weight: 700; }
.detail .d { font-size: 14px; color: var(--mid); margin-top: 2px; }

/* ---------- טיימר ---------- */
.timer {
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  background: var(--orange-soft); color: var(--orange);
  border-radius: var(--r-card); min-height: 52px;
  font-size: 17px; font-weight: 700;
}

/* ---------- פס התקדמות (רץ מימין לשמאל) ---------- */
.progress { position: relative; height: 40px; margin: var(--s5) 0 var(--s2); }
.progress .track {
  position: absolute; top: 16px; inset-inline: 26px 0;
  height: 8px; border-radius: 4px; background: var(--border);
}
.progress .fill {
  position: absolute; top: 16px; right: 0;
  height: 8px; border-radius: 4px; background: var(--accent);
  transition: width 1s linear;
}
.progress .home {
  position: absolute; top: 10px; inset-inline-start: 0;
  color: var(--ink);
}
.progress .runner {
  position: absolute; top: 0;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff;
  box-shadow: var(--shadow-pin);
  display: grid; place-items: center; color: #fff;
  transition: right 1s linear;
}

/* ---------- שדות עריכה ---------- */
.editrow { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.editrow input {
  font-family: inherit; font-size: var(--t-body); color: var(--ink);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; min-height: 46px; padding: 0 var(--s3);
  text-align: right; width: 100%;
}
.editrow input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.editrow .nm { flex: 1; min-width: 0; }
.editrow .tm { width: 66px; }
.editrow .tm input { text-align: center; padding: 0 var(--s1); color: var(--mid); }
.editrow .pr { width: 66px; }
.editrow .pr input { text-align: center; padding: 0 var(--s1); font-weight: 700; color: var(--accent); }
.editrow .del { color: var(--red); min-width: 36px; }
.colhead { display: flex; gap: var(--s2); font-size: 13px; font-weight: 500; color: var(--mid); margin-bottom: var(--s2); }
.colhead .nm { flex: 1; }
.colhead .tm, .colhead .pr { width: 66px; text-align: center; }
.colhead .del { min-width: 36px; }

.photoslot {
  width: 46px; height: 46px; border-radius: 8px;
  flex: 0 0 auto; position: relative;
  background: #DADDE0; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
}
.photoslot.empty {
  background: var(--accent-soft);
  border: 1.5px dashed var(--accent); color: var(--accent);
}
.photoslot .badge {
  position: absolute; inset-inline-end: -4px; bottom: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  display: grid; place-items: center; color: #fff;
}
.photoslot .badge .mi { font-size: 12px; }

/* ---------- מתג ---------- */
.toggle-row {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surf); border-radius: var(--r-card);
  padding: var(--s3) var(--s4); min-height: 56px;
}
.toggle-row .lbl { flex: 1; font-weight: 500; }
.switch { width: 52px; height: 30px; flex: 0 0 auto; position: relative; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--gray); transition: background .2s;
}
.switch .slider::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  transition: inset-inline-start .2s;
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::after { inset-inline-start: 25px; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- כרטיס מוצר ---------- */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.product {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surf); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: var(--s3);
}
.product .pimg { width: 56px; height: 60px; border-radius: 8px; background: #DADDE0; flex: 0 0 auto; }
.product .pname { font-weight: 500; font-size: 15px; }
.product .pprice { font-weight: 700; color: var(--accent); margin-top: var(--s1); }

/* ---------- דירוג ---------- */
.smileys { display: flex; gap: var(--s3); justify-content: center; }
.smiley {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--surf); border: 2px solid var(--border);
  font-size: 40px; cursor: pointer; display: grid; place-items: center;
}
.smiley:active { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- תפריט המבורגר (drawer) ---------- */
.scrim {
  position: absolute; inset: 0; z-index: 900;
  background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.scrim.on { opacity: 1; pointer-events: auto; }

/* יושבת בצד ימין ונכנסת מימין — לכן מיקום פיזי ולא לוגי */
.drawer {
  position: absolute; top: 0; bottom: 0; right: 0; z-index: 901;
  width: 80%; max-width: 320px;
  background: var(--bg);
  box-shadow: -6px 0 24px rgba(0,0,0,.18);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
}
.drawer.on { transform: none; }

.drawer-head {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s5) var(--s4) var(--s4);
  border-bottom: 1px solid var(--border);
}
.drawer-head .who { flex: 1; min-width: 0; }
.drawer-head .who b { display: block; font-size: var(--t-lead); }
.drawer-head .who span { display: block; font-size: 14px; color: var(--mid); margin-top: 2px; }

.drawer-group {
  font-size: 13px; font-weight: 700; color: var(--mid);
  padding: var(--s4) var(--s4) var(--s2);
}
.drawer-head .avatar { width: 50px; height: 50px; }
.drawer-head .avatar .mi { font-size: 26px; color: var(--mid); }
.drawer-links { flex: 1; padding: var(--s2) 0; overflow-y: auto; }
.drawer-links a, .drawer-foot a {
  display: flex; align-items: center; gap: var(--s3);
  min-height: 56px; padding: 0 var(--s4);
  text-decoration: none; color: var(--ink);
  font-size: var(--t-body); font-weight: 500;
}
.drawer-links a .mi, .drawer-foot a .mi { color: var(--mid); }
.drawer-links a > span:nth-child(2) { flex: 1; }
.drawer-links a .chev { color: var(--border); }
.drawer-links a:active, .drawer-foot a:active { background: var(--surf); }
.drawer-links a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.drawer-links a[aria-current="page"] .mi { color: var(--accent); }
.drawer-foot { border-top: 1px solid var(--border); padding: var(--s2) 0 var(--s5); }
.drawer-foot a { font-weight: 400; color: var(--mid); }

/* כותרת מרחפת מעל מפה — לתפריט בלבד */
.topbar.float {
  position: absolute; top: 0; inset-inline: 0; z-index: 600;
  background: transparent; pointer-events: none; padding-bottom: 0;
}
.topbar.float .iconbtn {
  pointer-events: auto;
  background: var(--bg); box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

/* ---------- פס הזמנה פעילה (מופיע רק כשיש הזמנה) ---------- */
.active-order {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--accent); color: #fff;
  padding: var(--s3) var(--s4);
  text-decoration: none; min-height: 56px;
  z-index: 6;
}
.active-order .txt { flex: 1; }
.active-order b { font-weight: 700; }
.active-order .when { font-weight: 700; }

/* ---------- span-ים שצריכים להתנהג כשורות ----------
   (הרשימות והפרטים בנויים מ-span בתוך קישור, אחרת הכל נדחס לשורה אחת) */
.barber .info,
.barber .name, .barber .meta, .barber .rate,
.barber .right, .barber .eta,
.detail > span:last-child, .detail .t, .detail .d { display: block; }
.detail { align-items: center; }
.gallery .more { grid-row: span 2; }

/* נגישות */
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
