.am-navbar .nav-item.has-mega .nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
}

.am-navbar .nav-item.has-mega .nav-link::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5l3 3 3-3' stroke='%23555' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s;
}

.am-navbar .nav-item.has-mega.open .nav-link::after {
  transform: rotate(180deg);
}

/* -- Mega menu backdrop overlay -- */
#am-mega-overlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--mm-top, 72px);
  background: rgba(20, 24, 22, 0.45);
  z-index: 8990;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#am-mega-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* -- Mega menu container -- */
#am-mega-menu,
#am-herbal-mega-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  background: #fff;
  border-top: 2px solid #e8e3d6;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  z-index: 9000;
  display: none;
  animation: mmSlideDown 0.18s ease forwards;
  /* Never taller than 90vh, and never past the bottom of the viewport. */
  max-height: min(90vh, calc(100dvh - var(--mm-top, 72px)));
  overflow: hidden;
}

#am-mega-menu.open,
#am-herbal-mega-menu.open {
  display: flex;
  flex-direction: column;
}

@keyframes mmSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -- Inner wrapper: sidebar | divider | product area -- */
.mm-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  max-height: inherit;
  overflow: hidden;
  padding-left: clamp(16px, 3vw, 40px);
  padding-right: clamp(16px, 3vw, 40px);
  box-sizing: border-box;
}

/* -- Left sidebar: stacked category tabs -- */
.mm-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 20px 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #e8e3d6 transparent;
}

/* Wrapper: overflow visible so indicator can poke out to the right */
.mm-cat-tab-wrap {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

/* Hover indicator - circle dot on the RIGHT, outside the card */
.mm-cat-tab-wrap::after {
  content: "";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #C83A0C;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.18s;
}

.mm-cat-tab-wrap:hover::after {
  opacity: 1;
}

.mm-cat-tab {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 auto;
  border: none;
  text-align: left;
  transition: box-shadow 0.2s;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: auto;
  min-height: 120px;
  box-sizing: border-box;
}

.mm-cat-tab:hover,
.mm-cat-tab.active {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.mm-cat-name-1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #235541;
  line-height: 1.15;
  position: relative;
  z-index: 2;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
  max-width: 62%;
}

.mm-cat-name-2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 500;
  font-size: 1.15rem;
  color: #235541;
  line-height: 1.15;
  position: relative;
  z-index: 2;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
  max-width: 62%;
}

/* Person photo on right of category card — atas tidak cropped, bawah boleh */
.mm-cat-img {
  position: absolute;
  right: 0;
  top: 0;
  bottom: auto;
  height: 115%;
  width: auto;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.45s ease;
  transform-origin: right top;
  z-index: 1;
}

.mm-cat-tab:hover .mm-cat-img {
  transform: scale(1.07);
}

/* -- Vertical divider (hidden) -- */
.mm-sidebar-divider {
  display: none;
}

/* -- Right: product list area -- */
.mm-products-area {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 24px 16px 20px;
  overflow: hidden;
}

.mm-products-scroll {
  flex: 1 1 auto;
  min-height: 0;
  /* Hard cap so overflow-y works even when ancestors only have max-height. */
  max-height: min(90vh, calc(100dvh - var(--mm-top, 72px) - 40px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #c83a0c88 #f3eee6;
  -webkit-overflow-scrolling: touch;
}

.mm-products-scroll::-webkit-scrollbar {
  width: 6px;
}

.mm-products-scroll::-webkit-scrollbar-track {
  background: #f3eee6;
  border-radius: 4px;
}

.mm-products-scroll::-webkit-scrollbar-thumb {
  background: #c83a0c88;
  border-radius: 4px;
}

/* Category heading above product list */
.mm-cat-heading {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #2b2b2b;
  margin: 0 0 12px 0;
  padding: 0 0 10px 0;
  border-bottom: 1px solid #e8e3d6;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

/* 4-column grid — kolom & item boleh mengecil agar tidak terpotong */
.mm-products-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  transition: opacity 0.15s, transform 0.15s;
}

/* Horizontal product item */
.mm-pitem {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px 10px 10px;
  text-decoration: none;
  transition: background 0.18s, box-shadow 0.18s;
  cursor: pointer;
  min-width: 0;
}

.mm-pitem:hover {
  background: #FFF3E8;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.mm-pitem-img-wrap {
  width: 150px;
  height: 150px;
  max-width: 42%;
  flex: 0 1 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.mm-pitem-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mm-pitem-info {
  flex: 1;
  min-width: 0;
}

.mm-pitem-name {
  font-family: "Inter", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2b2b2b;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: break-word;
}

.mm-pitem-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #C83A0C;
  font-weight: 500;
  margin-top: 3px;
}

@media (max-width: 1399.98px) {
  .mm-sidebar {
    width: 260px;
    padding: 16px 14px 16px 12px;
  }

  .mm-pitem {
    gap: 8px;
    padding: 8px 10px 8px 8px;
  }

  .mm-pitem-img-wrap {
    width: 110px;
    height: 110px;
    flex-basis: 110px;
  }

  .mm-pitem-name {
    font-size: 0.8rem;
  }
}

@media (max-width: 1199.98px) {
  .mm-products-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mm-pitem-img-wrap {
    width: 100px;
    height: 100px;
    flex-basis: 100px;
  }
}

@media (max-width: 991.98px) {
  .mm-sidebar {
    width: 220px;
  }

  .mm-products-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mm-pitem-img-wrap {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
  }
}

/* -- "Lihat Semua Produk" outline card in sidebar -- */
.mm-view-all-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--red);
  border-radius: 18px;
  padding: 12px 20px;
  text-decoration: none;
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--red);
  transition: background 0.18s, color 0.18s;
  min-height: 52px;
}

.mm-view-all-card:hover {
  background: var(--red);
  color: #fff;
}

/* -- Herbal 101: three equal columns, 2 cards each -- */
#am-herbal-mega-menu .mm-herbal-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: inherit;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
}

#am-herbal-mega-menu .mm-herbal-page-header {
  position: relative;
  display: block;
  flex-shrink: 0;
  min-height: 112px;
  padding: 100px clamp(20px, 4vw, 48px) 26px;
  overflow: hidden;
  isolation: isolate;
}

#am-herbal-mega-menu .mm-herbal-page-header__btn {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: 8px;
  margin-top: 14px;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  border: none;
  background: #E8C47A;
  color: #235541;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

#am-herbal-mega-menu .mm-herbal-page-header__btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

#am-herbal-mega-menu .mm-herbal-page-header__btn:hover {
  background: #f0d291;
  color: #1a4031;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

#am-herbal-mega-menu .mm-herbal-page-header__btn:hover svg {
  transform: translateX(3px);
}

#am-herbal-mega-menu .mm-herbal-page-header__btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

#am-herbal-mega-menu .mm-herbal-page-header__bg,
#am-herbal-mega-menu .mm-herbal-page-header__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#am-herbal-mega-menu .mm-herbal-page-header__bg {
  z-index: 0;
}

#am-herbal-mega-menu .mm-herbal-page-header__overlay {
  z-index: 1;
}

#am-herbal-mega-menu .mm-herbal-page-header__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  max-width: min(720px, 100%);
}

#am-herbal-mega-menu .mm-herbal-page-header.is-align-center .mm-herbal-page-header__content {
  margin-inline: auto;
  align-items: center;
  text-align: center;
}

#am-herbal-mega-menu .mm-herbal-page-header.is-align-right .mm-herbal-page-header__content {
  margin-left: auto;
  align-items: flex-end;
  text-align: right;
}

#am-herbal-mega-menu .mm-herbal-page-header__label {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

#am-herbal-mega-menu .mm-herbal-page-header__title {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.2;
}

#am-herbal-mega-menu .mm-herbal-page-header__subtitle {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  opacity: 0.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#am-herbal-mega-menu .mm-herbal-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #c83a0c66 #f3eee6;
  padding: 16px clamp(20px, 4vw, 48px) 20px;
}

#am-herbal-mega-menu .mm-herbal-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

#am-herbal-mega-menu .mm-herbal-col + .mm-herbal-col {
  border-left: 1px solid #ebe6dc;
  padding-left: 28px;
}

#am-herbal-mega-menu .mm-herbal-col-head {
  display: block;
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0ebe3;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
}

#am-herbal-mega-menu .mm-herbal-col-title {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #2b2b2b;
  line-height: 1.2;
}

#am-herbal-mega-menu .mm-herbal-col-sub {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #8a857c;
}

#am-herbal-mega-menu .mm-herbal-col-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  align-content: start;
}

#am-herbal-mega-menu .mm-herbal-col-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: center;
  margin-top: auto;
  padding: 9px 16px;
  min-height: 38px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--red, #C83A0C);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--red, #C83A0C);
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  transition: background 0.18s, color 0.18s;
}

#am-herbal-mega-menu .mm-herbal-col-all:hover {
  background: var(--red, #C83A0C);
  color: #fff;
  text-decoration: none;
}

#am-herbal-mega-menu .mm-herbal-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid #ebe6dc;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

#am-herbal-mega-menu .mm-herbal-card:hover {
  border-color: #e0d7c8;
  box-shadow: 0 8px 22px rgba(35, 85, 65, 0.1);
  transform: translateY(-2px);
}

#am-herbal-mega-menu .mm-herbal-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e8e3d6, #f5f1ea);
  overflow: hidden;
}

#am-herbal-mega-menu .mm-herbal-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.28s ease;
}

#am-herbal-mega-menu .mm-herbal-col[data-section="jamurista"] .mm-herbal-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  padding-top: 0;
}

#am-herbal-mega-menu .mm-herbal-card:hover .mm-herbal-card-media img {
  transform: scale(1.04);
}

#am-herbal-mega-menu .mm-herbal-col[data-section="jamurista"] .mm-herbal-card:hover .mm-herbal-card-media img {
  transform: scale(1.04);
}

#am-herbal-mega-menu .mm-herbal-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 11px 12px;
  flex: 1;
}

#am-herbal-mega-menu .mm-herbal-card-title {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #2b2b2b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
}

#am-herbal-mega-menu .mm-herbal-card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  font-size: 1rem;
  font-weight: 700;
  color: #C83A0C;
}

#am-herbal-mega-menu .mm-herbal-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 8px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1rem;
  color: #999;
}

@media (max-width: 991.98px) {
  #am-herbal-mega-menu .mm-herbal-cols {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #am-herbal-mega-menu .mm-herbal-col-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #am-herbal-mega-menu .mm-herbal-col + .mm-herbal-col {
    border-left: none;
    border-top: 1px solid #ebe6dc;
    padding-left: 0;
    padding-top: 16px;
  }
}

/* -- Product card (used on produk.html & homepage) -- */
.product-card-figma {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  height: 320px;
  background: #fdf1ea;
  text-decoration: none;
  display: block;
  transition: transform 0.22s, box-shadow 0.22s;
  border: none;
}

.product-card-figma:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.product-card-figma .pf-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: 28px;
}

.product-card-figma:hover .pf-photo {
  opacity: 1;
}

.product-card-figma .pf-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0.08) 60%, rgba(0,0,0,0.22) 100%);
  z-index: 4;
  opacity: 0;
  transition: opacity 0.35s ease;
  border-radius: 28px;
}

.product-card-figma:hover .pf-overlay {
  opacity: 1;
}

.product-card-figma .pf-img {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  max-width: 223px;
  max-height: 223px;
  object-fit: contain;
  object-position: center;
  z-index: 1;
  transition:
    opacity 0.3s ease,
    transform 0.35s ease,
    left 0.35s ease,
    right 0.35s ease,
    bottom 0.35s ease,
    max-width 0.35s ease,
    max-height 0.35s ease,
    filter 0.3s ease,
    z-index 0s linear 0.01s;
}

.product-card-figma:hover .pf-img {
  opacity: 1;
  left: auto;
  right: 62px;
  bottom: 12px;
  transform: none;
  max-width: 64px;
  max-height: 72px;
  z-index: 6;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.28));
  transition:
    opacity 0.3s ease,
    transform 0.35s ease,
    left 0.35s ease,
    right 0.35s ease,
    bottom 0.35s ease,
    max-width 0.35s ease,
    max-height 0.35s ease,
    filter 0.3s ease,
    z-index 0s;
}

.product-card-figma .pf-title {
  position: absolute;
  top: 18px;
  left: 20px;
  right: 20px;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #235541;
  z-index: 5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.25s;
}

.product-card-figma .pf-title.light {
  color: #fff;
}

.product-card-figma:hover .pf-title {
  color: #fff;
}

.product-card-figma .pf-arrow {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2.5px solid #7e8040;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  z-index: 5;
  transition: background 0.2s, border-color 0.2s;
}

.product-card-figma:hover .pf-arrow {
  background: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.9);
}

.product-card-figma .pf-arrow svg path {
  stroke: #7e8040;
  transition: stroke 0.2s;
}

.product-card-figma:hover .pf-arrow svg path {
  stroke: #235541;
}

.product-card-figma.dark-card .pf-title {
  color: #fff;
}

.product-card-figma.dark-card .pf-arrow {
  border-color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
}

.product-card-figma.dark-card:hover .pf-arrow {
  background: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.9);
}

.product-card-figma.dark-card .pf-arrow svg path {
  stroke: rgba(255,255,255,0.9);
}

.product-card-figma.dark-card:hover .pf-arrow svg path {
  stroke: #235541;
}
