/**
 * Mega-menu categorii — hover desktop, stil tip marketplace.
 */

.site-nav,
.site-nav .container,
.site-header {
  overflow: visible;
}

.tc-mega {
  position: relative;
  flex-shrink: 0;
  align-self: stretch;
  display: flex;
  align-items: stretch;
  z-index: 40;
}

.tc-mega .nav-shop-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tc-mega.is-open .nav-shop-toggle {
  background: var(--red-dark);
}

.tc-mega.is-open .nav-shop-toggle .chevron {
  transform: rotate(180deg);
}

.tc-mega__panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 700;
  width: min(1080px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 3px solid var(--red);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 22px 56px rgba(16, 41, 50, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.tc-mega.is-open .tc-mega__panel {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.tc-mega__layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 300px;
  max-height: min(72vh, 560px);
}

.tc-mega__rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #fff;
}

.tc-mega__rail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

.tc-mega__rail-scroll::-webkit-scrollbar {
  width: 5px;
}

.tc-mega__rail-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
}

.tc-mega__group-title {
  display: block;
  padding: 14px 16px 6px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.tc-mega__group-title:hover {
  color: var(--red-dark);
}

.tc-mega__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.12s, color 0.12s, padding-left 0.12s;
}

.tc-mega__group-title + .tc-mega__item {
  border-top: none;
}

.tc-mega__item span {
  min-width: 0;
  line-height: 1.35;
}

.tc-mega__item svg {
  width: 13px;
  height: 13px;
  stroke: var(--gray);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  transition: stroke 0.12s, transform 0.12s;
}

.tc-mega__item:hover,
.tc-mega__item.is-active {
  background: #e8f8fa;
  color: var(--red);
  padding-left: 20px;
}

.tc-mega__item:hover svg,
.tc-mega__item.is-active svg {
  stroke: var(--red);
  transform: translateX(2px);
}

.tc-mega__rail-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.15s;
}

.tc-mega__rail-footer:hover {
  background: var(--red-dark);
  color: #fff;
}

.tc-mega__rail-footer svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  stroke-width: 2;
  fill: none;
}

.tc-mega__stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.tc-mega__pane {
  display: none;
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.tc-mega__pane.is-active {
  display: grid !important;
}

.tc-mega__pane.tc-mega__pane--catalog {
  grid-template-columns: minmax(0, 1fr);
}

.tc-mega__pane-main {
  min-width: 0;
  min-height: 0;
  padding: 22px 24px 24px;
  overflow: auto;
  overscroll-behavior: contain;
}

.tc-mega__pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.tc-mega__pane-title {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}

.tc-mega__pane-title:hover {
  color: var(--red);
}

.tc-mega__pane-all {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  border-bottom: 1px solid currentColor;
}

.tc-mega__pane-all:hover {
  opacity: 0.8;
}

.tc-mega__cols {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 28px;
}

.tc-mega__col {
  min-width: 0;
  padding: 4px 0 10px;
}

.tc-mega__col-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  transition: color 0.12s;
}

.tc-mega__col-title:hover {
  color: var(--red);
}

.tc-mega__sublinks {
  list-style: none;
  margin: 8px 0 0;
  padding: 0 0 0 10px;
  border-left: 1px solid #ebebeb;
}

.tc-mega__sublinks a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 400;
  color: #6b7c84;
  line-height: 1.4;
  transition: color 0.12s;
}

.tc-mega__sublinks a:hover {
  color: var(--red);
}

.tc-mega__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 30%, rgba(11, 135, 150, 0.16), transparent 55%),
    linear-gradient(160deg, #eef8fa 0%, #f7fbfc 55%, #e8f3f5 100%);
  border-left: 1px solid rgba(0, 0, 0, 0.05);
}

.tc-mega__visual--empty {
  background:
    radial-gradient(circle at 70% 40%, rgba(11, 135, 150, 0.12), transparent 50%),
    linear-gradient(160deg, #f4fbfc 0%, #f8fafb 100%);
}

.tc-mega__visual img {
  width: min(100%, 220px);
  height: auto;
  max-height: 260px;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(7, 91, 102, 0.18));
  transition: transform 0.25s ease;
}

.tc-mega__pane.is-active .tc-mega__visual img {
  transform: scale(1.02);
}

.offcanvas-cats__child {
  padding-left: 36px !important;
  font-weight: 400 !important;
  color: var(--ink-light) !important;
}

.offcanvas-cats__all {
  font-weight: 700 !important;
  color: var(--red) !important;
  background: #e8f8fa;
}

.md-mobile-category {
  border-bottom: 1px solid var(--border);
}

.offcanvas-nav { flex-shrink: 0; }
.offcanvas-cats { max-height: none; overflow: visible; }

.md-mobile-category summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
}

.md-mobile-category summary::-webkit-details-marker { display: none; }
.md-mobile-category summary svg { width: 16px; height: 16px; flex-shrink: 0; }
.md-mobile-category[open] summary svg { transform: rotate(180deg); }
.offcanvas-cats__grandchild { padding-left: 48px !important; font-size: 12px !important; }

.site-nav .nav-shop-toggle {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding-inline: 16px;
}

.nav-links {
  flex-wrap: wrap;
  flex: 1 1 0;
  min-width: 0;
}

.nav-links a {
  font-size: 13px;
  font-weight: 500;
  padding-inline: 12px;
}

.site-nav .nav-promo { display: none; }

@media (max-width: 1024px) {
  .hamburger { display: flex; }
  .site-nav { display: none; }
  .site-header-inner > .site-search { display: none; }
  .mobile-search-row { display: block; }
  .header-action > span:not(.cart-count):not(.tc-cart-count):not(.tc-favorites-count):not(.favorites-count) { display: none; }
  .header-actions { margin-left: auto; }
  .site-logo { max-width: var(--tc-logo-max-mobile, 178px); }
  .site-logo__image { max-width: var(--tc-logo-max-mobile, 178px); }
}

@media (max-width: 380px) {
  .site-header-inner { gap: 8px; }
  .site-logo, .site-logo__image { max-width: 130px; }
  .header-actions { gap: 4px; }
  .header-action { min-width: 28px; }
}

@media (max-width: 1100px) {
  .tc-mega__panel {
    width: min(920px, calc(100vw - 24px));
  }

  .tc-mega__layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .tc-mega__pane {
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  .tc-mega__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tc-mega__pane {
    grid-template-columns: minmax(0, 1fr);
  }

  .tc-mega__visual {
    display: none;
  }
}
