/* Shared styles: fonts, base, and the components every page uses.
   Each component is built once (DP-6). Values come from tokens.css. */

/* ---------- Fonts. All OFL, the license sits next to each file ---------- */

@font-face {
  font-family: "Noot";
  src: url("/assets/fonts/noot/Noot.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "NootJumpy";
  src: url("/assets/fonts/noot/NootJ.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka/fredoka-hebrew.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range:
    U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Rubik";
  src: url("/assets/fonts/rubik/rubik-hebrew.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range:
    U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Rubik";
  src: url("/assets/fonts/rubik/rubik-latin.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + var(--header-h) + var(--space-3)); /* anchors land under the two bars */
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-m);
  line-height: 1.5;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

/* Zero specificity, so a component's own padding always wins */
:where(ul, ol)[role="list"] {
  list-style: none;
  padding: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* M-03: a thick ring that settles into place, so keyboard users always see where they are */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  animation: focus-in var(--duration-base) var(--ease-spring);
}

@keyframes focus-in {
  from {
    outline-offset: 9px;
  }
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font: 600 var(--text-m) / 1.4 var(--font-ui);
  translate: 0 -200%;
}

.skip-link:focus {
  translate: 0 0;
}

/* Surfaces. On red, text turns white and focus turns yellow */
.on-red {
  background: var(--color-brand-red);
  color: var(--color-on-red);
  --focus-ring: var(--color-brand-yellow);
}

/* ---------- Concept bar: the only layer that stays on screen (legal, DP-4) ---------- */

.concept-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 6px var(--gutter);
  background: var(--color-ink);
  color: var(--color-bg);
  font: 500 var(--text-xs) / 1.4 var(--font-body);
  text-align: center;
}

/* ---------- Logo and its wink (M-01) ---------- */

.logo {
  overflow: visible;
}

.logo .logo-wordmark,
.logo .logo-tagline {
  fill: var(--color-brand-yellow);
}

.logo .logo-A {
  stroke: var(--color-brand-yellow);
}

.logo .logo-face {
  stroke: var(--color-brand-red);
}

.logo .logo-eye-star path,
.logo .logo-open {
  fill: var(--color-brand-red);
}

.logo .logo-M,
.logo .logo-A,
.logo .logo-X {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.logo .logo-eye-star path {
  transform-box: fill-box;
  transform-origin: center;
}

.logo .logo-smile {
  stroke-dasharray: 140;
}

.is-winking .logo-A {
  animation: logo-bounce 0.7s var(--ease-spring) both;
}
.is-winking .logo-M {
  animation: logo-bounce 0.7s 0.08s var(--ease-spring) both;
}
.is-winking .logo-X {
  animation: logo-bounce 0.7s 0.16s var(--ease-spring) both;
}
.is-winking .logo-smile {
  animation: logo-draw var(--duration-peak) 0.35s var(--ease-out) both;
}
.is-winking .logo-eye-star path {
  animation: logo-pop var(--duration-peak) 0.5s cubic-bezier(0.3, 1.8, 0.5, 1)
    both;
}
.is-winking .logo-open {
  animation: logo-eye-open 1.4s 0.2s steps(1) both;
}
.is-winking .logo-wink {
  animation: logo-wink 1.4s 0.2s steps(1) both;
}

@keyframes logo-bounce {
  0% {
    transform: scale(1, 0.6) translateY(40%);
  }
  60% {
    transform: scale(0.95, 1.08);
  }
  100% {
    transform: none;
  }
}
@keyframes logo-draw {
  from {
    stroke-dashoffset: 140;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes logo-pop {
  0% {
    transform: scale(0) rotate(-180deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}
@keyframes logo-eye-open {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 0;
  }
}
@keyframes logo-wink {
  0% {
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
}

/* The logo always carries a visible "concept" mark (legal) */
.concept-tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-ink);
  font: 600 var(--text-xs) / 1 var(--font-ui);
  white-space: nowrap;
  rotate: -8deg;
}

/* ---------- The face (03-brand.md, "הפרצוף כמערכת") ---------- */

.face {
  width: 40px;
  aspect-ratio: 249 / 290;
  flex: none;
  color: var(--color-brand-yellow);
  --face-ink: var(--color-brand-red);
}

.face__body {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 52;
  stroke-linejoin: round;
}

.face__dot,
.face__fill {
  fill: var(--face-ink);
}

/* The eyes can look aside. --look is registered so it can be animated, and it reaches inside <use> by inheritance (M-12) */
@property --look {
  syntax: "<length>";
  inherits: true;
  initial-value: 0px;
}

.face__dot {
  translate: var(--look) 0;
}

/* M-12: eyes to one side, then the other, the head tilting with them */
@keyframes face-look {
  0%, 100% { --look: 0px; rotate: 0deg; }
  25% { --look: -16px; rotate: -10deg; }
  50% { --look: 0px; rotate: 0deg; }
  75% { --look: 16px; rotate: 10deg; }
}

.face__line {
  fill: none;
  stroke: var(--face-ink);
  stroke-width: 20;
  stroke-linecap: round;
}

.face__star {
  fill: var(--face-ink);
  stroke: var(--face-ink);
  stroke-width: 4;
  stroke-linejoin: round;
}

/* ---------- Header: three zones, and the logo always in the middle (D-059).
   The sides are equal columns, so the centre is the page's centre whatever sits beside it.
   It stays on top, under the concept bar, on every page (D-060) ---------- */

.site-header {
  position: sticky;
  top: var(--bar-h);
  z-index: 40;
}

.site-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: var(--header-h);
}

.site-header__start {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-header__brand {
  --mark-h: 32px; /* the height of the letters, the same on every page */
  grid-column: 2;
  position: relative;
  display: block;
  text-decoration: none;
}

.site-header__brand .logo {
  display: block;
  width: auto;
  height: var(--mark-h);
}

/* The "קונספט" mark rides on the logo's corner, so the logo itself is what's centred. It never leaves the logo (legal) */
.site-header__brand .concept-tag {
  position: absolute;
  top: -10px;
  inset-inline-end: -30px;
  padding: 3px 8px;
  font-size: 11px;
}

.site-header__end {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
}

.site-nav {
  display: none;
}

.site-nav ul {
  display: flex;
  gap: var(--space-1);
}

.action {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding-inline: 10px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: inherit;
  font: 500 var(--text-m) / 1 var(--font-ui);
  text-decoration: none;
  cursor: pointer;
}

.action:hover {
  background: var(--color-red-deep);
}

.action svg {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Words that phones show as an icon only: "סניפים" and "הרשימה שלי". They come back with the links */
.action__label,
.action__label--wide {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* M-05: the counter bumps when something lands in the list */
.count {
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: var(--radius-full);
  background: var(--color-brand-yellow);
  color: var(--color-ink);
  font: 600 var(--text-xs) / 22px var(--font-ui);
  text-align: center;
}

.count:empty,
.count[data-count="0"] {
  display: none;
}

.count.is-bumped {
  animation: bump var(--duration-peak) var(--ease-spring);
}

@keyframes bump {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.5) translateY(-3px);
  }
  100% {
    transform: scale(1);
  }
}

/* The links need about 380px beside a centred logo, so they replace the menu button from 1024px */
@media (min-width: 1024px) {
  .site-header__menu {
    display: none;
  }

  .site-nav {
    display: block;
  }

  .site-header__brand {
    --mark-h: 36px;
  }

  .action__label,
  .action__label--wide {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }
}

/* ---------- Buttons: three kinds only (DP-6) ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 10px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  font: 600 var(--text-m) / 1.1 var(--font-ui);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--duration-base) var(--ease-spring),
    background-color var(--duration-fast),
    color var(--duration-fast);
}

/* M-02: pressed in, springs back */
.btn:active {
  transform: scale(0.94);
  transition-duration: 80ms;
  transition-timing-function: var(--ease-out);
}

/* M-32: a pin hops when you reach for the way to a branch, and the list's heart beats once */
.action--branches:is(:hover, :focus-visible) svg,
.btn:is(:hover, :focus-visible) svg:has(use[href="#i-pin"]) {
  transform-origin: 50% 100%;
  animation: pin-hop var(--duration-peak) var(--ease-out);
}

.action[popovertarget="my-list"]:is(:hover, :focus-visible) svg {
  animation: heart-beat var(--duration-peak) var(--ease-out);
}

@keyframes pin-hop {
  0% { translate: 0 0; scale: 1 1; }
  35% { translate: 0 -6px; scale: 0.95 1.05; }
  65% { translate: 0 0; scale: 1.1 0.9; }
  100% { translate: 0 0; scale: 1 1; }
}

@keyframes heart-beat {
  0%, 100% { scale: 1; }
  30% { scale: 1.2; }
  55% { scale: 0.94; }
  75% { scale: 1.06; }
}

.btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn--primary {
  background: var(--color-brand-red);
  color: var(--color-on-red);
}

.btn--primary:hover {
  background: var(--color-red-deep);
}

.btn--secondary {
  border-color: currentColor;
  background: transparent;
  color: var(--color-brand-red);
}

.btn--text {
  padding-inline: var(--space-1);
  background: transparent; /* also when it's a <button> */
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.btn--small {
  padding: 8px 16px;
  font-size: var(--text-s);
}

/* On red the same buttons invert, so they stay the same three kinds */
.on-red .btn--primary {
  background: var(--color-surface);
  color: var(--color-brand-red);
}

.on-red .btn--primary:hover {
  background: var(--color-yellow-tint);
}

.on-red .btn--secondary {
  color: var(--color-on-red);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Chips and the search field: filters, never forms (nothing is sent anywhere) ---------- */

.chips {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1.5px var(--color-line);
  color: var(--color-ink);
  font: 500 var(--text-s) / 1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    color var(--duration-fast),
    box-shadow var(--duration-fast),
    transform var(--duration-base) var(--ease-spring);
}

.chip:hover {
  box-shadow: inset 0 0 0 1.5px var(--color-ink);
}

.chip[aria-pressed="true"] {
  background: var(--color-ink);
  box-shadow: none;
  color: var(--color-surface);
}

.chip:active {
  transform: scale(0.94);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search svg {
  position: absolute;
  inset-inline-start: 16px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--color-muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  min-height: 48px;
  padding-inline: 46px 16px;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1.5px var(--color-line);
  color: var(--color-ink);
  font: 400 var(--text-m) / 1.2 var(--font-body);
}

.search input::placeholder {
  color: var(--color-muted);
}

.search input:hover {
  box-shadow: inset 0 0 0 1.5px var(--color-muted);
}

/* ---------- Sections ---------- */

.section {
  padding-block: var(--space-6);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.section-title {
  font: 600 var(--text-xl) / 1.2 var(--font-ui);
}

.section-sub {
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: var(--text-s);
}

@media (min-width: 900px) {
  .section {
    padding-block: var(--space-7);
  }

  .section-title {
    font-size: var(--text-2xl);
  }
}

/* A row you scroll sideways yourself. Nothing here moves on its own (D-015) */
.row {
  --card-w: 148px;
  display: flex;
  gap: var(--space-4);
  padding-block: var(--space-2) var(--space-4);
  padding-inline: max(var(--gutter), (100% - var(--container)) / 2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), (100% - var(--container)) / 2);
  scrollbar-width: none;
}

.row::-webkit-scrollbar {
  display: none;
}

.row > li {
  flex: 0 0 var(--card-w);
  scroll-snap-align: start;
}

.row-nav {
  display: none;
  gap: var(--space-2);
}

.row-nav .icon-btn {
  border: 2px solid var(--color-line);
}

.row-nav .icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.row-nav__prev svg {
  scale: -1 1;
}

/* M-11: the arrow leans the way it will move the row */
.row-nav svg {
  transition: translate var(--duration-base) var(--ease-spring);
}

.row-nav__next:not(:disabled):hover svg { translate: -3px 0; }
.row-nav__prev:not(:disabled):hover svg { translate: 3px 0; }

/* With a mouse the arrows page through the row, so it stays inside the container like the rest of the page,
   and a whole number of cards fills it exactly. Phones keep the edge-to-edge row, where the cut card says "there's more" */
@media (min-width: 900px) {
  .row {
    --per-row: 5;
    --card-w: calc(
      (100% - (var(--per-row) - 1) * var(--space-5)) / var(--per-row)
    );
    gap: var(--space-5);
    width: min(100% - 2 * var(--gutter), var(--container));
    margin-inline: auto;
    padding-inline: 0;
    scroll-padding-inline: 0;
  }
}

@media (min-width: 1100px) {
  .row {
    --per-row: 6;
  }
}

@media (min-width: 1280px) {
  .row {
    --per-row: 7;
  }
}

@media (hover: hover) and (pointer: fine) {
  .row-nav {
    display: flex;
  }
}

/* A shelf you see whole: exactly two rows from 600px up (three on phones), and the rest is one link away (D-041).
   Columns match the sideways rows above, so cards keep one size down the page */
.grid {
  --cols: 2;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
  padding-block: var(--space-2) var(--space-4);
}

.grid > li:nth-child(n + 7) {
  display: none;
}

@media (min-width: 600px) {
  .grid {
    --cols: 4;
  }
  .grid > li:nth-child(n + 7) {
    display: revert;
  }
  .grid > li:nth-child(n + 9) {
    display: none;
  }
}

@media (min-width: 900px) {
  .grid {
    --cols: 5;
    column-gap: var(--space-5);
  }
  .grid > li:nth-child(n + 9) {
    display: revert;
  }
  .grid > li:nth-child(n + 11) {
    display: none;
  }
}

@media (min-width: 1100px) {
  .grid {
    --cols: 6;
  }
  .grid > li:nth-child(n + 11) {
    display: revert;
  }
  .grid > li:nth-child(n + 13) {
    display: none;
  }
}

@media (min-width: 1280px) {
  .grid {
    --cols: 7;
  }
  .grid > li:nth-child(n + 13) {
    display: revert;
  }
}

/* "To all of it", across from the title. The arrow nudges like the one in a punched corner (M-11) */
.section-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font: 600 var(--text-s) / 1.2 var(--font-ui);
  white-space: nowrap;
  text-decoration: none;
}

.section-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate var(--duration-base) var(--ease-spring);
}

.section-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.section-link:hover svg {
  translate: -3px 0;
}

/* ---------- Department circle. Shared: the row under the hero, and the brand page (D-070) ---------- */

.token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  font: 500 var(--text-xs) / 1.25 var(--font-ui);
  text-align: center;
  text-decoration: none;
  scroll-snap-align: start;
}

/* One calm circle for every department: white, a hairline, a thin icon (D-031) */
.token__shape {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-line);
  color: var(--color-ink);
  transition:
    background-color var(--duration-base),
    box-shadow var(--duration-base);
}

.token__shape svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: translate var(--duration-base) var(--ease-out);
}

.token__label {
  min-height: 2.5em;
}

/* The deal and "new" are said in words, in the brand's two colors */
.token__word {
  font: 600 var(--text-s) / 1 var(--font-ui);
  white-space: nowrap;
}

.token--deal .token__shape {
  background: var(--color-brand-red);
  box-shadow: none;
  color: var(--color-on-red);
}

.token--new .token__shape {
  background: var(--color-brand-yellow);
  box-shadow: none;
}

/* M-26: under the pointer or the focus ring, the circle takes the ink line and the icon rises a little */
.token:hover .token__shape,
.token:focus-visible .token__shape {
  box-shadow: inset 0 0 0 1.5px var(--color-ink);
}

.token:hover .token__shape svg,
.token:focus-visible .token__shape svg {
  translate: 0 -2px;
}

.token--deal:hover .token__shape,
.token--deal:focus-visible .token__shape {
  background: var(--color-red-deep);
  box-shadow: none;
}

.token--new:hover .token__shape,
.token--new:focus-visible .token__shape {
  box-shadow: inset 0 0 0 1.5px var(--color-ink);
}

/* M-30: the object in the circle gives a small nod, once per visit of the pointer. The words "3 ב-100" and "חדש" pop instead */
.token:is(:hover, :focus-visible) .token__shape svg {
  transform-origin: 50% 85%;
  animation: icon-nod var(--duration-peak) var(--ease-out);
}

.token:is(:hover, :focus-visible) .token__word {
  animation: word-pop var(--duration-base) var(--ease-spring);
}

@keyframes icon-nod {
  0% { rotate: 0deg; }
  30% { rotate: -12deg; }
  60% { rotate: 7deg; }
  100% { rotate: 0deg; }
}

@keyframes word-pop {
  0% { scale: 1; }
  50% { scale: 1.12; }
  100% { scale: 1; }
}

@media (min-width: 900px) {
  .token {
    width: auto;
    min-width: 84px;
    font-size: var(--text-s);
  }

  .token__label {
    min-height: 0;
    white-space: nowrap;
  }

  .token__shape {
    width: 72px;
    height: 72px;
  }

  .token__shape svg {
    width: 30px;
    height: 30px;
  }

  .token__word {
    font-size: var(--text-m);
  }
}

/* ---------- Product card. A soft frame with one corner punched out, and the heart sits in the hole (D-032) ---------- */

.card {
  position: relative;
  container-type: inline-size; /* stickers sit on the frame, sized in cqi */
}

.card__link {
  display: block;
  text-decoration: none;
}

/* The punch is drawn at the physical top left, which is inline-end in this RTL site, where the heart sits */
.card__frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--color-surface);
  mask:
    var(--shape-punch) 0 0 / var(--punch) var(--punch) no-repeat,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

/* Photos arrive cropped to the same share of the same white square, so they simply fill the frame (D-040).
   M-29, as everywhere a picture is a way in: it moves in slowly when you reach for the card (D-046) */
.card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--duration-slow) var(--ease-out);
}

.card:is(:hover, :focus-within) .card__frame img {
  scale: var(--zoom-in);
}

.card__name {
  display: block;
  margin-top: var(--space-2);
  font: 500 var(--text-s) / 1.35 var(--font-body);
}

.card__link:hover .card__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card__price {
  margin-top: var(--space-1);
  color: var(--color-brand-red);
  font: 600 var(--text-price) / 1.1 var(--font-ui);
}

/* Positioned so the hidden spoken price stays inside sideways rows instead of widening the page */
.price {
  position: relative;
}

.price__visual {
  unicode-bidi: isolate;
}

.price sup {
  position: relative;
  top: -0.05em;
  margin-inline-start: 1px;
  font-size: 0.55em;
  line-height: 0;
  vertical-align: super;
}

/* On sale: the old price after the one you pay, struck through, smaller and quiet (D-063).
   Positioned for the same reason as .price: the spoken words stay inside sideways rows */
.was {
  position: relative;
  margin-inline-start: 0.4em;
  color: var(--color-muted);
  font-size: 0.6em;
  font-weight: 500;
  text-decoration-thickness: 1.5px;
}

.tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: var(--radius-full);
  font: 600 var(--text-xs) / 1 var(--font-ui);
}

.tag--deal {
  background: var(--color-brand-yellow);
  color: var(--color-ink);
  rotate: -4deg;
  transition:
    rotate var(--duration-base) var(--ease-spring),
    scale var(--duration-base) var(--ease-spring);
}

/* M-31: reach for a toy in the deal and its sticker gets pressed flat, like a thumb smoothing it on the shelf */
/* On a card the tag sits on the frame's corner */
.card > .tag--deal {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
}

/* Mini Max: the same yellow, flat, and it explains itself on hover */
.tag--mini {
  justify-self: start;
  background: var(--color-brand-yellow);
  color: var(--color-ink);
  cursor: help;
}

.card:is(:hover, :focus-within) .tag--deal {
  rotate: 0deg;
  scale: 1.08;
}

/* "חדש" is a small dark label at the foot of the frame, so it never fights the yellow deal tag */
.sticker {
  display: inline-grid;
  place-items: center;
  font: 600 var(--text-xs) / 1 var(--font-ui);
}

.sticker--new {
  padding: 5px 9px;
  border-radius: var(--radius-full);
  background: var(--color-ink);
  color: var(--color-surface);
}

/* On a card it sits at the foot of the frame */
.card .sticker--new {
  position: absolute;
  top: calc(100cqi - 32px);
  inset-inline-start: 8px;
}

/* M-10: drops into place once, when it first scrolls into view */
.js [data-land]:not(.is-landed) {
  opacity: 0;
}

[data-land].is-landed {
  animation: sticker-land var(--duration-base) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

@keyframes sticker-land {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(1.15);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* M-04: the heart fills with a bounce. The button fills the 44px hole, and the white circle sits inside it */
.heart {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
  isolation: isolate;
}

.heart::before {
  content: "";
  position: absolute;
  inset: 4px;
  z-index: -1;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-line);
  transition: box-shadow var(--duration-fast);
}

.heart:hover::before {
  box-shadow: 0 0 0 1.5px var(--color-ink);
}

.heart svg {
  width: 20px;
  height: 20px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  transition: fill var(--duration-fast);
}

.heart[aria-pressed="true"] {
  color: var(--color-brand-red);
}

.heart[aria-pressed="true"] svg {
  fill: currentColor;
}

.heart.is-popping svg {
  animation: heart-pop var(--duration-peak) var(--ease-spring);
}

/* The product page's heart: the same button, in a bigger punched corner (D-062). The frame sets --punch */
.heart--big {
  width: var(--punch);
  height: var(--punch);
}

.heart--big::before {
  inset: 6px;
}

.heart--big svg {
  width: 24px;
  height: 24px;
}

@keyframes heart-pop {
  0% {
    transform: scale(0.5);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- Coupon banner. The deal and the gift card share one compact shape (G-10, D-027).
   Each carries an object above the text, half on the paper and half over its edge,
   and the object wakes up when you reach for it (D-034, D-038, M-28) ---------- */

.promo {
  --art-w: 140px;
  --art-h: 112px;
  padding-block: calc(var(--art-h) / 2 + var(--space-2)) var(--space-2);
}

.promo:last-child {
  padding-block-end: var(--space-7);
}

/* Phones: the object and the button share the top row, and the text runs full width under them */
.promo__inner {
  --notch: 11px;
  --pad: var(--space-3);
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "art cta"
    "text text";
  column-gap: var(--space-3);
  row-gap: var(--space-2);
  padding: var(--pad) calc(var(--space-3) + var(--notch));
  background: none; /* the paper is ::before, also when the coupon is .on-red */
  color: var(--promo-ink, var(--color-ink));
}

/* The paper is a layer of its own, so the notches cut the paper and not the object */
.promo__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-m);
  background: var(--promo-bg, var(--color-surface));
  mask:
    radial-gradient(circle var(--notch) at 0 50%, transparent 98%, black) left /
      51% 100% no-repeat,
    radial-gradient(circle var(--notch) at 100% 50%, transparent 98%, black)
      right / 51% 100% no-repeat;
}

/* Pulled up by half its height, so the object sits on the top edge of the paper */
.promo__art {
  grid-area: art;
  position: relative;
  justify-self: start;
  width: var(--art-w);
  height: var(--art-h);
  margin-block-start: calc(var(--art-h) / -2 - var(--pad));
}

.promo__text {
  grid-area: text;
}

.promo__cta {
  grid-area: cta;
  align-self: end;
}

.promo__title {
  font: 600 var(--text-m) / 1.25 var(--font-ui);
  text-wrap: balance;
}

.promo__sub {
  margin-top: 2px;
  font-size: var(--text-xs);
  line-height: 1.4;
}

.promo--deal {
  --promo-bg: var(--color-brand-red);
  --promo-ink: var(--color-on-red);
}
.promo--gift {
  --promo-bg: var(--color-red-tint);
}

/* Very narrow phones: one column */
@media (max-width: 359px) {
  .promo__inner {
    grid-template-columns: 1fr;
    grid-template-areas: "art" "text" "cta";
  }

  .promo__cta {
    justify-self: start;
  }
}

@media (min-width: 700px) {
  .promo {
    --art-w: 176px;
    --art-h: 128px;
  }

  .promo__inner {
    --pad: var(--space-4);
    grid-template-areas:
      "art cta"
      "text cta";
    column-gap: var(--space-5);
  }

  .promo__title {
    font-size: var(--text-l);
  }

  .promo__sub {
    font-size: var(--text-s);
  }

  .promo__cta {
    align-self: center;
    padding-inline-start: var(--space-5);
    border-inline-start: 2px dashed
      color-mix(in srgb, currentColor 35%, transparent);
  }
}

/* M-28: the object answers a hover, a focus or a tap anywhere on the coupon */
.promo__art * {
  transition:
    translate var(--duration-base) var(--ease-spring),
    rotate var(--duration-base) var(--ease-spring),
    scale var(--duration-base) var(--ease-spring),
    opacity var(--duration-fast);
}

/* Deal: a hand of three toys, and it fans out */
.fan__card {
  --n: 0;
  --w: 60px;
  position: absolute;
  top: calc(50% - var(--w) * 0.6);
  inset-inline: 0;
  margin-inline: auto;
  display: grid;
  place-items: center;
  width: var(--w);
  aspect-ratio: 5 / 6;
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: var(--shadow-lift);
  transform-origin: 50% 100%;
  translate: calc(var(--n) * 16px) 0;
  rotate: calc(var(--n) * 16deg);
}

.fan__card:nth-child(1) {
  --n: 1;
}
.fan__card:nth-child(2) {
  --n: 0;
  z-index: 1;
}
.fan__card:nth-child(3) {
  --n: -1;
}

.fan__card img {
  width: 90%;
  height: auto;
}

.fan__sticker {
  position: absolute;
  z-index: 2;
  top: 0;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: var(--color-ink);
  font: 600 12px / 1 var(--font-ui);
  white-space: nowrap;
  rotate: -10deg;
}

.fan__sticker svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--color-brand-yellow);
}

.fan__sticker span {
  position: relative;
}

.promo:is(:hover, :focus-within, :active) .fan__card {
  translate: calc(var(--n) * 28px) -6px;
  rotate: calc(var(--n) * 26deg);
}

.promo:is(:hover, :focus-within, :active) .fan__sticker {
  rotate: -20deg;
  scale: 1.08;
}

/* Gift card: a card on its hanging tab, the way it waits by the register, and it swings on its hook (D-045) */
.gift__hang {
  --w: 112px;
  position: absolute;
  inset: 0;
  transform-origin: 50% 10px;
  rotate: -5deg;
}

.gift__tab {
  position: absolute;
  top: 0;
  inset-inline: 0;
  margin-inline: auto;
  width: 46px;
  height: 64px;
  border-radius: var(--radius-s);
  background: var(--color-surface);
  box-shadow: 0 1px 3px var(--color-line);
}

/* The slot it hangs by. It sits above the paper, so the page shows through */
.gift__tab::before {
  content: "";
  position: absolute;
  top: 7px;
  inset-inline: 0;
  margin-inline: auto;
  width: 18px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-bg);
  box-shadow: inset 0 1px 2px var(--color-scrim);
}

.gift__card {
  position: absolute;
  top: 28px;
  inset-inline: 0;
  margin-inline: auto;
  width: var(--w);
  aspect-ratio: 1.586; /* a real card */
  border-radius: 9px;
  background:
    linear-gradient(
      115deg,
      transparent 38%,
      color-mix(in srgb, var(--color-surface) 22%, transparent) 50%,
      transparent 62%
    ),
    var(--color-brand-red);
  color: var(--color-on-red);
  box-shadow: var(--shadow-lift);
}

.gift__face {
  position: absolute;
  top: 8px;
  inset-inline-end: 9px;
  width: 20px;
}

.gift__label,
.gift__line {
  position: absolute;
  inset-inline-start: 10px;
  white-space: nowrap;
}

.gift__label {
  bottom: 22px;
  font: 600 13px / 1 var(--font-ui);
}
.gift__line {
  bottom: 9px;
  font: 500 10px / 1 var(--font-body);
}

.promo:is(:hover, :focus-within, :active) .gift__hang {
  rotate: 4deg;
}

@media (min-width: 700px) {
  .fan__card {
    --w: 70px;
  }
  .fan__sticker {
    width: 56px;
    height: 56px;
    font-size: 13px;
  }
  .gift__hang {
    --w: 132px;
  }
  .gift__card {
    top: 32px;
  }
}

/* ---------- Popovers: menu and "הרשימה שלי" ---------- */

.sheet {
  inset: auto;
  top: 96px;
  inset-inline-end: var(--gutter);
  width: min(380px, 100vw - 2 * var(--gutter));
  max-height: calc(100dvh - 120px);
  margin: 0;
  padding: var(--space-5);
  overflow: auto;
  border: 0;
  border-radius: var(--radius-m);
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-sheet);
}

.sheet::backdrop {
  background: var(--color-scrim);
}

.sheet--menu {
  inset-inline: var(--gutter) auto;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.sheet__title {
  font: 600 var(--text-xl) / 1.2 var(--font-ui);
}

.sheet__nav a {
  display: block;
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--color-line);
  font: 500 var(--text-l) / 1.3 var(--font-ui);
  text-decoration: none;
}

.list-items {
  display: grid;
  gap: var(--space-3);
  margin-block: var(--space-2) var(--space-4);
}

.list-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: var(--space-3);
}

.list-item img {
  width: 52px;
  height: 52px;
  padding: 4px;
  border-radius: 50% 50% var(--radius-s) var(--radius-s);
  background: var(--color-bg);
}

.list-item__name {
  font-size: var(--text-s);
  line-height: 1.3;
}

.list-item__price {
  color: var(--color-brand-red);
  font: 600 var(--text-m) / 1.2 var(--font-ui);
}

.list-empty {
  margin-block: var(--space-2) var(--space-4);
  color: var(--color-muted);
}

.list-total small {
  display: block;
  color: var(--color-muted);
  font: 500 var(--text-xs) / 1.4 var(--font-body);
}

.list-total {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-line);
  font: 600 var(--text-l) / 1.2 var(--font-ui);
}

/* ---------- Toast: the face answers the click (M-04, M-27). It stays until the next action: no timers (DP-11) ---------- */

.toast {
  position: fixed;
  inset-inline: var(--gutter);
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  max-width: 440px;
  margin-inline: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-m);
  background: var(--color-ink);
  color: var(--color-bg);
  font: 500 var(--text-s) / 1.4 var(--font-body);
  opacity: 0;
  translate: 0 calc(100% + var(--space-5));
  visibility: hidden;
  transition:
    translate var(--duration-base) var(--ease-spring),
    opacity var(--duration-fast),
    visibility 0s var(--duration-base);
}

.toast.is-shown {
  opacity: 1;
  translate: 0 0;
  visibility: visible;
  transition-delay: 0s;
}

.toast .face {
  width: 34px;
}

/* ---------- Online pop-up: the original's full-screen banner as one short card (D-043).
   Shared: it closes the home page and every product page, right above the footer (D-061).
   The beige panel and the yellow box over "online" come from the original; the rest is this page's language ---------- */

.online {
  padding-block: var(--space-6) 0;
}

.online__card {
  display: grid;
  grid-template-areas: "frame" "text";
  overflow: hidden;
  border-radius: var(--radius-m);
  background: var(--color-bg-deep);
}

.online__frame {
  position: relative;
  grid-area: frame;
  aspect-ratio: 3 / 1;
  overflow: hidden;
}

/* Out of the flow, so the text sets the card's height and the picture only fills it */
.online__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--duration-slow) var(--ease-out);
}

.online__text {
  grid-area: text;
  padding: var(--space-4) var(--space-4) var(--space-5);
}

/* Ink, not muted: muted on the beige panel is 4.47:1, just under AA (Lighthouse, D-072) */
.online__kicker {
  color: var(--color-ink);
  font: 600 var(--text-xs) / 1 var(--font-ui);
}

/* Red on the beige panel and on the yellow box is 4.0:1, fine at this size (large text, 03-brand.md) */
.online__title {
  margin-top: var(--space-2);
  color: var(--color-brand-red);
  font: 600 var(--text-xl) / 1.2 var(--font-ui);
  text-wrap: balance;
}

.online__title mark {
  padding-inline: 0.15em;
  border-radius: 6px;
  background: var(--color-brand-yellow);
  color: inherit;
  box-decoration-break: clone;
}

.online__sub {
  margin-top: var(--space-2);
  font-size: var(--text-s);
}

.online__text .btn {
  margin-top: var(--space-4);
}

/* On a product page it's the last thing before the footer, so it keeps the same air below as above */
main > .online:last-child {
  padding-bottom: var(--space-7);
}

/* M-29, as in the home corner: the picture moves in slowly when you reach for the card */
.online:is(:hover, :focus-within) .online__frame img {
  scale: var(--zoom-in);
}

@media (min-width: 700px) {
  .online__card {
    grid-template-columns: 1fr 1.3fr;
    grid-template-areas: "text frame";
    align-items: center;
  }

  .online__frame {
    aspect-ratio: auto;
    align-self: stretch;
    min-height: 220px;
  }

  .online__text {
    padding: var(--space-5) var(--space-6);
  }
}

@media (min-width: 900px) {
  .online {
    padding-top: var(--space-7);
  }

  .online__title {
    font-size: var(--text-2xl);
  }
}

/* ---------- Footer: the sign over the door again, at least half a screen tall, with the awning on top (D-044) ---------- */

.site-footer {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 50vh;
  min-height: 50svh;
  margin-top: 16px;
  padding-block: var(--space-7) var(--space-5);
}

.site-footer::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 100%;
  height: 16px;
  background: radial-gradient(
      circle 16px at 50% 100%,
      var(--color-brand-red) 15.5px,
      transparent 16px
    )
    center bottom / 32px 16px repeat-x;
}

.site-footer a {
  color: inherit;
  text-underline-offset: 4px;
}

/* The full logo with its tagline, as wide as the page allows. It winks when you reach for it (M-01) */
.footer__logo {
  position: relative;
  width: min(100%, 900px);
  margin-inline: auto;
  cursor: default;
}

.footer__logo .logo {
  display: block;
  width: 100%;
  height: auto;
}

.footer__logo .concept-tag {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
}

/* The columns reach both edges: the first starts at the right, the last ends at the left, text stays right-aligned */
.footer__cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-5);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 2px dashed color-mix(in srgb, currentColor 35%, transparent);
}

.footer__title {
  margin-bottom: var(--space-2);
  font: 600 var(--text-m) / 1.2 var(--font-ui);
}

.footer__cols ul {
  display: grid;
  gap: var(--space-1);
}

/* M-33: no underline at rest; it draws in from where you start reading */
.footer__cols a {
  position: relative;
  display: inline-block;
  padding-block: var(--space-1);
  font-size: var(--text-s);
  text-decoration: none;
}

.footer__cols a::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: var(--radius-full);
  background: currentColor;
  transition: width var(--duration-base) var(--ease-out);
}

.footer__cols a:is(:hover, :focus-visible)::after {
  width: 100%;
}

.footer__note {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  line-height: 1.6;
  text-align: center;
  text-wrap: balance;
}

@media (min-width: 900px) {
  .footer__cols {
    margin-top: var(--space-8);
  }

  .footer__logo .concept-tag {
    top: var(--space-3);
    font-size: var(--text-s);
    padding: 7px 14px;
  }
}

/* ---------- Reduced motion: state changes stay, movement goes ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }

  .js [data-land]:not(.is-landed) {
    opacity: 1;
  }
}
