:root {
  --accent: #e8641c;
  --accent-dark: #c24e10;
  --accent-soft: #fff1e7;
  --ink: #23232a;
  --muted: #6b6b75;
  --line: #ececf1;
  --bg: #f6f6f9;
  --card: #ffffff;
  --ok: #0e7a3d;
  --warn-bg: #fff7e0;
  --warn-ink: #8a6100;
  --err-bg: #fdecec;
  --err-ink: #b3261e;
  --note-bg: #eef4ff;
  --note-ink: #1f4e9e;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
[dir="ltr"] body { direction: ltr; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }

/* Header */
.lk-header {
  background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 100%);
  border-bottom: 1px solid var(--line);
  padding: 20px 0 14px;
}
.lk-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.lk-logo img { width: 84px; height: 84px; border-radius: 20px; object-fit: cover; box-shadow: 0 4px 14px rgba(232,100,28,.25); }
.lk-headtext { flex: 1; min-width: 220px; }
.lk-title { margin: 0; font-size: 1.7rem; font-weight: 800; }
.lk-fact { color: var(--accent); font-weight: 700; font-size: .95rem; }
.lk-intro { margin: 6px 0 0; color: var(--muted); font-size: .95rem; max-width: 640px; }
.langrow { display: flex; gap: 8px; align-items: center; }
.langbtn {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 700; cursor: pointer;
}
.langbtn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Hero */
.lk-hero { display: flex; gap: 10px; overflow-x: auto; padding: 14px 0 4px; }
.lk-hero img { width: 180px; height: 180px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); flex: 0 0 auto; }

/* Sections */
.lk-section { margin-top: 20px; }
.lk-section > h2 { font-size: 1.15rem; margin: 0 0 10px; }

/* Search + chips */
.lk-search {
  width: 100%; padding: 12px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  font: inherit; background: #fff; outline: none;
}
.lk-search:focus { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 16px; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Cart bar */
.lk-cartbar { position: sticky; top: 0; z-index: 30; padding: 10px 0; }
.lk-cartbtn {
  width: 100%; border: 0; border-radius: 999px; padding: 13px 20px; font: inherit;
  font-weight: 800; font-size: 1rem; cursor: pointer;
  background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(232,100,28,.35);
}
.lk-cartbtn:hover { background: var(--accent-dark); }

/* Product grid */
.lk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.lk-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .15s ease;
}
.lk-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.lk-photowrap { position: relative; }
.lk-photowrap img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #fafafa; }
.lk-num {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: rgba(0,0,0,.55); color: #fff; font-size: .8rem; font-weight: 700;
  border-radius: 999px; padding: 2px 10px;
}
.lk-name { font-weight: 800; font-size: .98rem; }
.lk-desc { color: var(--muted); font-size: .85rem; flex: 1; }
.lk-price { font-weight: 800; color: var(--accent); font-size: 1.05rem; }
.addbtn {
  border: 1.5px solid var(--accent); color: var(--accent); background: #fff;
  border-radius: 999px; padding: 8px 0; width: 100%; font: inherit; font-weight: 800; cursor: pointer;
}
.addbtn:hover { background: var(--accent-soft); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--accent);
  background: #fff; color: var(--accent); font-size: 1.2rem; font-weight: 800; cursor: pointer; line-height: 1;
}
.stepper button:hover { background: var(--accent-soft); }
.stepper span { font-weight: 800; min-width: 20px; text-align: center; }

/* Lines / totals */
.lk-lines { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.lk-line { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; }
.lk-line .lk-linename { color: var(--ink); }
.lk-line .lk-unit { display: block; color: var(--muted); font-size: .8rem; }
.lk-line .lk-lineval { font-weight: 700; white-space: nowrap; }
.lk-total { border-top: 1px dashed var(--line); padding-top: 8px; font-weight: 800; }
.lk-delivery .lk-lineval { color: var(--muted); font-weight: 700; }

/* Buttons */
.btn {
  border: 0; border-radius: 999px; padding: 12px 26px; font: inherit; font-weight: 800;
  cursor: pointer; font-size: 1rem;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.primary:disabled { background: #d9d9e0; color: #8a8a94; cursor: not-allowed; }
.btn.secondary { background: #fff; border: 1.5px solid var(--line); color: var(--ink); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Callouts */
.callout { border-radius: var(--radius); padding: 12px 16px; margin-top: 12px; font-size: .92rem; }
.callout .callout-title { font-weight: 800; display: block; margin-bottom: 2px; }
.callout.note { background: var(--note-bg); color: var(--note-ink); }
.callout.warning { background: var(--warn-bg); color: var(--warn-ink); }
.callout.danger { background: var(--err-bg); color: var(--err-ink); }

/* Dialog */
dialog.lk-dialog {
  border: 0; border-radius: 18px; padding: 0; width: min(640px, 94vw);
  max-height: 88vh; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog.lk-dialog::backdrop { background: rgba(0,0,0,.45); }
.lk-dialogbody { padding: 20px; overflow-y: auto; max-height: 88vh; }
[dir="rtl"] dialog.lk-dialog { direction: rtl; }
.lk-dialogtop { display: flex; justify-content: flex-end; }
.lk-close { border: 0; background: #f0f0f4; border-radius: 999px; padding: 6px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.lk-dialogtitle { margin: 4px 0 14px; font-size: 1.25rem; }
.lk-linecontrols { display: flex; align-items: center; gap: 10px; }
.lk-remove { border: 0; background: none; color: var(--err-ink); font: inherit; font-size: .85rem; cursor: pointer; text-decoration: underline; }
.lk-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.lk-field label, .lk-selectlabel { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .92rem; }
.lk-input, .lk-select {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px;
  font: inherit; background: #fff; outline: none; width: 100%;
}
.lk-input:focus, .lk-select:focus { border-color: var(--accent); }
.lk-fielderror { color: var(--err-ink); font-size: .85rem; margin: 0; }
.lk-sendnote { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
.lk-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; position: sticky; bottom: 0; background: #fff; padding: 10px 0 6px; z-index: 2; }
.btn.lk-btn-off { background: #d9d9e0 !important; color: #555 !important; box-shadow: none; }
.lk-flash { animation: lkflash 1.1s ease; }
@keyframes lkflash { 0%, 100% { color: inherit; transform: none; } 30% { color: #b3261e; transform: scale(1.04); } 60% { color: #b3261e; } }
.lk-btnrow { display: flex; gap: 10px; flex-wrap: wrap; }
.lk-btnrow .btn { flex: 1; min-width: 150px; }
.lk-actions #fill-req { margin: 0 0 6px; }

/* Footer */
.lk-footer { margin: 34px 0 20px; color: var(--muted); font-size: .85rem; text-align: center; }

@media (max-width: 560px) {
  .lk-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .lk-hero img { width: 140px; height: 140px; }
  .lk-title { font-size: 1.35rem; }
  /* Dialog cart lines: two rows on narrow screens - name+unit price full width, controls on their own row */
  .lk-dialog .lk-line:has(.lk-linecontrols) { flex-direction: column; align-items: stretch; gap: 8px; }
  .lk-dialog .lk-line .lk-linecontrols { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 6px; }
  .lk-dialog .lk-line .lk-lineval { white-space: nowrap; }
  .lk-dialog .stepper { gap: 8px; }
  .lk-dialog .stepper button { width: 34px; height: 34px; }
  .lk-dialog .lk-remove { font-size: .8rem; flex-shrink: 0; }
  .lk-dialog .lk-linecontrols .stepper, .lk-dialog .lk-linecontrols .lk-lineval { flex-shrink: 0; }
  .lk-dialogbody { padding: 14px; }
  .lk-dialog .lk-lines { padding: 10px; }
}
