
/* ==================== 桌面端 MEGA START ======================= */
theme-sticky-header .header-nav__menu-mega {
  display: block;
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  padding-block-start: 0;
  opacity: 0;
  overflow: auto;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  box-shadow: 5px 0 10px rgba(0,0,0,.2);
}

theme-sticky-header .header-nav__menu-mega-panel {
  display: flex;
  gap: 40px;
  padding-block-start: 20px;
  padding-block-end: 40px;
  min-height: 300px;
  max-height: calc(100vh - 20px - var(--header-height));
  overflow: auto;
  background-color: rgb(var(--color-background));
}

theme-sticky-header .header-nav__menu-mega-panel .card-container {
  flex: 1 1;
}
theme-sticky-header .header-nav__menu-mega-panel .mega-product__card-panel + .mega-product__card-panel {
  margin-top: 16px;
}
theme-sticky-header .mega-product__card-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

theme-sticky-header .header-nav__menu-mega-panel .link-container {
  flex-shrink: 0;
  width: var(--width);
  position: sticky;
  top: 0;
}

theme-sticky-header .header-nav__menu-mega-panel .link-list {
  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
}
/* ==================== 桌面端 MEGA END ======================= */


/* ==================== 移动端 MEGA START ======================= */
theme-header-nav-drawer .header-nav__menu-mega {
  padding: 0 20px 0 20px
}
theme-header-nav-drawer .card-container {
  margin-block-start: 16px;
}
theme-header-nav-drawer .mega-product__card-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: hidden;
}
theme-header-nav-drawer details:not([open]) + .mega-product__card-panel {
  max-height: 0;
  margin-block: 0;
  color: rgb(0 0 0 / 0%);
  transition: max-height 360ms ease, margin-block 360ms ease-in, color 200ms ease;
}
theme-header-nav-drawer details[open] + .mega-product__card-panel {
  max-height: 5000px;
  color: rgb(var(--color-text));
  margin-block: 10px;
  transition: max-height 360ms ease-in, margin-block 360ms ease-in, color 200ms ease-in-out 200ms;
}
theme-header-nav-drawer .mega-product__card {
  width: auto;
}
theme-header-nav-drawer .mega-product__card .mega-product__title {
  font-size: 0.85rem;
}
theme-header-nav-drawer .mega-product__card .mega-product__desc {
  font-size: 0.78rem;
}
theme-header-nav-drawer details[open] + .header-nav-drawer__submenu {
  max-height: 5000px;
}
theme-header-nav-drawer .link-item summary {
  padding: 0 !important;
}

@media screen and (max-width: 390px) {
  theme-header-nav-drawer .mega-product__media .save-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }
}
/* ==================== 移动端 MEGA END ======================= */


/* =================== Product Card START =================== */


.mega-product__card {
  display: block;
  width: 220px;
}

.mega-product__media {
  position: relative;
  aspect-ratio: 1/1;
}
.mega-product__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mega-product__media .save-badge {
  position: absolute;
  z-index: 1;
  inset-inline-start: 10px;
  inset-block-start: 10px;
  border-radius: 6px;
  color: #fff;
  background-color: #d63d3d;
  font-weight: bold;
  font-size: 12px;
  padding: 4px 12px;
}

.mega-product__content {
  margin-top: 6px;
}
.mega-product__title {
  font-size: 1rem;
  font-weight: bold;
}
.mega-product__desc {
  font-size: .8rem;
  opacity: .7;
}

.mega-product__text-wrapper {
  display: flex;
  align-items: center;
}
.mega-product__text-wrapper > div:first-child {
  flex: 1 0;
}
.mega-product__text-wrapper > svg {
  width: 12px;
  margin-left: 10px;
}

.mega-product__price .sale-price {
  padding-right: 8px;
  color: #d63d3d;
  font-weight: bold;
  font-size: 14px;
}
.mega-product__price .compare-price {
  text-decoration: line-through;
  font-size: 12px;
  color: #333;
}
/* =================== Product Card END =================== */


/* =================== Link Container START =================== */

.header-nav__menu-mega-panel .link-item {
  padding: 4px 8px;
  border-radius: 4px;
  transition: transform .2s ease;
}
.header-nav__menu-mega-panel .link-item.has-hover {
  transform: scale(1.08);
}
.header-nav__menu-mega-panel .link-item:hover {
  background-color: rgba(23 23 23 / 0.025);
}
.header-nav__menu-mega-panel .link-item .hover-link {
  display: inline-flex;
}
.header-nav__menu-mega-panel .view-more {
  margin-top: 12px;
  padding-top: 12px;
  padding-left: 8px;
  border-top: solid 1px rgba(155 155 155 / 0.2);
}
/* =================== Link Container END =================== */