.hmwcm-menu {
  --hmwcm-bg: #fbf8ed;
  --hmwcm-text: #171717;
  --hmwcm-muted: #292929;
  --hmwcm-accent: #e94726;
  --hmwcm-line: #1b1b1b;
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  max-width: none !important;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 54px 0 150px;
  background: var(--hmwcm-bg);
  color: var(--hmwcm-text);
  font-family: inherit;
  overflow: clip;
  clip-path: inset(0);
  -webkit-clip-path: inset(0);
}


.hmwcm-menu *,
.hmwcm-menu *::before,
.hmwcm-menu *::after {
  box-sizing: border-box;
}

.hmwcm-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: clamp(24px, 2vw, 38px);
  padding-right: clamp(180px, 13vw, 248px);
}

.hmwcm-heading-wrap {
  position: relative;
  min-height: 44px;
  margin: 0 0 72px clamp(148px, 11.6vw, 205px);
}

.hmwcm-heading-row {
  position: relative;
  z-index: 40;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 18px;
  width: 100%;
  padding: 10px 0 7px;
  background: var(--hmwcm-bg);
}

.hmwcm-heading-row.is-hmwcm-fixed {
  position: fixed;
  top: var(--hmwcm-heading-top, 58px);
  left: var(--hmwcm-heading-left, 0px);
  width: var(--hmwcm-heading-width, auto);
  z-index: 40;
  margin: 0;
  overflow: visible !important;
}

.hmwcm-heading-row::before {
  content: none;
}

.hmwcm-heading-row.is-hmwcm-fixed::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: calc(-1 * (var(--hmwcm-heading-top, 58px) + 8px));
  right: -2px;
  bottom: -1px;
  left: -2px;
  background: var(--hmwcm-bg);
  pointer-events: none;
}

.hmwcm-heading-row.is-hmwcm-fixed > * {
  position: relative;
  z-index: 1;
}

.hmwcm-heading {
  margin: 0;
  color: var(--hmwcm-text);
  font-size: clamp(20px, 1.42vw, 27px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.hmwcm-heading-line {
  display: block;
  border-bottom: 2px solid var(--hmwcm-line);
  transform: translateY(-2px);
}

.hmwcm-layout {
  display: grid;
  grid-template-columns:
    clamp(160px, 11vw, 190px)
    clamp(360px, 30vw, 540px)
    minmax(430px, 1fr);
  column-gap: clamp(38px, 4.4vw, 82px);
  align-items: start;
}

.hmwcm-nav,
.hmwcm-media {
  align-self: stretch;
  min-width: 0;
}

.hmwcm-nav-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.hmwcm-nav-inner.is-hmwcm-fixed {
  position: fixed;
  top: var(--hmwcm-fixed-top, 172px);
  left: var(--hmwcm-fixed-left, 0px);
  width: var(--hmwcm-fixed-width, auto);
  z-index: 32;
  margin: 0;
  will-change: clip-path;
}

.hmwcm-nav-link {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--hmwcm-text);
  font-size: clamp(16px, 1.3vw, 21px);
  line-height: 1.48;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-decoration: none !important;
  background: none !important;
  border: 0 !important;
  transition: color .16s linear;
}

.hmwcm-nav-link:hover,
.hmwcm-nav-link.is-active {
  color: var(--hmwcm-accent);
}

.hmwcm-media-inner {
  position: relative;
  width: 100%;
  height: clamp(360px, 32vw, 520px);
  display: grid;
  place-items: center;
}

.hmwcm-media-inner.is-hmwcm-fixed {
  position: fixed;
  top: var(--hmwcm-fixed-top, 200px);
  left: var(--hmwcm-fixed-left, 0px);
  width: var(--hmwcm-fixed-width, auto);
  z-index: 24;
  margin: 0;
  will-change: clip-path;
}

.hmwcm-media-image {
  grid-area: 1 / 1;
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 500px);
  max-height: min(100%, 500px);
  object-fit: contain;
  object-position: center center;
  margin: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .35s cubic-bezier(.22,.61,.36,1);
  pointer-events: none;
  will-change: opacity, transform;
}

.hmwcm-media-image.is-active {
  opacity: 1;
  transform: translateY(0);
}

.hmwcm-media-image.is-product-preview {
  z-index: 3;
}

.hmwcm-media-image.is-placeholder {
  opacity: 0 !important;
  visibility: hidden;
}

.hmwcm-content {
  min-width: 0;
  width: 100%;
}

.hmwcm-category {
  scroll-margin-top: 150px;
  padding: 0 0 92px;
}

.hmwcm-category:last-child {
  padding-bottom: 20px;
}

.hmwcm-category-title-wrap {
  margin: 0 0 30px;
}

.hmwcm-category-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin: 0;
  padding: 0 0 7px;
  border-bottom: 2px solid var(--hmwcm-line);
  color: var(--hmwcm-text);
  font-size: clamp(20px, 1.48vw, 27px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}

.hmwcm-category-jp {
  text-transform: none;
  font-weight: 500;
}

.hmwcm-products {
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.hmwcm-product {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 20px;
  align-items: baseline;
  margin: 0;
  cursor: pointer;
  outline: none;
}

/* Số món tự động: chỉ tạo nền tròn đen khi hover, focus hoặc chọn. */
.hmwcm-product .hmwcm-product-name,
.hmwcm-product .hmwcm-product-price {
  transition: color .18s ease;
}

.hmwcm-product-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--hmwcm-text);
  font-size: clamp(15px, 1.08vw, 18px);
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: background-color .22s ease, color .22s ease, transform .22s ease;
  user-select: none;
}

.hmwcm-product:hover .hmwcm-product-number,
.hmwcm-product:focus-within .hmwcm-product-number,
.hmwcm-product.is-selected .hmwcm-product-number {
  color: #fff;
  background: #191919;
}

.hmwcm-product:hover .hmwcm-product-name,
.hmwcm-product:hover .hmwcm-product-price,
.hmwcm-product:focus-within .hmwcm-product-name,
.hmwcm-product:focus-within .hmwcm-product-price,
.hmwcm-product.is-selected .hmwcm-product-name,
.hmwcm-product.is-selected .hmwcm-product-price {
  color: var(--hmwcm-text);
}

.hmwcm-product-main {
  min-width: 0;
}

.hmwcm-product-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
}

.hmwcm-product-name {
  margin: 0;
  color: var(--hmwcm-text);
  font-size: clamp(16px, 1.18vw, 20px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.hmwcm-product-trigger {
  display: inline;
  margin: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: left;
  text-transform: inherit;
  letter-spacing: inherit;
  background: none;
  border: 0;
  box-shadow: none;
  cursor: pointer;
}

.hmwcm-product-trigger:focus,
.hmwcm-product-trigger:focus-visible {
  outline: none;
  box-shadow: none;
}

.hmwcm-product-price {
  color: var(--hmwcm-text);
  font-size: clamp(15px, 1.08vw, 18px);
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hmwcm-product-price del {
  margin-right: 6px;
  opacity: .45;
}

.hmwcm-product-price ins {
  text-decoration: none;
}

.hmwcm-product-description,
.hmwcm-product-secondary {
  margin-top: 3px;
  color: var(--hmwcm-muted);
  font-size: clamp(15px, 1.06vw, 18px);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.hmwcm-product-description p,
.hmwcm-product-secondary p {
  margin: 0;
}

.hmwcm-product-secondary {
  margin-top: 8px;
  font-style: italic;
}

.hmwcm-empty {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 36px;
  background: #fff7d6;
  border: 1px solid #ead991;
}

@media (max-width: 1280px) {
  .hmwcm-shell {
    padding-right: clamp(120px, 9vw, 165px);
  }

  .hmwcm-layout {
    grid-template-columns: 155px minmax(320px, 430px) minmax(390px, 1fr);
    column-gap: 40px;
  }

  .hmwcm-heading-wrap {
    margin-left: 168px;
  }
}

@media (max-width: 1100px) {
  .hmwcm-shell {
    padding-right: 28px;
  }

  .hmwcm-heading-wrap {
    margin: 0 0 42px;
  }

  .hmwcm-heading-row,
  .hmwcm-heading-row.is-hmwcm-fixed {
    position: relative;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
  }

  .hmwcm-heading-row::before {
    display: none;
  }

  .hmwcm-layout {
    grid-template-columns: 145px minmax(280px, 340px) minmax(330px, 1fr);
    column-gap: 28px;
  }

  .hmwcm-media-inner {
    height: 360px;
  }
}

@media (max-width: 849px) {
  .hmwcm-menu {
    --hmwcm-mobile-header-height: 58px;
    --hmwcm-mobile-sticky-top: var(--hmwcm-mobile-header-height);
    --hmwcm-mobile-heading-height: 64px;
    --hmwcm-mobile-nav-height: 50px;
    padding: 68px 0 74px;
  }

  body.admin-bar .hmwcm-menu {
    --hmwcm-mobile-sticky-top:
      calc(var(--hmwcm-mobile-header-height) + 46px);
  }

  .hmwcm-shell {
    padding: 0 18px;
  }

  .hmwcm-heading-wrap {
    position: sticky;
    top: var(--hmwcm-mobile-sticky-top);
    z-index: 24;
    min-height: var(--hmwcm-mobile-heading-height);
    margin: 0 -18px 0;
    padding: 12px 18px 10px;
    background: var(--hmwcm-bg);
    isolation: isolate;
    overflow: visible !important;
  }

  .hmwcm-heading-wrap::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(-1 * var(--hmwcm-mobile-sticky-top));
    height: var(--hmwcm-mobile-sticky-top);
    background: var(--hmwcm-bg);
    pointer-events: none;
    z-index: 0;
  }

  .hmwcm-heading-wrap > * {
    position: relative;
    z-index: 1;
  }

  .hmwcm-heading-row,
  .hmwcm-heading-row.is-hmwcm-fixed {
    position: relative;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
    padding: 0;
    background: transparent;
    clip-path: none !important;
    -webkit-clip-path: none !important;
  }

  .hmwcm-layout {
    display: block;
  }

  .hmwcm-nav {
    position: sticky;
    top: calc(
      var(--hmwcm-mobile-sticky-top) +
      var(--hmwcm-mobile-heading-height)
    );
    z-index: 23;
    margin: 0 -18px 30px;
    background: var(--hmwcm-bg);
    border-top: 1px solid rgba(0,0,0,.08);
    border-bottom: 1px solid rgba(0,0,0,.08);
  }

  .hmwcm-nav-inner,
  .hmwcm-nav-inner.is-hmwcm-fixed {
    position: static;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    min-height: var(--hmwcm-mobile-nav-height);
    clip-path: none !important;
    -webkit-clip-path: none !important;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
    padding: 11px 18px;
    scrollbar-width: none;
  }

  .hmwcm-nav-inner::-webkit-scrollbar {
    display: none;
  }

  .hmwcm-nav-link {
    flex: 0 0 auto;
    font-size: 14px;
    line-height: 1.25;
  }

  .hmwcm-media {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    display: none !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100svh !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
  }

  .hmwcm-media.is-mobile-popup-open {
    display: block !important;
  }

  .hmwcm-media-inner,
  .hmwcm-media-inner.is-hmwcm-fixed {
    position: absolute !important;
    top: var(--hmwcm-popup-top, 50%) !important;
    left: var(--hmwcm-popup-left, 52%) !important;
    width: min(58vw, 220px) !important;
    height: min(58vw, 220px) !important;
    margin: 0 !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    transform: translate(-50%, -50%) !important;
    overflow: visible !important;
    visibility: visible !important;
    pointer-events: none !important;
  }

  .hmwcm-category-image {
    display: none !important;
  }

  .hmwcm-product-image {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    background: var(--hmwcm-bg) !important;
    border: 4px solid var(--hmwcm-bg) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .25) !important;
    opacity: 0 !important;
    transform: scale(.96) !important;
    transition: opacity .18s ease, transform .22s ease !important;
  }

  .hmwcm-product-image.is-active {
    opacity: 1 !important;
    transform: scale(1) !important;
  }

  .hmwcm-category {
    padding-bottom: 66px;
    scroll-margin-top:
      calc(
        var(--hmwcm-mobile-sticky-top) +
        var(--hmwcm-mobile-heading-height) +
        var(--hmwcm-mobile-nav-height) +
        18px
      );
  }

  .hmwcm-category-title-wrap {
    margin-bottom: 24px;
  }

  .hmwcm-category-title {
    font-size: 21px;
  }

  .hmwcm-products {
    gap: 28px;
  }

  .hmwcm-product {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .hmwcm-product-number {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .hmwcm-product-name,
  .hmwcm-product-price {
    font-size: 14px;
  }

  .hmwcm-product-description,
  .hmwcm-product-secondary {
    font-size: 13px;
  }

  .hmwcm-top-mask,
  .hmwcm-top-mask.is-active {
    display: none !important;
    visibility: hidden !important;
  }
}

@media (max-width: 520px) {
  .hmwcm-product-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .hmwcm-product-price {
    justify-self: end;
  }
}


/* 1.6.1: floating UI stays below the next section while the top content mask
   remains independent from the heading clip. */
.hmwcm-heading-row.is-hmwcm-fixed {
  z-index: 21 !important;
  overflow: visible !important;
}

.hmwcm-heading-row.is-hmwcm-fixed .hmwcm-heading-line {
  opacity: 1 !important;
  visibility: visible !important;
}

.hmwcm-nav-inner.is-hmwcm-fixed {
  z-index: 19 !important;
  overflow: hidden !important;
}

.hmwcm-media-inner.is-hmwcm-fixed {
  z-index: 18 !important;
  overflow: hidden !important;
}

.hmwcm-content {
  position: relative;
  z-index: 1;
}


/* 1.6.1: dedicated viewport mask for the content column above the sticky title.
   It is a child of .hmwcm-menu and is clipped to the real menu boundary by JS,
   so product text cannot pass through the title while the next section remains untouched. */
.hmwcm-heading-row.is-hmwcm-fixed::before {
  content: none !important;
}

.hmwcm-top-mask {
  position: fixed;
  display: none;
  margin: 0;
  padding: 0;
  background: var(--hmwcm-bg);
  border: 0;
  pointer-events: none;
  z-index: 20;
  opacity: 1;
  visibility: hidden;
  will-change: top, left, width, height, clip-path;
}

.hmwcm-top-mask.is-active {
  display: block;
  visibility: visible;
}

/* Danh mục cuộn độc lập trên desktop, chừa vùng an toàn cho hai nút Order */
@media (min-width: 850px) {
  .hmwcm-menu .hmwcm-nav-inner {
    max-height: max(180px, calc(100dvh - 172px - 120px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(45, 39, 31, .28) transparent;
    padding: 2px 10px 4px 0;
    scroll-padding-block: 18px;
  }

  .hmwcm-menu .hmwcm-nav-inner::-webkit-scrollbar {
    width: 4px;
  }

  .hmwcm-menu .hmwcm-nav-inner::-webkit-scrollbar-thumb {
    background: rgba(45, 39, 31, .26);
    border-radius: 99px;
  }

  .hmwcm-menu .hmwcm-nav-link {
    max-width: 100%;
    overflow-wrap: normal;
    word-break: normal;
  }
}

/* Khi sticky, vẫn cho cuộn dù phiên bản cũ khóa overflow để cắt vùng cuối menu */
@media (min-width: 1101px) {
  .hmwcm-menu .hmwcm-nav-inner.is-hmwcm-fixed {
    max-height: max(180px, calc(100dvh - var(--hmwcm-fixed-top, 172px) - 120px));
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
}
