/* Shared Halalcare design tokens and navigation/consultation controls. */
:root {
  --hc-font: Inter, Arial, "Helvetica Neue", system-ui, sans-serif;
  --hc-card-radius: 15px;
  --hc-control-radius: 9px;
  --hc-section-space: clamp(50px, 6.6vw, 88px);
  --hc-touch: 44px;
  --hc-focus: #3c6727;
}
:root:lang(zh-CN) {
  --hc-font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
body { font-family: var(--hc-font); }
.site-header :is(.menu, .nav-trigger, .language-switch a, .links .btn) {
  min-height: var(--hc-touch);
}
.site-header :is(.menu, .language-switch a) { min-width: 40px; }
.site-header :is(a, button):focus-visible,
.hc-floating-score:focus-visible {
  outline: 3px solid var(--hc-focus);
  outline-offset: 2px;
}
.hc-floating-score,
.hc-halal-content .hc-floating-score {
  position: fixed;
  z-index: 18;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: var(--hc-touch);
  padding: 8px 14px;
  border: 1px solid #91a580;
  border-radius: 999px;
  background: #fff;
  color: #173e31;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  box-shadow: 0 4px 14px #173e311a;
}
[data-placement="floating"].float {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: max(16px, env(safe-area-inset-right));
  min-height: var(--hc-touch);
}
[data-placement="floating"].float:focus-visible {
  outline: 3px solid #3c6727;
  outline-offset: 3px;
}
.hc-service-fallback { padding-block: 44px; }
.hc-service-fallback a { text-decoration: underline; }
:is(.hc-fallback-links, .hc-static-actions) { display: flex; flex-wrap: wrap; gap: 9px 18px; }
.hc-static-actions a { text-decoration: underline; }

@media (max-width: 700px) {
  .site-header .nav { gap: 8px; }
  .site-header .header-tools { gap: 4px; }
  .site-header .brand { flex-shrink: 1; }
  .site-header .language-switch a { min-width: 34px; }
  .hc-floating-score,
  .hc-halal-content .hc-floating-score {
    right: auto;
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: calc(50vw - 16px);
    text-align: center;
  }
  [data-placement="floating"].float {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    right: max(12px, env(safe-area-inset-right));
    max-width: calc(50vw - 16px);
    white-space: normal;
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .hc-floating-score, [data-placement="floating"] { display: none !important; }
}
.hc-nojs-menu { margin-block: 12px; }
.hc-nojs-menu summary { cursor: pointer; min-height: 32px; }
.hc-nojs-menu nav { padding-block: 8px; }
.hc-nojs-menu nav a { text-decoration: underline; }
.hc-halal-content .float[data-placement="floating"] {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  right: max(16px, env(safe-area-inset-right));
}
@media (max-width: 700px) {
  .hc-halal-content .float[data-placement="floating"] {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    right: max(12px, env(safe-area-inset-right));
  }
}
@media (max-width: 365px) {
  .hc-floating-score,
  .hc-halal-content .hc-floating-score {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    max-width: calc(100vw - 24px);
  }
  body[data-current-page="haccp"] footer,
  body[data-current-page="iso"] footer,
  .hc-halal-page footer {
    padding-bottom: calc(126px + env(safe-area-inset-bottom, 0px));
  }
}

/* Keep the last footer links above the mobile consultation controls. */
@media (max-width:700px) {
  body > footer { padding-bottom:calc(88px + env(safe-area-inset-bottom,0px)); }
  body:has(.site-header .links.open) :is([data-placement="floating"],.hc-floating-score) { visibility:hidden; pointer-events:none; }
}
