/*
 * Home page banner of the newest manufacturers (src/legacy/render/promo.ts): a compact white card pinned to the
 * bottom of the screen, one slide per brand in its own colour (--hp-c), rotating and closable (home-promo.js). On
 * computers it stays clear of the WhatsApp button in the corner; on phones it floats just above the corner buttons.
 * Logical properties: the page is RTL in Hebrew and LTR in English.
 */
.hp {
  position: fixed;
  inset-inline: 0;
  bottom: 16px;
  z-index: 98; /* under the site's floating buttons (99) */
  width: min(920px, 100% - 180px);
  margin-inline: auto;
  font-family: 'IBM Plex Sans Hebrew', sans-serif;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.hp.hp-hidden { transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.hp.hp-closed { display: none; }
.hp-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 28px rgba(10, 14, 20, 0.18);
  overflow: hidden;
}
.hp-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 120px 1fr;
  border-top: 3px solid var(--hp-c);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}
/* The outgoing slide fades out first, then the new one in (no overlap of the two). */
.hp-slide.hp-on { position: relative; opacity: 1; visibility: visible; transition: opacity 0.35s ease 0.2s; }
.hp-slide__media { grid-row: 1; grid-column: 1; display: grid; place-items: center; padding: 8px; background: color-mix(in srgb, var(--hp-c) 8%, #fff); }
.hp .hp-slide__media img { display: block; max-width: 100%; max-height: 76px; width: auto; height: auto; object-fit: contain; }
.hp-slide__text {
  grid-row: 1;
  grid-column: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'logo badge btn' 'logo line btn';
  align-items: center;
  gap: 0 22px;
  padding-block: 14px 18px;
  padding-inline: 24px 56px; /* room for the close button at the end */
}
.hp-badge { grid-area: badge; align-self: end; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--hp-c); }
.hp .hp-logo { grid-area: logo; display: block; width: auto; max-width: none; height: 46px; margin-inline: -12px -6px; object-fit: contain; }
.hp-line { grid-area: line; align-self: start; margin: 0; font-size: 17px; font-weight: 500; line-height: 1.35; color: #15191d; }
.hp-btn {
  grid-area: btn;
  padding: 10px 20px;
  border-radius: 2px;
  background: var(--hp-c);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.hp-btn:hover, .hp-btn:focus-visible { background: color-mix(in srgb, var(--hp-c) 85%, #000); color: #fff; }
.hp-btn:focus-visible, .hp-dot:focus-visible, .hp-close:focus-visible { outline: 2px solid #15191d; outline-offset: 2px; }
.hp-dots { position: absolute; bottom: 7px; inset-inline-start: 144px; display: flex; gap: 6px; }
.hp-dot { width: 22px; height: 3px; padding: 0; border: 0; background: #d5d8db; cursor: pointer; }
.hp-dot.hp-on { background: #15191d; }
.hp-close {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6c737a;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.hp-close:hover { background: #f1f2f3; color: #15191d; }
.hp-close svg { width: 18px; height: 18px; }

@media (max-width: 767px) {
  .hp { bottom: 84px; width: calc(100% - 24px); }
  .hp-slide { grid-template-columns: 1fr; }
  .hp-slide__media { display: none; }
  .hp-slide__text { grid-column: 1; grid-template-columns: auto 1fr; grid-template-areas: 'logo btn' 'line line'; gap: 4px 12px; padding-block: 10px 18px; padding-inline: 14px 48px; }
  .hp-badge { display: none; }
  .hp .hp-logo { height: 36px; margin-inline-start: -8px; }
  .hp-btn { justify-self: start; padding: 8px 14px; font-size: 13px; }
  .hp-line { font-size: 14px; }
  .hp-dots { inset-inline-start: 14px; bottom: 6px; }
  .hp-close { top: 8px; transform: none; inset-inline-end: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp, .hp-slide, .hp-slide.hp-on { transition: none; }
}
