:root {
  --page-gutter: clamp(18px, 4vw, 48px);
  --section-pad: clamp(72px, 9vw, 112px);
  --radius: 8px;
  --radius-lg: 18px;
  --shadow-card: 0 18px 50px rgba(22, 28, 35, 0.09);
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  line-height: 1.65;
}

body > *,
main,
section,
footer,
nav,
.wrap,
.nav-inner,
.hero-inner,
.promise-inner,
.sales-grid,
.other-services-grid,
.supplier-grid,
.about-grid,
.contact-grid,
.footer-top,
.footer-bottom {
  min-width: 0;
  max-width: 100%;
}

.wrap {
  width: min(100%, 1200px);
  padding-inline: var(--page-gutter);
}

img,
svg,
video,
canvas,
iframe,
table,
pre,
input,
select,
textarea,
button {
  max-width: 100%;
}

p,
a,
label,
.sales-item-title,
.supplier-brand,
.supplier-desc,
.contact-detail-val {
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
.h-display,
.hero-title,
.section-title {
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  white-space: normal;
  writing-mode: horizontal-tb;
}

.btn,
button,
a {
  -webkit-tap-highlight-color: transparent;
}

.sales-item,
.other-item,
.supplier-card,
.contact-form-card {
  border-radius: var(--radius-lg);
}

.btn {
  min-height: 48px;
  justify-content: center;
  border-radius: 999px;
}

#widgetPanel {
  width: min(390px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 120px));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(20, 25, 31, 0.28);
}

#widgetHeader {
  padding: 15px 18px;
  background:
    radial-gradient(circle at 90% 0%, rgba(192, 32, 30, 0.45), transparent 38%),
    #1e2227;
}

#panelAssistant {
  min-height: 0;
}

#chatMessages {
  min-height: 220px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #cbd1d9 transparent;
}

.chat-bubble {
  line-height: 1.55;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(30, 34, 39, 0.06);
}

.chat-bubble--bot {
  border-top-left-radius: 4px;
}

.chat-bubble--user {
  border-top-right-radius: 4px;
}

#chatSuggestions {
  display: flex;
  gap: 8px;
  padding: 10px 14px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
}

#chatSuggestions::-webkit-scrollbar {
  display: none;
}

.chat-suggestion {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #e2e6eb;
  border-radius: 999px;
  background: #fff;
  color: #3d4550;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.chat-suggestion:hover,
.chat-suggestion:focus-visible {
  border-color: #c0201e;
  color: #9a1816;
  outline: none;
}

#chatStatus {
  min-height: 24px;
  padding: 3px 16px;
  background: #fff;
  color: #687380;
  font-size: 0.69rem;
  font-weight: 650;
}

#chatStatus.is-thinking::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #c0201e;
  animation: assistantPulse 1s ease-in-out infinite alternate;
}

#chatInputRow {
  align-items: center;
  gap: 9px;
  border-top: 1px solid #edf0f3;
}

#chatInput {
  min-width: 0;
  border-radius: 999px;
}

#chatSendBtn {
  min-width: 72px;
  border-radius: 999px;
}

#chatSendBtn:disabled,
#chatInput:disabled {
  cursor: wait;
  opacity: 0.62;
}

@keyframes assistantPulse {
  to { opacity: 0.35; transform: scale(0.75); }
}

@media (max-width: 760px) {
  :root {
    --nav-h: 66px;
    --page-gutter: max(18px, env(safe-area-inset-left));
    --section-pad: 72px;
  }

  html,
  body {
    line-height: 1.6;
  }

  .wrap {
    padding-left: max(18px, env(safe-area-inset-left));
    padding-right: max(18px, env(safe-area-inset-right));
  }

  .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    padding-block: clamp(76px, 16vw, 104px) 64px;
  }

  .hero-inner > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .hero-title {
    width: 100%;
    max-width: 100%;
    font-size: clamp(2rem, 9vw, 3.25rem) !important;
    line-height: 1.02;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  .hero-title br {
    display: none;
  }

  .section-header,
  .section-header > *,
  .section-header .h-display {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .section-header .h-display,
  .about-title,
  .contact-info-title {
    font-size: clamp(1.85rem, 8vw, 2.65rem) !important;
    text-wrap: balance;
  }

  .hero-sub,
  .body-lg,
  .body-md {
    font-size: 0.98rem;
    line-height: 1.7;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    min-height: 52px;
    padding-inline: 20px;
  }

  .hero-stats,
  .about-stat-block {
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
  }

  .hero-stat,
  .about-stat {
    min-width: 0;
    padding: 16px 10px;
  }

  .section-header {
    margin-bottom: 38px;
  }

  .h-display {
    line-height: 1.08;
    letter-spacing: -0.025em;
  }

  .sales-item,
  .other-item,
  .supplier-card,
  .contact-form-card {
    box-shadow: 0 12px 34px rgba(22, 28, 35, 0.08);
  }

  .contact-form-card input,
  .contact-form-card select,
  .contact-form-card textarea {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
  }

  .footer-bottom {
    align-items: flex-start;
    gap: 20px;
  }

  #widgetFAB {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  #widgetPanel {
    inset: max(8px, env(safe-area-inset-top)) 0 0;
    width: 100%;
    height: calc(100dvh - max(8px, env(safe-area-inset-top)));
    max-height: none;
    border: 0;
    border-radius: 20px 20px 0 0;
  }

  #chatUI,
  #panelAssistant {
    min-height: 0;
    flex: 1;
  }

  #panelAssistant {
    height: auto;
    max-height: none;
  }

  #chatMessages {
    min-height: 0;
    padding: 18px max(14px, env(safe-area-inset-right)) 12px max(14px, env(safe-area-inset-left));
  }

  .chat-bubble {
    max-width: min(86%, 34rem);
    font-size: 0.91rem;
  }

  #chatSuggestions {
    padding-inline: max(14px, env(safe-area-inset-left));
  }

  #chatInputRow {
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  #chatInput {
    min-height: 48px;
    font-size: 16px;
  }

  #chatSendBtn {
    min-height: 48px;
  }
}

@media (max-width: 390px) {
  :root { --page-gutter: 16px; }

  .hero-title { font-size: clamp(1.85rem, 9vw, 2.35rem) !important; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stat { text-align: left; }
  .about-stat-block { grid-template-columns: 1fr; }
  #widgetTabs button { font-size: 0.67rem; }
  #chatSendBtn { min-width: 62px; padding-inline: 11px; }
}

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