/* ===========================
   שפע יששכר — עמדת שקילה
   עיצוב מלא: גרסה Production
   =========================== */

:root {
  --brand: #bf1e2e;
  --brand-dark: #8f1622;
  --surface: #ffffff;
  --bg: #f6f7f9;
  --ink: #1a1b1e;
  --muted: #667085;
  --border: #e1e3e9;
  --shadow: 0 6px 18px rgba(0,0,0,0.06);

  --h1: clamp(28px, 3.6vw, 48px);
  --h2: clamp(22px, 2.6vw, 34px);
  --body: clamp(16px, 1.6vw, 20px);

  --r: 14px;
}

/* === Global === */
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: "Heebo", "Rubik", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  user-select: none;
  overflow: hidden;
}

/* === Layout === */
.app {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  height: 100dvh;
}

/* === Header === */
.mast {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.mast-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 40px;
}
.logo {
  height: 80px;
  object-fit: contain;
}
.mast-center {
  text-align: center;
}
.mast-center h1 {
  margin: 0;
  color: var(--brand-dark);
  font-size: var(--h1);
  font-weight: 900;
}
.mast-center p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--body);
}
.mast-actions button {
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--r);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.mast-actions .primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.mast-actions button:hover {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}

/* === Tabs === */
.az {
  display: flex;
  gap: 10px;
  padding: 10px 40px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.az::-webkit-scrollbar { display: none; }
.az .tab {
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: var(--r);
  border: 2px solid var(--brand);
  background: #fff;
  color: var(--brand);
  font-weight: 900;
  cursor: pointer;
}
.az .tab.active {
  background: var(--brand);
  color: #fff;
}

/* === Grid === */
.gridWrap {
  padding: 24px 40px;
  overflow: hidden;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 200px;
  gap: 20px;
  overflow-y: auto;
  height: 100%;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.1s;
}
.tile:active { transform: scale(0.97); }
.thumb { font-size: 64px; }
.label { margin-top: 10px; font-weight: 700; }

/* price tag + badges */
.tag-price {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #101114cc;
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
}
.badge.popular { background: #10b981; }   /* ירוק "פופולרי" */
.badge.sale    { background: #f59e0b; }   /* כתום "מבצע" */
.badge.new     { background: #3b82f6; }   /* כחול "חדש" */

/* === Search === */
.searchWrap {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 14px 40px;
}
.search {
  display: flex;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
}
.search input {
  flex: 1;
  font-size: 22px;
  border: none;
  outline: none;
  background: transparent;
}
.search button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 900;
  cursor: pointer;
}

/* === Keyboard === */
.kbWrap {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 40px;
}
.simple-keyboard {
  max-width: 100%;
  user-select: none;
}

/* === Panel === */
.panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
}
.panel.open { display: flex; }
.sheet {
  width: min(1000px, 90vw);
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
.sheet-left {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}
.sheet-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sheet-img {
  width: 100px;
  height: 100px;
  font-size: 60px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #fff3f4;
  border: 1px solid var(--border);
}
.sheet-title { font-size: var(--h2); font-weight: 900; }
.scale-area {
  display: grid;
  place-items: center;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  height: 300px;
  background: #fff9f9;
}
.scale-num { font-size: 54px; font-weight: 900; color: var(--brand-dark); }
.calc { display: grid; gap: 10px; align-content: start; }
.row { display: flex; justify-content: space-between; font-size: 20px; }
.actions { display: flex; gap: 10px; margin-top: 12px; }
.actions button {
  padding: 12px 18px;
  border-radius: var(--r);
  border: none;
  font-weight: 900;
  cursor: pointer;
}
.actions .primary { background: var(--brand); color: #fff; }

/* === Sticker === */
.stickerWrap {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
}
.stickerWrap.open { display: flex; }
.sticker {
  width: 420px;
  background: #fff;
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 20px;
  text-align: right;
}
.barcode {
  margin-top: 10px;
  height: 60px;
  background: repeating-linear-gradient(90deg,#000 0 3px,transparent 3px 6px);
  border-radius: 4px;
}

/* === FAB (Fullscreen) === */
.fab {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 999;
}
.fab button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* === Tap Circle === */
#tapCircle {
  position: fixed;
  width: 80px;
  height: 80px;
  border: 4px solid var(--brand);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.3s;
  transform: scale(0.5);
  z-index: 1000;
}
#tapCircle.show {
  opacity: 0.7;
  transform: scale(1);
}
/* ===== תמונות מוצר (SVG) בכרטיסים ===== */
.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 70%;
  padding: 8px;
}

.thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ===== תמונת מוצר בחלון השקילה ===== */
.sheet-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff7f8;
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 8px;
}

.sheet-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
