﻿/* 20260717 max01: production H5 polish layer */
:root {
  --h5-ink: #17120d;
  --h5-muted: #73685c;
  --h5-soft: #f7f1e8;
  --h5-paper: rgba(255, 252, 247, 0.92);
  --h5-line: rgba(39, 31, 22, 0.1);
  --h5-line-strong: rgba(39, 31, 22, 0.18);
  --h5-accent: #111111;
  --h5-warm: #d9aa62;
  --h5-radius-sm: 12px;
  --h5-radius-md: 18px;
  --h5-radius-lg: 24px;
  --h5-radius-xl: 32px;
  --h5-shadow-soft: 0 10px 30px rgba(55, 42, 28, 0.08);
  --h5-shadow-lift: 0 18px 46px rgba(55, 42, 28, 0.14);
  --h5-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --h5-ease-spring: cubic-bezier(0.18, 0.9, 0.2, 1.08);
}

html.hanari-max-ui {
  background:
    radial-gradient(circle at 18% 0%, rgba(218, 173, 103, 0.2), transparent 34%),
    radial-gradient(circle at 96% 18%, rgba(70, 54, 38, 0.12), transparent 30%),
    #efe8dc !important;
  color-scheme: light;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.hanari-max-ui body.hanari-live-mode {
  background: transparent !important;
  color: var(--h5-ink) !important;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1, "tnum" 0;
}

body.hanari-live-mode .live-shell {
  position: relative !important;
  isolation: isolate !important;
  height: var(--hanari-vh, 100dvh) !important;
  min-height: var(--hanari-vh, 100dvh) !important;
  max-height: var(--hanari-vh, 100dvh) !important;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96) 0%, rgba(245, 238, 227, 0.96) 52%, rgba(242, 234, 222, 0.98) 100%),
    radial-gradient(circle at 12% 12%, rgba(217, 170, 98, 0.18), transparent 28%) !important;
  overflow: hidden !important;
}

body.hanari-live-mode .live-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(28, 22, 16, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 22, 16, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 62%);
}

body.hanari-live-mode .live-shell > * {
  position: relative;
  z-index: 1;
}

body.hanari-live-mode .live-main {
  scroll-behavior: smooth;
  overscroll-behavior: contain !important;
  padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)) !important;
  scrollbar-width: none;
}

body.hanari-live-mode .live-main::-webkit-scrollbar {
  display: none;
}

body.hanari-live-mode .live-topbar {
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  border-bottom: 1px solid rgba(43, 34, 24, 0.08) !important;
  transition: box-shadow 220ms var(--h5-ease-out), background-color 220ms var(--h5-ease-out), border-color 220ms var(--h5-ease-out);
}

html.hanari-scrolled body.hanari-live-mode .live-topbar {
  background-color: rgba(255, 252, 247, 0.9) !important;
  border-bottom-color: rgba(43, 34, 24, 0.14) !important;
  box-shadow: 0 10px 28px rgba(42, 34, 24, 0.08) !important;
}

body.hanari-live-mode .live-tabbar {
  backdrop-filter: blur(24px) saturate(1.25);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  border-top: 1px solid rgba(43, 34, 24, 0.1) !important;
  box-shadow: 0 -16px 34px rgba(48, 38, 27, 0.1) !important;
}

body.hanari-live-mode .live-logo-lockup,
body.hanari-live-mode .section-head,
body.hanari-live-mode .live-tab,
body.hanari-live-mode button,
body.hanari-live-mode a {
  -webkit-touch-callout: none;
}

body.hanari-live-mode :where(button, a, [role="button"], input, select, textarea) {
  font: inherit;
}

body.hanari-live-mode :where(button, a, [role="button"], .live-tab, .card-cart) {
  position: relative;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
}

body.hanari-live-mode :where(button, a, [role="button"], .live-tab, .card-cart):focus-visible {
  outline: 2px solid rgba(17, 17, 17, 0.78) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 6px rgba(217, 170, 98, 0.22) !important;
}

body.hanari-live-mode :where(.section-head h1, .section-head h2, .section-head h3, h1, h2, h3) {
  text-wrap: balance;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

body.hanari-live-mode :where(p, li, small, span) {
  text-wrap: pretty;
}

body.hanari-live-mode .section-head {
  gap: clamp(10px, 2.8vw, 16px) !important;
  margin-bottom: clamp(12px, 3.4vw, 20px) !important;
}

body.hanari-live-mode .section-head :where(button, a) {
  border-radius: 999px !important;
  box-shadow: inset 0 0 0 1px rgba(33, 26, 18, 0.08);
}

body.hanari-live-mode .live-main :where(section, article) {
  scroll-margin-top: 88px;
}

body.hanari-live-mode .live-main :where([class*="card"], [class*="tile"], [class*="panel"]) {
  transform: translateZ(0);
  backface-visibility: hidden;
}

body.hanari-live-mode .live-main :where([class*="product"], [class*="brand"], [class*="ranking"], [class*="recommend"], [class*="discover"]) :where([class*="card"], [class*="tile"], article) {
  border-color: var(--h5-line) !important;
  box-shadow: var(--h5-shadow-soft);
  transition:
    transform 180ms var(--h5-ease-spring),
    box-shadow 180ms var(--h5-ease-out),
    border-color 180ms var(--h5-ease-out),
    background-color 180ms var(--h5-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  body.hanari-live-mode .live-main :where([class*="product"], [class*="brand"], [class*="ranking"], [class*="recommend"], [class*="discover"]) :where([class*="card"], [class*="tile"], article):hover {
    transform: translateY(-3px) translateZ(0);
    border-color: var(--h5-line-strong) !important;
    box-shadow: var(--h5-shadow-lift);
  }
}

body.hanari-live-mode img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none !important;
  image-rendering: auto;
}

body.hanari-live-mode :where([class*="thumb"], [class*="image"], [class*="media"], [class*="photo"]) {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(229, 219, 204, 0.5)),
    #eee5d8;
}

body.hanari-live-mode :where([class*="thumb"], [class*="image"], [class*="media"], [class*="photo"]) img {
  transition: transform 360ms var(--h5-ease-out), filter 360ms var(--h5-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  body.hanari-live-mode :where([class*="thumb"], [class*="image"], [class*="media"], [class*="photo"]):hover img {
    transform: scale(1.035);
  }
}

body.hanari-live-mode .live-tab {
  border-radius: 18px !important;
  transition: transform 160ms var(--h5-ease-spring), color 160ms var(--h5-ease-out), background-color 160ms var(--h5-ease-out), box-shadow 160ms var(--h5-ease-out);
}

body.hanari-live-mode .live-tab:active,
body.hanari-live-mode .card-cart:active,
body.hanari-live-mode button:active,
body.hanari-live-mode a:active {
  transform: scale(0.982);
}

body.hanari-live-mode .live-tab.is-active {
  box-shadow:
    inset 0 0 0 1px rgba(17, 17, 17, 0.08),
    0 8px 20px rgba(31, 24, 16, 0.1) !important;
}

.hanari-ripple {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hanari-ripple::after {
  content: "";
  position: absolute;
  left: var(--tap-x, 50%);
  top: var(--tap-y, 50%);
  width: 10px;
  height: 10px;
  z-index: -1;
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1);
  background: radial-gradient(circle, rgba(17, 17, 17, 0.14) 0%, rgba(17, 17, 17, 0.08) 42%, transparent 70%);
  pointer-events: none;
}

.hanari-ripple.is-pressed::after {
  animation: hanari-ripple 420ms var(--h5-ease-out);
}

@keyframes hanari-ripple {
  0% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(26); }
}

.hanari-reveal {
  opacity: 0.001;
  transform: translateY(12px) translateZ(0);
  transition: opacity 420ms var(--h5-ease-out), transform 420ms var(--h5-ease-out);
}

.hanari-reveal.is-inview,
html:not(.hanari-js-ready) .hanari-reveal {
  opacity: 1;
  transform: translateY(0) translateZ(0);
}

.hanari-loading-image {
  filter: saturate(0.96) contrast(0.98);
}

.hanari-loaded-image {
  filter: none;
}

html.using-keyboard body.hanari-live-mode *:focus {
  scroll-margin: 92px;
}

@media (min-width: 760px) {
  body.hanari-live-mode .live-shell {
    max-width: 480px;
    margin-inline: auto !important;
    border-inline: 1px solid rgba(43, 34, 24, 0.08);
    box-shadow: 0 26px 80px rgba(42, 34, 24, 0.16);
  }
}

@media (max-width: 430px) {
  body.hanari-live-mode .live-main {
    font-size: clamp(14px, 3.62vw, 16px);
  }

  body.hanari-live-mode .section-head :where(h1, h2, h3) {
    font-size: clamp(20px, 5.6vw, 25px);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hanari-live-mode *,
  body.hanari-live-mode *::before,
  body.hanari-live-mode *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .hanari-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* max02: product-grid precision, readability, and touch ergonomics */
.hanari-max-ui {
  --hanari-font-cjk: "HarmonyOS Sans", "MiSans", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", "Pretendard", sans-serif;
  --hanari-card-radius-lg: 24px;
  --hanari-card-radius-md: 18px;
  --hanari-text-tight: -0.045em;
}

.hanari-max-ui body {
  font-family: var(--hanari-font-cjk);
  -webkit-tap-highlight-color: transparent;
}

.hanari-max-ui .live-shell {
  contain: layout paint style;
  background:
    radial-gradient(circle at 12% -6%, rgba(255, 255, 255, 0.88), transparent 32%),
    linear-gradient(180deg, rgba(255, 252, 246, 0.96) 0%, rgba(238, 229, 216, 0.96) 100%);
}

.hanari-max-ui .live-topbar {
  min-height: calc(64px + env(safe-area-inset-top));
  padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid rgba(18, 18, 18, 0.08);
}

.hanari-max-ui .live-logo-lockup {
  min-width: 0;
  gap: 10px;
}

.hanari-max-ui .live-logo {
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(40, 28, 16, 0.12);
}

.hanari-max-ui .live-top-action {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.22);
}

.hanari-max-ui .hcx-product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 3.8vw, 20px);
  align-items: stretch;
}

.hanari-max-ui .hcx-product-card {
  position: relative;
  isolation: isolate;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  border-radius: var(--hanari-card-radius-lg);
  padding: 10px 10px 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at 25% 8%, rgba(255, 255, 255, 0.9), transparent 42%);
  border: 1px solid rgba(28, 24, 18, 0.07);
  box-shadow: 0 14px 34px rgba(43, 35, 24, 0.11);
}

.hanari-max-ui .hcx-product-card.is-compact {
  padding: 10px 10px 42px;
}

.hanari-max-ui .hcx-product-card::after {
  content: "";
  position: absolute;
  inset: auto 12px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12), transparent);
  opacity: 0.5;
}

.hanari-max-ui .product-media {
  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: auto !important;
  aspect-ratio: 1 / 1.06;
  flex: 0 0 auto;
  margin: 0;
  overflow: hidden;
  border-radius: var(--hanari-card-radius-md);
  background:
    linear-gradient(135deg, rgba(245, 239, 229, 0.96), rgba(255, 255, 255, 0.8));
}

.hanari-max-ui .hcx-product-img {
  position: static !important;
  display: block;
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: cover;
  object-position: center;
  transform: translateZ(0);
}

.hanari-max-ui .product-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 104px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 7px;
  padding: 0 2px;
}

.hanari-max-ui .product-copy > :first-child {
  margin: 0;
  color: #111;
  font-size: clamp(13px, 3.55vw, 15px);
  font-weight: 850;
  line-height: 1.23;
  letter-spacing: var(--hanari-text-tight);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.hanari-max-ui .product-copy .small,
.hanari-max-ui .hcx-product-card .small {
  color: rgba(22, 20, 17, 0.58);
  font-size: clamp(11px, 3vw, 12px);
  font-weight: 650;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.hanari-max-ui .price-row {
  margin-top: auto;
  color: #111;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.055em;
}

.hanari-max-ui .card-cart {
  left: 10px;
  bottom: 9px;
  width: 42px;
  height: 42px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #050505;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(30, 24, 17, 0.14);
}

.hanari-max-ui .live-tabbar {
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  min-height: 62px;
  padding: 7px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(25, 22, 18, 0.08);
  box-shadow: 0 20px 48px rgba(35, 27, 18, 0.18);
}

.hanari-max-ui .live-tab {
  min-width: 54px;
  min-height: 48px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.hanari-max-ui .live-tab.is-active,
.hanari-max-ui .live-tab[aria-selected="true"] {
  color: #fff;
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 24px rgba(0, 0, 0, 0.24);
}

.hanari-max-ui .brand-pill {
  scroll-snap-align: start;
  border-radius: 22px;
  border: 1px solid rgba(24, 20, 16, 0.07);
  box-shadow: 0 12px 28px rgba(35, 27, 18, 0.08);
}

.hanari-max-ui .section-head {
  align-items: center;
  gap: 12px;
}

.hanari-max-ui .section-head h2,
.hanari-max-ui .section-head h3 {
  letter-spacing: -0.065em;
}

@media (min-width: 760px) {
  .hanari-max-ui .live-shell {
    width: min(430px, 100vw);
    max-width: 430px;
    min-height: 900px;
    box-shadow: 0 0 0 1px rgba(25, 20, 15, 0.08), 0 28px 90px rgba(30, 24, 18, 0.14);
  }

  .hanari-max-ui .hcx-product-grid {
    gap: 18px;
  }

  .hanari-max-ui .product-copy > :first-child {
    font-size: 14px;
  }
}

@media (max-width: 360px) {
  .hanari-max-ui .hcx-product-grid {
    gap: 12px;
  }

  .hanari-max-ui .hcx-product-card {
    border-radius: 21px;
    padding: 8px 8px 40px;
  }

  .hanari-max-ui .product-copy {
    min-height: 100px;
  }

  .hanari-max-ui .live-tabbar {
    left: 10px;
    right: 10px;
  }

  .hanari-max-ui .live-tab {
    min-width: 50px;
    font-size: 11px;
  }
}

/* max03: remove inherited oversized card ratio and restore dense commerce grid */
.hanari-max-ui .hcx-product-card,
.hanari-max-ui .hcx-product-card.is-compact {
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 9px 9px 40px !important;
  gap: 9px !important;
}

.hanari-max-ui .product-media {
  aspect-ratio: auto !important;
  height: clamp(142px, 39vw, 166px) !important;
  min-height: 0 !important;
  max-height: 166px !important;
  padding: 8px !important;
}

.hanari-max-ui .product-copy {
  display: grid !important;
  grid-template-rows: auto auto auto auto;
  gap: 5px !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 2px !important;
  overflow: hidden !important;
}

.hanari-max-ui .product-copy small {
  margin: 0 !important;
  color: rgba(22, 20, 17, 0.52) !important;
  font-size: 10.5px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  max-height: 25px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hanari-max-ui .product-copy b {
  margin: 0 !important;
  color: #111 !important;
  font-size: clamp(13px, 3.45vw, 14.5px) !important;
  font-weight: 900 !important;
  line-height: 1.18 !important;
  letter-spacing: -0.055em !important;
  min-height: 0 !important;
  max-height: 35px !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hanari-max-ui .product-copy p {
  margin: 0 !important;
  color: rgba(22, 20, 17, 0.58) !important;
  font-size: 11.5px !important;
  font-weight: 680 !important;
  line-height: 1.25 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.hanari-max-ui .product-copy .price-row,
.hanari-max-ui .price-row.small {
  margin: 2px 0 0 !important;
  color: #111 !important;
  font-size: clamp(14px, 3.8vw, 16px) !important;
  font-weight: 920 !important;
  line-height: 1.18 !important;
  min-height: 0 !important;
  max-height: 22px !important;
  overflow: hidden !important;
}

@media (min-width: 760px) {
  .hanari-max-ui .product-media {
    height: 156px !important;
    max-height: 156px !important;
  }

  .hanari-max-ui .product-copy b {
    font-size: 14px !important;
  }
}

@media (max-width: 360px) {
  .hanari-max-ui .product-media {
    height: 132px !important;
    max-height: 132px !important;
  }

  .hanari-max-ui .product-copy small {
    font-size: 10px !important;
    max-height: 24px !important;
  }

  .hanari-max-ui .product-copy b {
    font-size: 12.5px !important;
    max-height: 32px !important;
  }
}
