/* Seller Africa homepage — realistic supermarket hero (scoped to .sa-hr; loaded after home.php's inline styles). */

.sa-home-hero.sa-hr {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: start;
  align-content: start;
  min-height: clamp(470px, 58vh, 620px);
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(48px, 6vw, 72px);
  background: #1a1208;
  text-align: left;
}

.sa-hr__scene {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #1a1208;
  pointer-events: none;
}

/* The photo is wider than the hero; it pans across the extra width and reverses (alternate). Transform-only. */
.sa-hr .sa-hr__pan {
  position: absolute;
  top: 0;
  left: 0;
  width: 130%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 55%;
  max-width: none;
  animation: sa-hr-pan 70s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes sa-hr-pan {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-23.0769%, 0, 0); } /* 30 / 130: exactly the overflow */
}

/* Readability overlay: dark and slightly green-tinted on the text side, lighter on the scene side. */
.sa-hr__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 38, 24, .92) 0%, rgba(0, 45, 29, .78) 42%, rgba(0, 40, 26, .38) 75%, rgba(0, 30, 20, .22) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .35));
}

.sa-hr__content {
  width: min(100%, 700px);
}

.sa-hr .sa-home-hero__eyebrow:empty {
  display: none;
}

.sa-hr h1 {
  margin: 0;
  max-width: 700px;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1.2;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}

.sa-hr h1 span {
  color: #f4b400;
}

.sa-hr p {
  margin: 20px 0 0;
  max-width: 600px;
  font-size: clamp(18px, 2.1vw, 24px);
  color: rgba(255, 255, 255, .94);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
}

/* Compact buttons keep both CTAs above the fixed Trustpilot widget on typical viewports. */
.sa-hr .sa-home-hero__buttons {
  justify-content: flex-start;
  margin-top: 28px;
  gap: 14px;
}

.sa-hr .sa-home-hero__buttons .sa-home-btn {
  min-height: 58px;
  height: auto;
  padding-top: 0;
  padding-bottom: 0;
}

.sa-hr__toggle {
  position: absolute;
  right: max(16px, calc((100vw - var(--page-max, 1280px)) / 2));
  bottom: 16px;
  z-index: 2;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(0, 30, 19, .6);
  color: #fff;
  font: 700 13px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}

.sa-hr__toggle { width: 40px; min-height: 40px; height: 40px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.sa-hr__toggle::before { content: ""; width: 4px; height: 14px; border-left: 4px solid #fff; border-right: 4px solid #fff; box-sizing: content-box; width: 4px; }
.sa-hr__toggle[aria-pressed="true"]::before { width: 0; height: 0; border: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid #fff; box-sizing: border-box; }
.sa-hr__toggle:hover { background: rgba(0, 30, 19, .85); }
.sa-hr__toggle:focus-visible { outline: 3px solid #f4b400; outline-offset: 2px; }
.sa-hr__toggle[hidden] { display: none; }

/* Paused when scrolled away, the tab is hidden, or the visitor pauses it. */
.sa-hr.is-paused .sa-hr__pan { animation-play-state: paused; }

/* Static scene: reduced motion, Save-Data. */
.sa-hr.is-static .sa-hr__pan { animation: none; will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  .sa-hr .sa-hr__pan { animation: none; will-change: auto; }
  .sa-hr__toggle { display: none; }
}

@media (max-width: 1023px) {
  .sa-home-hero.sa-hr { min-height: clamp(440px, 60vh, 560px); }
}

@media (max-width: 640px) {
  .sa-home-hero.sa-hr { min-height: 0; padding-top: 36px; padding-bottom: 64px; text-align: left; }
  /* Narrow screens: show a ~half-width window of the scene and pan across the rest. */
  .sa-hr .sa-hr__pan { width: 220%; animation-duration: 60s; object-position: 50% 50%; }
  @keyframes sa-hr-pan {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-54.5455%, 0, 0); } /* 120 / 220 */
  }
  .sa-hr__shade {
    background: linear-gradient(180deg, rgba(0, 38, 24, .84), rgba(0, 38, 24, .7) 55%, rgba(0, 38, 24, .84));
  }
  .sa-hr__toggle { bottom: 12px; right: 12px; }
  .sa-hr h1 { font-size: clamp(34px, 10.5vw, 46px); line-height: 1.2; overflow-wrap: break-word; }
  .sa-hr p { margin-top: 16px; font-size: clamp(17px, 4.8vw, 20px); }
  .sa-hr .sa-home-hero__buttons { margin-top: 22px; gap: 12px; }
  .sa-hr .sa-home-hero__buttons .sa-home-btn { min-height: 52px; }
}

#sa-home [data-reveal].sa-reveal-pending,
#sa-home .sa-verified-vendor.sa-reveal-pending {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease;
}

#sa-home [data-reveal].sa-reveal-pending.is-visible,
#sa-home [data-reveal].sa-reveal-pending:focus-within,
#sa-home .sa-verified-vendor.sa-reveal-pending.is-visible,
#sa-home .sa-verified-vendor.sa-reveal-pending:focus-within {
  opacity: 1;
  transform: translateY(0);
}

#sa-home .sa-home-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

#sa-home .sa-home-product {
  display: flex;
  min-width: 0;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 8px 26px rgba(32, 35, 38, .08);
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}

#sa-home .sa-home-product.sa-reveal-pending {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease, box-shadow .2s ease, border-color .2s ease;
}

#sa-home .sa-home-product.sa-reveal-pending.is-visible,
#sa-home .sa-home-product.sa-reveal-pending:focus-within {
  opacity: 1;
  transform: translateY(0);
}

#sa-home .sa-home-product__image {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--surface);
}

#sa-home .sa-home-product__image img {
  object-fit: contain;
  object-position: center;
  padding: clamp(14px, 1.5vw, 20px);
  transition: transform .28s ease;
}

#sa-home .sa-home-product__body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding: clamp(14px, 1.4vw, 20px);
}

#sa-home .sa-home-product__body > span:first-child {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .045em;
  line-height: 1.4;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

#sa-home .sa-home-product h3 {
  display: -webkit-box;
  min-height: 5.4em;
  overflow: hidden;
  margin: 0;
  color: var(--ink);
  font-size: clamp(16px, 1.25vw, 18px);
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow-wrap: anywhere;
}

#sa-home .sa-home-product h3 a {
  color: inherit;
  text-decoration: none;
}

#sa-home .sa-home-product h3 a:hover {
  color: var(--green);
}

#sa-home .sa-home-product__stars {
  display: block;
  margin: 8px 0 4px;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.3;
}

#sa-home .sa-home-product__body p {
  display: -webkit-box;
  min-height: 2.8em;
  overflow: hidden;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}

#sa-home .sa-home-product__price {
  display: flex;
  min-height: 34px;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: auto;
  padding-top: 16px;
}

#sa-home .sa-home-product__price strong {
  color: var(--green);
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: 800;
  line-height: 1.2;
}

#sa-home .sa-home-product__price del {
  color: var(--muted);
  font-size: 12px;
}

#sa-home .sa-home-product__actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
}

#sa-home .sa-home-product__actions button {
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  line-height: 1.25;
  touch-action: manipulation;
}

#sa-home .sa-home-product__badge {
  box-shadow: 0 2px 8px rgba(32, 35, 38, .14);
}

#sa-home .sa-home-product a:focus-visible,
#sa-home .sa-home-product__actions button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

#sa-home .sa-home-product__actions button:disabled {
  cursor: not-allowed;
  opacity: .58;
}

@media (hover: hover) and (pointer: fine) {
  #sa-home .sa-home-product:hover {
    transform: translateY(-3px);
    border-color: var(--green-2);
    box-shadow: var(--shadow-md);
  }

  #sa-home .sa-home-product:hover .sa-home-product__image img {
    transform: scale(1.035);
  }
}

@media (max-width: 1100px) {
  #sa-home .sa-home-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  #sa-home .sa-home-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  #sa-home .sa-home-product__body {
    padding: 12px;
  }

  #sa-home .sa-home-product__actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #sa-home .sa-home-product__body {
    padding: 14px;
  }

  #sa-home .sa-home-product__actions button {
    min-height: 46px;
  }
}

@media (max-width: 420px) {
  #sa-home .sa-home-product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #sa-home .sa-home-product__image {
    aspect-ratio: 4 / 3;
  }

  #sa-home .sa-home-product__image img {
    padding: clamp(24px, 7vw, 32px);
  }

  #sa-home .sa-home-product h3 {
    min-height: 7em;
    font-size: 16px;
    line-height: 1.4;
    -webkit-line-clamp: 5;
  }

  #sa-home .sa-home-product__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  #sa-home [data-reveal].sa-reveal-pending,
  #sa-home .sa-verified-vendor.sa-reveal-pending,
  #sa-home .sa-home-product,
  #sa-home .sa-home-product__image img,
  #sa-home .sa-home-product.sa-reveal-pending,
  #sa-home .sa-home-product__actions button {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (prefers-reduced-motion: reduce) and (hover: hover) {
  #sa-home .sa-home-product:hover,
  #sa-home .sa-home-product__actions button:hover {
    transform: none;
  }

  #sa-home .sa-home-product:hover .sa-home-product__image img {
    transform: none;
  }
}
