/* SG kategooriamenüü — desktop riba + mega-paneelid (≥1100px), mobiili sahtel (<1100px) */

/* Muutujad (--sg-*) tulevad failist sg-tokens.css (handle `sg-tokens`). */

.sg-nav,
.sg-drawer,
.sg-chips {
  font-family: var(--sg-font);
  color: var(--sg-text);
}
.sg-nav ul,
.sg-drawer ul,
.sg-chips ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sg-nav li,
.sg-drawer li,
.sg-chips li {
  margin: 0;
}
.sg-nav a,
.sg-drawer a,
.sg-chips a {
  text-decoration: none;
  color: inherit;
}
.sg-nav button,
.sg-drawer button,
.sg-nav-toggle {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: inherit;
  min-height: 0;
  line-height: inherit;
  box-shadow: none;
}
.sg-nav :focus-visible,
.sg-drawer :focus-visible,
.sg-chips :focus-visible,
.sg-nav-toggle:focus-visible {
  outline: 2px solid var(--sg-accent-text);
  outline-offset: 2px;
}
.sg-icon {
  flex: none;
  display: block;
}

/* ================================================================ Desktop riba */

.sg-nav {
  position: relative;
  z-index: 40;
  background: #fff;
  border-top: 1px solid var(--sg-line);
  border-bottom: 1px solid var(--sg-line);
}
.sg-nav__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  white-space: nowrap;
}
.sg-nav__group {
  display: flex;
  align-items: center;
  height: 100%;
}
.sg-nav__group--primary {
  gap: 24px;
}
.sg-nav .sg-nav__group--secondary {
  gap: 20px;
  position: relative;
  padding-left: 24px;
}
.sg-nav__group--secondary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 24px;
  margin-top: -12px;
  border-left: 1px solid var(--sg-line-strong);
}
.sg-nav__item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.sg-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}
.sg-nav__group--primary .sg-nav__link {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.sg-nav__group--secondary .sg-nav__link {
  font-size: 14px;
  color: var(--sg-text-secondary);
}
.sg-nav__link .sg-icon {
  transition: transform .15s ease;
}
.sg-nav__link:hover {
  color: var(--sg-accent-text);
}
.sg-nav__item.is-active > .sg-nav__link,
.sg-nav__link[aria-expanded="true"] {
  box-shadow: inset 0 -2px 0 var(--sg-accent);
}
.sg-nav__link[aria-expanded="true"] {
  color: var(--sg-accent-text);
}
.sg-nav__link[aria-expanded="true"] .sg-icon {
  transform: rotate(180deg);
}

.sg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sg-new);
  margin-right: 2px;
  flex: none;
}
.sg-nav__link.is-new {
  gap: 6px;
}
.sg-nav__link.is-sale {
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--sg-sale-bg);
  color: var(--sg-sale-text);
  font-weight: 700;
}
.sg-nav__link.is-sale:hover {
  color: var(--sg-sale-text);
}

/* Kitsamal desktopil vähem vahet (fonti ei vähendata) */
@media (max-width: 1279px) {
  .sg-nav__inner,
  .sg-nav__group--primary {
    gap: 16px;
  }
  .sg-nav .sg-nav__group--secondary {
    gap: 14px;
    padding-left: 16px;
  }
}

/* ================================================================ Mega-paneel */

.sg-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: #fff;
  border-bottom: 1px solid var(--sg-line);
  box-shadow: 0 18px 40px rgba(28, 28, 28, .08);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
  white-space: normal;
}
.sg-mega[hidden] {
  display: none;
}
.sg-mega.is-open {
  opacity: 1;
  transform: none;
}
.sg-mega__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 32px 40px;
  display: grid;
  gap: 40px;
  align-items: start;
}
.sg-mega__heading {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--sg-text-muted);
}
.sg-mega__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 40px;
  font-size: 16px;
}
.sg-mega__row:hover,
.sg-mega__help:hover,
.sg-mega__size:hover .sg-mega__size-name,
.sg-mega__small-title:hover,
.sg-mega__small-list a:hover {
  color: var(--sg-accent-text);
}
.sg-mega__row.is-current {
  background: var(--sg-warm);
  border-radius: 10px;
  padding: 0 12px;
  margin: 0 -12px;
  font-weight: 700;
}
.sg-mega__sub-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sg-accent-text) !important;
}
.sg-mega__sub[hidden] {
  display: none;
}
.sg-mega__count {
  font-size: 13px;
  font-weight: 400;
  color: var(--sg-text-muted);
}
.sg-mega__sizes {
  display: grid;
  grid-template-columns: repeat(var(--sg-cols, 1), minmax(0, 1fr));
  gap: 10px;
}
.sg-mega__sizes.is-compact {
  gap: 8px;
}
.sg-mega__sizes.is-compact .sg-mega__size {
  padding: 10px 14px;
}
.sg-mega__sizes.is-compact .sg-mega__size-name {
  font-size: 15px;
}
.sg-mega__sizes.is-compact .sg-mega__size-count {
  font-size: 12px;
}
.sg-mega__size {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--sg-line);
  border-radius: 12px;
  transition: border-color .15s ease;
}
.sg-mega__size:hover {
  border-color: var(--sg-accent);
}
.sg-mega__size-name {
  font-size: 16px;
  font-weight: 700;
}
.sg-mega__size-count {
  font-size: 13px;
  color: var(--sg-text-muted);
}
.sg-mega__help {
  display: flex;
  align-items: center;
  height: 40px;
  font-size: 16px;
}
.sg-mega__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sg-accent-text) !important;
}
.sg-mega__col > .sg-mega__sizes + .sg-mega__heading,
.sg-mega__col > .sg-mega__list + .sg-mega__heading {
  margin-top: 22px;
}
.sg-mega__col > .sg-mega__sizes + .sg-mega__all {
  margin-top: 18px;
}
.sg-mega__col > .sg-mega__all:first-child {
  margin-top: 0;
}
.sg-mega__banner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 340px;
  padding: 26px;
  border-radius: 20px;
  background: var(--sg-banner-green);
  overflow: hidden;
}
.sg-mega__banner-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--sg-banner-green-text);
}
.sg-mega__banner-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.15;
}
.sg-mega__banner-text {
  font-size: 14px;
  color: var(--sg-text-secondary);
}
.sg-mega__banner-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: auto;
  mix-blend-mode: multiply;
}

/* Väike paneel ("Mängud ja muu") */
.sg-mega--small {
  left: 50%;
  right: auto;
  top: 100%;
  width: 480px;
  margin-left: -240px;
  border: 1px solid var(--sg-line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
}
.sg-nav__group--secondary .sg-nav__item:last-child .sg-mega--small {
  left: auto;
  right: 0;
  margin-left: 0;
}
.sg-mega--small .sg-mega__inner {
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  padding: 24px 28px 28px;
}
.sg-mega__small-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.sg-mega__small-list a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  color: var(--sg-text-secondary);
}

/* ================================================================ Hamburger */

.sg-nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
}
.sg-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.sg-nav-toggle span:last-child {
  width: 14px;
}

/* ================================================================ Sahtel */

.sg-drawer {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.2, .8, .2, 1);
}
.sg-drawer[hidden] {
  display: none;
}
.sg-drawer.is-open {
  transform: none;
}
html.sg-drawer-lock,
html.sg-drawer-lock body {
  overflow: hidden;
}
.sg-drawer__head {
  flex: none;
  height: 60px;
  padding: 0 12px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--sg-line);
}
.sg-drawer__logo img {
  display: block;
  height: 22px;
  width: auto;
}
.sg-drawer .sg-drawer__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50% !important; /* Flatsome: button:not(.icon) { border-radius: 3px !important } */
  background: var(--sg-surface);
}

/* Otsing (WooCommerce'i tooteotsingu vorm) */
.sg-drawer__search {
  padding: 14px 16px 6px;
}
.sg-drawer__search form {
  position: relative;
  display: flex;
  margin: 0;
}
.sg-drawer__search label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.sg-drawer__search input[type="search"] {
  flex: 1;
  height: 46px;
  margin: 0;
  padding: 0 18px 0 46px;
  border: 1px solid var(--sg-line);
  border-radius: 23px;
  background: var(--sg-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%235E6166' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 18px 50%;
  box-shadow: none;
  font-size: 16px;
  color: var(--sg-text);
}
.sg-drawer__search button[type="submit"],
.sg-drawer__search input[type="submit"] {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  padding: 0;
  border: 0;
}

/* Akordion */
.sg-acc {
  padding: 4px 20px 16px !important;
}
.sg-drawer .sg-acc__row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 60px;
  border-bottom: 1px solid var(--sg-line);
  text-align: left;
  font-size: 16px;
  font-weight: 700;
}
.sg-acc__name {
  flex: 1;
}
.sg-acc__thumb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--sg-surface);
  flex: none;
  transition: width .2s ease, height .2s ease;
}
.sg-acc__row .sg-icon {
  transition: transform .2s ease;
}
.sg-acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .2s ease;
}
.sg-acc__body {
  overflow: hidden;
  min-height: 0;
  visibility: hidden; /* suletud ploki lingid ei saa fookust */
  transition: visibility .2s;
}
.sg-acc__item.is-open .sg-acc__body {
  visibility: visible;
}
.sg-acc__item.is-open {
  background: var(--sg-warm);
  border-radius: 18px;
  margin: 8px -8px 4px;
  padding: 0 8px 18px;
}
.sg-drawer .sg-acc__item.is-open .sg-acc__row {
  color: var(--sg-accent-text);
  border-bottom-color: transparent;
}
.sg-acc__item.is-open .sg-acc__row .sg-icon {
  transform: rotate(180deg);
}
.sg-acc__item.is-open .sg-acc__thumb {
  width: 44px;
  height: 44px;
}
.sg-acc__item.is-open .sg-acc__panel {
  grid-template-rows: 1fr;
}
.sg-acc__heading,
.sg-drawer__heading {
  margin: 14px 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--sg-text-muted);
}
.sg-acc__sizes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.sg-acc__sizes a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  background: #fff;
  border: 1px solid var(--sg-line-strong);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
}
.sg-acc__list li + li {
  border-top: 1px solid var(--sg-line);
}
.sg-acc__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  font-size: 16px;
}
.sg-acc__count {
  font-size: 13px;
  color: var(--sg-text-muted);
}
.sg-acc__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  margin-top: 12px;
  border-radius: 24px;
  background: var(--sg-text);
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
}

/* Teised mängud */
.sg-drawer__games {
  padding: 4px 20px 22px;
}
.sg-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--sg-line-strong);
  border-radius: 20px;
  font-size: 14px;
}
.sg-pill.is-sale {
  background: var(--sg-sale-bg);
  border-color: var(--sg-sale-bg);
  color: var(--sg-sale-text) !important;
  font-weight: 700;
}

/* Alumine ala */
.sg-drawer__foot {
  flex: 1 0 auto;
  padding: 20px 20px 24px;
  background: var(--sg-warm);
  border-top: 1px solid var(--sg-line);
}
.sg-drawer__gift {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
}
.sg-drawer__services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  margin-top: 8px !important;
}
.sg-drawer__services a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 15px;
  color: var(--sg-text-secondary);
}

/* ================================================================ Kiirnupud (mobiil, avaleht) */

.sg-chips {
  display: none;
}
.sg-chips ul {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 12px 16px;
  margin: 0;
}
.sg-chips ul::-webkit-scrollbar {
  display: none;
}
.sg-chips li {
  flex: none;
  scroll-snap-align: start;
}
.sg-chip {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--sg-line-strong);
  border-radius: 19px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.sg-chip.is-first {
  background: var(--sg-text);
  border-color: var(--sg-text);
  color: #fff !important;
}
.sg-chip.is-sale {
  background: var(--sg-sale-bg);
  border-color: var(--sg-sale-bg);
  color: var(--sg-sale-text) !important;
}

/* ================================================================ Murdepunkt */

@media (max-width: 1099px) {
  .sg-nav {
    display: none;
  }
  .sg-nav-toggle {
    display: inline-flex;
  }
  .sg-chips {
    display: block;
  }
}
@media (min-width: 1100px) {
  .sg-drawer {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sg-mega,
  .sg-drawer,
  .sg-acc__panel,
  .sg-acc__thumb,
  .sg-nav__link .sg-icon,
  .sg-acc__row .sg-icon {
    transition: none;
  }
}
