/* SG avalehe bänneriplokk — suur slaider + kampaaniakaardid.
   Muutujad ja tekstiklassid (.sg-eyebrow-card, .sg-h-hero, .sg-lead, .sg-btn …): sg-tokens.css */

.sg-hb,
.sg-hb * {
  box-sizing: border-box;
}
.sg-hb {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: var(--sg-max, 1280px);
  margin: 0 auto;
  padding: 28px 32px 0;
  font-family: var(--sg-font);
  color: var(--sg-text);
}
.sg-hb a {
  text-decoration: none;
}
.sg-hb :focus-visible {
  outline: 2px solid var(--sg-accent-text);
  outline-offset: 2px;
}
.sg-hb button {
  margin: 0;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
}

/* ================================================================ Suur bänner */

.sg-hb__hero {
  position: relative;
  background: #fff;
  border: 1px solid var(--sg-line);
  border-radius: 24px;
  overflow: hidden;
}
.sg-hb__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.sg-hb__track::-webkit-scrollbar {
  display: none;
}
.sg-hb__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}
.sg-hb__media {
  aspect-ratio: 1920 / 667;
  background: var(--sg-surface);
}
.sg-hb__media picture {
  display: block;
  width: 100%;
  height: 100%;
}
.sg-hb__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Tekstiriba */
.sg-hb__bar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 30px 32px 30px 40px;
}
.sg-hb__hero.is-multi .sg-hb__bar {
  padding-right: 288px; /* ruum juhtnuppudele (eraldusjoon + täpid + nooled) */
}
.sg-hb__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sg-hb__lead {
  max-width: 560px;
  margin-top: 4px;
}
.sg-hb__btns {
  flex: none;
  display: flex;
  gap: 10px;
}

/* Juhtnupud: eraldi kiht, joondatud tekstiriba paremasse serva */
.sg-hb__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}
.sg-hb__spacer {
  flex: none;
  aspect-ratio: 1920 / 667;
}
.sg-hb__area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px;
}
.sg-hb__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 32px;
  border-left: 1px solid var(--sg-line);
  min-height: 44px;
  pointer-events: auto;
}
.sg-hb__dots {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 8px;
}
.sg-hb .sg-hb__dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 3px !important;
  background: var(--sg-dot-inactive);
  transition: width .25s ease, background-color .25s ease;
}
.sg-hb .sg-hb__dot::after { /* 44px puuteala */
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}
.sg-hb__dots .sg-hb__dot + .sg-hb__dot::after {
  width: 13px; /* täppide vahel ei kattu */
}
.sg-hb .sg-hb__dot[aria-current="true"] {
  width: 26px;
  background: var(--sg-text);
}
.sg-hb .sg-hb__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  border: 1px solid var(--sg-line-strong);
  background: #fff;
  color: var(--sg-text);
}
@media (hover: hover) {
  .sg-hb .sg-hb__arrow:hover {
    border-color: var(--sg-text);
  }
}

/* ================================================================ Kampaaniakaardid */

.sg-hb__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.sg-hb__cards--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-hb__cards--1 { grid-template-columns: 1fr; }

.sg-hb__card {
  position: relative;
  display: flex;
  height: 300px;
  border-radius: 24px;
  overflow: hidden;
  color: var(--sg-text);
}
.sg-hb__card:hover {
  color: var(--sg-text);
}

/* Täispilt */
.sg-hb__card--image {
  background: var(--sg-surface);
}
.sg-hb__card--image .sg-hb__card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.sg-hb__tag {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: calc(100% - 36px);
  padding: 12px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .94);
}

/* Värvikaart */
.sg-hb__card--color {
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
}
.sg-hb__card--green { background: var(--sg-promo-green-bg); }
.sg-hb__card--warm  { background: var(--sg-promo-warm-bg); }
.sg-hb__card--grey  { background: var(--sg-promo-grey-bg); }
.sg-hb__card-top,
.sg-hb__card-cta {
  position: relative;
  z-index: 1;
}
.sg-hb__card-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 60%;
}
.sg-hb__card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}
.sg-hb__card-cta .sg-icon {
  transition: transform .2s ease;
}
.sg-hb__card--color .sg-hb__card-img {
  position: absolute;
  right: -40px;
  bottom: 10px;
  width: 330px;
  height: auto;
  mix-blend-mode: multiply;
}
.sg-hb__card--color.has-icon .sg-hb__card-img {
  right: 34px;
  top: 50%;
  bottom: auto;
  width: 140px;
  transform: translateY(-50%);
  mix-blend-mode: normal;
}

@media (hover: hover) {
  .sg-hb__card--image:hover .sg-hb__card-img { transform: scale(1.03); }
  .sg-hb__card--color:hover .sg-hb__card-cta .sg-icon { transform: translateX(4px); }
}

/* ================================================================ Tahvel 768–1099 */

@media (max-width: 1099px) {
  .sg-hb__bar,
  .sg-hb__hero.is-multi .sg-hb__bar {
    flex-wrap: wrap;
    gap: 16px 24px;
    padding: 24px 28px;
  }
  .sg-hb__text {
    flex: 1 0 100%;
  }
  .sg-hb__hero.is-multi .sg-hb__btns {
    min-height: 50px;
  }
  .sg-hb__area {
    align-items: flex-end;
    padding: 0 28px 27px; /* nuppude reaga samal joonel */
  }
  .sg-hb__controls {
    padding-left: 0;
    border-left: 0;
  }
  .sg-hb__card {
    height: 260px;
  }
  /* Kitsamad kaardid: pilt/ikoon väiksemaks, et ei kataks teksti */
  .sg-hb__card--color .sg-hb__card-img {
    right: -24px;
    bottom: 48px; /* lingirea kohal */
    width: 210px;
  }
  .sg-hb__card--color.has-icon .sg-hb__card-img {
    top: auto;
    right: 24px;
    bottom: 22px;
    width: 96px;
    transform: none;
  }
  .sg-hb__card-top {
    max-width: 100%;
  }
}

/* ================================================================ Mobiil < 768 */

@media (max-width: 767px) {
  .sg-hb {
    padding: 20px 16px 0;
    gap: 12px;
  }
  .sg-hb__hero {
    border-radius: 22px;
  }
  .sg-hb__media {
    aspect-ratio: auto;
    height: 190px;
  }
  .sg-hb__media.has-mobile {
    height: auto;
    aspect-ratio: 800 / 560;
  }
  .sg-hb__media--left .sg-hb__img   { object-position: 20% 50%; }
  .sg-hb__media--center .sg-hb__img { object-position: 50% 50%; }
  .sg-hb__media--right .sg-hb__img  { object-position: 80% 50%; }
  .sg-hb__media.has-mobile .sg-hb__img { object-position: 50% 50%; }

  .sg-hb__bar,
  .sg-hb__hero.is-multi .sg-hb__bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 18px 18px 20px;
  }
  .sg-hb__btns {
    margin-top: 8px;
  }
  .sg-hb__btn2,
  .sg-hb__arrow {
    display: none !important;
  }
  /* Täpid primaarse nupu reaga samal joonel paremal */
  .sg-hb__spacer {
    aspect-ratio: auto;
    height: 0;
  }
  .sg-hb__area {
    padding: 0 18px 20px;
  }
  .sg-hb__controls {
    min-height: 46px;
  }
  .sg-hb__dots {
    margin-right: 0;
  }

  .sg-hb__cards,
  .sg-hb__cards--2 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .sg-hb__cards--3 .sg-hb__card:first-child {
    grid-column: 1 / -1;
    height: 220px;
  }
  .sg-hb__cards--1 {
    grid-template-columns: 1fr;
  }
  .sg-hb__card {
    height: 210px;
    border-radius: 18px;
  }
  .sg-hb__tag {
    left: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    padding: 10px 14px;
  }
  .sg-hb__card--color {
    padding: 16px;
  }
  .sg-hb__card-top {
    max-width: 75%;
  }
  .sg-hb__card-cta {
    display: none;
  }
  .sg-hb__card--color .sg-hb__card-img {
    right: -16px;
    bottom: 4px;
    width: 170px;
  }
  .sg-hb__card--color.has-icon .sg-hb__card-img {
    top: auto;
    right: 14px;
    bottom: 14px;
    width: 72px;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-hb__dot,
  .sg-hb__card-img,
  .sg-hb__card-cta .sg-icon {
    transition: none !important;
  }
}
