:root {
  --ink: #111111;
  --muted: #5b6366;
  --teal: #0E7C76;
  --teal-dark: #0a5f5a;
  --red: #D7262E;
  --yellow: #FFE600;
  --bg: #ffffff;
  --soft: #f4f7f6;
  --line: #e3e8e7;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Rubik, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

/* כותרת */
.top { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 14px; padding-block: 8px; }
.logo img { display: block; height: 52px; width: auto; }
.search { flex: 1; }
.search input {
  width: 100%; padding: 11px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--soft);
}
.search input:focus { border-color: var(--teal); background: #fff; outline: none; }
.cart-btn {
  position: relative; display: grid; place-items: center; width: 48px; height: 48px;
  border: 0; border-radius: 50%; background: var(--teal); cursor: pointer;
}
.cart-btn svg { width: 24px; height: 24px; fill: #fff; }
.cart-btn .badge {
  position: absolute; top: -4px; inset-inline-end: -4px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700;
  display: grid; place-items: center;
}
.ship-strip { background: var(--yellow); text-align: center; font-size: 14px; font-weight: 500; padding: 5px 10px; }

/* סינון */
.filters { padding-block: 18px 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; cursor: pointer; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.selects { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.selects label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); flex: 1 1 160px; }
.selects select {
  margin-top: 3px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.count { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* רשת מוצרים */
.status { padding: 40px 0; text-align: center; color: var(--muted); }
.status:empty { display: none; }
.grid {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow); }
.card-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; background: none; border: 0; padding: 0; text-align: inherit; cursor: pointer; }
.thumb { aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 10px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb img.fallback { width: 50%; opacity: .25; }
.card-info { padding: 0 12px 6px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.brand { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.name { font-size: 14px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.size { font-size: 13px; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 12px 12px; }
.price { font-weight: 700; font-size: 18px; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; }
.price .old { font-weight: 400; font-size: 14px; color: var(--muted); text-decoration: line-through; }
.price.sale { color: var(--red); }
.add {
  border: 0; border-radius: 10px; background: var(--teal); color: #fff; font-weight: 500;
  padding: 8px 12px; cursor: pointer; white-space: nowrap;
}
.add:hover { background: var(--teal-dark); }
.sale-badge { position: absolute; top: 8px; inset-inline-start: 8px; width: 52px; height: 52px; z-index: 1; }

.more { text-align: center; padding: 24px 0 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 500; cursor: pointer;
  background: var(--teal); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--teal-dark); }
.btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); }
.btn.wa { background: #25D366; color: #fff; width: 100%; font-size: 17px; padding: 14px; }
.btn.wa:hover { background: #1fb457; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* פוטר */
.foot { background: var(--ink); color: #e9eeed; margin-top: 30px; padding: 30px 0 14px; }
.foot h2 { color: #fff; font-size: 17px; margin: 0 0 8px; }
.foot p { margin: 0 0 8px; font-size: 14px; }
.foot-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.foot a { color: var(--yellow); }
.copy { font-size: 13px; opacity: .6; margin-top: 16px; }

/* חלונות */
.dlg {
  border: 0; border-radius: 18px; padding: 22px; width: min(860px, 100% - 24px); max-height: calc(100% - 24px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg .x {
  position: sticky; float: left; top: 0; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--soft); font-size: 24px; line-height: 1; cursor: pointer; z-index: 2;
}
.drawer { margin-inline: auto 0; margin-block: 0; height: 100%; max-height: 100%; width: min(460px, 100%); border-radius: 0; }
.drawer h2 { margin: 4px 0 16px; }

.p-grid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; clear: both; }
.p-gallery .main { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.p-gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.p-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.p-thumbs button { width: 58px; height: 58px; padding: 4px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.p-thumbs button[aria-current="true"] { border-color: var(--teal); }
.p-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.p-info h1 { font-size: 21px; margin: 4px 0 8px; }
.p-info .price { font-size: 26px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 14px 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.desc { white-space: pre-line; font-size: 15px; color: #2a2f31; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.buy-row { display: flex; gap: 10px; align-items: center; margin-top: 14px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 34px; height: 36px; border: 0; background: var(--soft); cursor: pointer; font-size: 18px; }
.qty input { width: 40px; height: 36px; border: 0; text-align: center; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* סל */
.c-items { list-style: none; margin: 0; padding: 0; }
.c-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.c-item img { width: 56px; height: 56px; object-fit: contain; }
.c-item .n { font-size: 14px; }
.c-item .p { font-weight: 700; }
.c-item .rm { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.c-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.totals { margin: 14px 0; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 19px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.hint { background: var(--soft); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin: 6px 0; }
.hint.ok { background: #e6f5f3; color: var(--teal-dark); }

.form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 8px; }
.form legend { font-weight: 500; margin-bottom: 6px; }
.seg { flex: 1; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; text-align: center; padding: 10px; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; }
.seg input:checked + span { border-color: var(--teal); background: #e6f5f3; font-weight: 500; }
.seg input:focus-visible + span { outline: 3px solid var(--teal); }
.form label.f { display: flex; flex-direction: column; font-size: 14px; gap: 3px; }
.form input[type=text], .form input[type=tel], .form select, .form textarea {
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--teal); outline: none; }
.form .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.err { color: var(--red); font-size: 14px; min-height: 1em; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }
.small { font-size: 13px; color: var(--muted); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 140%); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; transition: transform .25s; z-index: 100; font-size: 15px;
}
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .top-row { flex-wrap: wrap; gap: 8px; }
  .logo img { height: 42px; }
  .search { order: 3; flex-basis: 100%; }
  .cart-btn { margin-inline-start: auto; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-foot { flex-direction: column; align-items: stretch; }
  .add { width: 100%; }
  .p-grid { grid-template-columns: 1fr; }
  .dlg { padding: 16px; }
  .sale-badge { width: 44px; height: 44px; }
}
