/* Phone layouts follow available space and all four system-safe edges. */
:root {
  --safe-top: env(safe-area-inset-top,0px);
  --safe-right: env(safe-area-inset-right,0px);
  --safe-bottom: env(safe-area-inset-bottom,0px);
  --safe-left: env(safe-area-inset-left,0px);
}
.product-name-part { display:inline-block; max-width:100%; overflow-wrap:anywhere; }
.product-info h3,.product-heading h2 { text-wrap:balance; }
.wechat-instructions .wechat-instruction-mobile { display:none; }
.site-header { padding-top:var(--safe-top); }
html:root { scroll-padding-top:calc(96px + var(--safe-top) + var(--preview-notice-height,0px)); }

@media(max-width:760px) {
  html:root { scroll-padding-top:calc(76px + var(--safe-top) + var(--preview-notice-height,0px)); }
  .site-header .header-inner { position:relative; justify-content:center; }
  .site-header .brand { gap:10px; margin:0; }
  .site-header .brand > img:not(.brand-wordmark) { width:34px; height:38px; }
  .site-header .brand > .brand-wordmark { width:146px; height:47px; }
  .site-header .menu-toggle { position:absolute; right:0; margin:0; }
  .section-shell:not(.hero-immersive) {
    width:auto;
    margin-left:max(24px,var(--safe-left));
    margin-right:max(24px,var(--safe-right));
  }
  .product-info { column-gap:6px; }
  .product-info h3 { font-size:clamp(14px,3.7vw,16px); line-height:1.7; letter-spacing:0; }
  .product-info .price { font-size:clamp(15px,3.9vw,18px); line-height:1.6; }
  .site-footer { padding-bottom:max(24px,var(--safe-bottom)); }
}
@media(max-width:360px) {
  .site-header .brand { gap:8px; }
  .site-header .brand > img:not(.brand-wordmark) { width:30px; height:34px; }
  .site-header .brand > .brand-wordmark { width:120px; height:auto; }
}

@media(max-width:760px), (max-width:1024px) and (max-height:500px) and (orientation:landscape) {
  dialog.product-dialog,dialog.contact-dialog {
    --dialog-top:max(12px,var(--safe-top));
    --dialog-right:max(12px,var(--safe-right));
    --dialog-bottom:max(12px,var(--safe-bottom));
    --dialog-left:max(12px,var(--safe-left));
    inset:var(--dialog-top) var(--dialog-right) var(--dialog-bottom) var(--dialog-left);
    margin:auto;
    width:calc(100% - var(--dialog-left) - var(--dialog-right));
    max-width:calc(100% - var(--dialog-left) - var(--dialog-right));
    max-height:calc(100vh - var(--dialog-top) - var(--dialog-bottom));
    max-height:calc(100dvh - var(--dialog-top) - var(--dialog-bottom));
  }
  dialog.product-dialog--refined {
    height:calc(100vh - var(--dialog-top) - var(--dialog-bottom));
    height:calc(100dvh - var(--dialog-top) - var(--dialog-bottom));
  }
  .product-dialog--refined .product-dialog-actions,.contact-dialog .contact-dialog-actions { padding-bottom:14px; }
  .wechat-instructions .wechat-instruction-desktop { display:none; }
  .wechat-instructions .wechat-instruction-mobile { display:grid; }
}
@media(hover:none) and (pointer:coarse) {
  .wechat-instructions .wechat-instruction-desktop { display:none; }
  .wechat-instructions .wechat-instruction-mobile { display:grid; }
}
@media(max-width:1024px) and (max-height:500px) and (orientation:landscape) {
  html:root { scroll-padding-top:calc(64px + var(--safe-top)); }
  .site-header .header-inner { height:64px; }
  .section-shell:not(.hero-immersive) {
    width:auto;
    margin-left:max(24px,var(--safe-left));
    margin-right:max(24px,var(--safe-right));
  }
  .hero.hero-immersive { height:calc(100vh - 64px - var(--safe-top)); height:calc(100svh - 64px - var(--safe-top)); min-height:0; }
  .hero-immersive .hero-copy { left:max(24px,var(--safe-left)); right:max(24px,var(--safe-right)); bottom:max(24px,var(--safe-bottom)); max-width:none; }
  .hero-immersive h1 { font-size:clamp(26px,4.5vw,38px); }
  .hero-immersive .hero-tagline { font-size:12px; margin-top:8px; }
}
