/* ==========================================================================
   Hiram Medical Supplies — Design System
   Palette sampled from the client's existing logo:
   navy background, metallic silver shield outline, blue/cyan gradient wings.
   Typography: structured serif headings (echoes the logo wordmark),
   clean sans body set large for accessibility (elderly / disabled-adjacent
   end users read this site).
   ========================================================================== */

:root {
  /* Navy family (header/footer/hero/key accents) */
  --navy-950: #060b18;
  --navy-900: #0a1327;
  --navy-800: #101f3d;
  --navy-700: #17294f;

  /* Blue gradient family (from the shield + wings) */
  --blue-700: #123e7d;
  --blue-600: #1a5bab;
  --blue-500: #2e86d6;
  --blue-400: #4fa3e8;
  --blue-300: #7cc4f2;
  --blue-gradient: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 55%, var(--blue-300) 100%);

  /* Metallic silver family (shield outline, wordmark) */
  --silver-100: #f4f6f8;
  --silver-300: #d6dce3;
  --silver-500: #aab4c2;
  --silver-700: #7c8797;
  --silver-gradient: linear-gradient(135deg, #f4f6f8 0%, #c7cfda 50%, #98a4b5 100%);

  /* Content surface */
  --paper: #faf8f3;
  --paper-card: #ffffff;
  --ink: #16202e;
  --ink-soft: #48566a;
  --ink-faint: #7c8797;
  --line: #e3ded1;
  --line-strong: #cfc8b5;

  /* Semantic */
  --success: #2f7a4d;
  --danger: #a8342a;
  --focus: #2e86d6;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 2px 10px rgba(10, 19, 39, 0.06), 0 1px 2px rgba(10, 19, 39, 0.08);
  --shadow-lift: 0 12px 32px rgba(10, 19, 39, 0.14);

  --container: 1180px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  color: var(--navy-900);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
button, input, select, textarea { font-family: inherit; font-size: 1rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.section--navy { background: var(--navy-900); color: var(--silver-100); }
.section--navy h2, .section--navy h3 { color: #fff; }
.section--navy p { color: var(--silver-300); }
.eyebrow {
  display: inline-block;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--blue-600);
  margin-bottom: 10px;
}
.section--navy .eyebrow { color: var(--blue-300); }

.lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 48px;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-gradient); color: #fff; box-shadow: var(--shadow-card); }
.btn-primary:hover { box-shadow: var(--shadow-lift); }
.btn-secondary { background: #fff; color: var(--navy-900); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--blue-500); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { border-color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- Header ---- */
.site-header {
  background: var(--navy-950);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand img { height: 52px; width: auto; }
.brand-word { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em; }
.brand-sub { display: block; font-family: 'Source Sans 3', sans-serif; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-300); font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  color: var(--silver-300); font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  padding: 9px 11px; border-radius: var(--radius-sm); text-decoration: none;
}
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,0.08); }
.nav-auth-area { display: flex; align-items: center; gap: 2px; margin-left: 10px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.14); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,0.3);
  color: #fff; border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer;
}

@media (max-width: 1100px) {
  .main-nav { position: fixed; inset: 68px 0 0 0; background: var(--navy-950); flex-direction: column;
    align-items: stretch; padding: 12px 20px; gap: 2px; display: none; overflow-y: auto; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 16px 10px; font-size: 1.1rem; border-bottom: 1px solid rgba(255,255,255,0.06); border-radius: 0; white-space: normal; }
  .nav-auth-area { flex-direction: column; align-items: stretch; margin-left: 0; padding-left: 0; border-left: none; border-top: 1px solid rgba(255,255,255,0.14); margin-top: 8px; padding-top: 8px; }
  .nav-toggle { display: inline-flex; }
  .header-actions > .btn-primary { display: none; }
}

/* ---- Footer ---- */
.site-footer { background: var(--navy-950); color: var(--silver-300); padding: 56px 0 28px; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: #fff; font-family: 'Source Sans 3', sans-serif; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.site-footer a { color: var(--silver-300); }
.site-footer a:hover { color: #fff; }
.site-footer .brand-word { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 40px; padding-top: 22px; font-size: 0.9rem; color: var(--silver-500); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Trust badges ---- */
.badge-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.badge {
  display: flex; align-items: center; gap: 10px; background: var(--paper-card);
  border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px;
  font-weight: 600; font-size: 0.92rem; color: var(--navy-800); box-shadow: var(--shadow-card);
}
.badge svg { flex-shrink: 0; color: var(--blue-500); }
.section--navy .badge { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.14); color: #fff; }

/* Cards keep their normal light-surface text color even when nested inside
   a navy section — only direct navy-section text should flip to white/silver. */
.section--navy .trust-card h3,
.section--navy .category-card h3,
.section--navy .form-card h3 { color: var(--navy-900); }
.section--navy .trust-card p,
.section--navy .category-card p,
.section--navy .form-card p { color: var(--ink-soft); }

/* ---- Hero ---- */
.hero { background: var(--navy-900); background-image: radial-gradient(circle at 85% 20%, rgba(79,163,232,0.28), transparent 55%); color: #fff; padding: 76px 0 84px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero h1 { color: #fff; }
.hero .lede { color: var(--silver-300); font-size: 1.2rem; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-art { display: flex; justify-content: center; align-items: center; }
.hero-art img { max-width: 320px; filter: drop-shadow(0 24px 40px rgba(0,0,0,0.45)); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { order: -1; } .hero-art img { max-width: 200px; } }

/* ---- Cards / grids ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.category-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 24px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.category-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); text-decoration: none; }
.category-card .icon { width: 52px; height: 52px; border-radius: var(--radius-md); background: var(--blue-gradient); display: flex; align-items: center; justify-content: center; color: #fff; }
.category-card h3 { margin-bottom: 2px; }
.category-card p { color: var(--ink-soft); font-size: 0.98rem; margin: 0; }
.category-card .count { font-size: 0.85rem; color: var(--blue-600); font-weight: 700; }

.trust-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-card); }
.trust-card .icon { color: var(--blue-500); margin-bottom: 14px; }

/* ---- Product cards ---- */
.product-card {
  background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-card);
}
.product-card .thumb {
  aspect-ratio: 4/3; background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: 0.82rem; text-align: center; padding: 10px;
}
.product-card .cat-tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--blue-600); }
.product-card h3 { font-family: 'Source Sans 3', sans-serif; font-size: 1.02rem; font-weight: 700; color: var(--navy-900); margin: 0; line-height: 1.35; }
.product-card .sku { font-size: 0.82rem; color: var(--ink-faint); }
.product-card .pack { font-size: 0.88rem; color: var(--ink-soft); }
.product-card .add-row { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.product-card .add-row input[type=number] { width: 76px; padding: 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.product-card .add-row .btn { padding: 10px 16px; min-height: 44px; }
.product-card.in-cart { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(46,134,214,0.15); }

/* ---- Forms ---- */
.form-card { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-card); }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--navy-900); }
.field .hint { font-size: 0.85rem; color: var(--ink-faint); margin-top: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); min-height: 48px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.form-msg { padding: 14px 16px; border-radius: var(--radius-sm); font-weight: 600; margin-bottom: 20px; display: none; font-size: 1.02rem; }
.form-msg.show { display: block; }
.form-msg.success { background: #e8f4ec; color: var(--success); border: 1px solid #bfe3c9; }
.form-msg.success::before { content: "✓  "; }
.form-msg.error { background: #fbeceb; color: var(--danger); border: 1px solid #f0c6c2; }
.form-msg.error::before { content: "⚠  "; }

/* ---- Utility ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.chip.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.skeleton-note { background: #fff8e6; border: 1px solid #f0dfa8; color: #6b5416; padding: 14px 18px; border-radius: var(--radius-sm); font-size: 0.92rem; }

/* ---- Chat widget ---- */
#hiram-chat-bubble {
  position: fixed; bottom: 22px; right: 22px; z-index: 90;
  width: 62px; height: 62px; border-radius: 50%; background: var(--blue-gradient);
  color: #fff; border: none; box-shadow: var(--shadow-lift); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#hiram-chat-window {
  position: fixed; bottom: 96px; right: 22px; z-index: 90; width: 340px; max-width: calc(100vw - 32px);
  height: 460px; max-height: calc(100vh - 140px); background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift); display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--line);
}
#hiram-chat-window.open { display: flex; }
.chat-head { background: var(--navy-900); color: #fff; padding: 16px 18px; }
.chat-head strong { font-family: 'Playfair Display', serif; font-size: 1.05rem; }
.chat-head p { margin: 2px 0 0; font-size: 0.8rem; color: var(--silver-300); }
.chat-precall { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-precall input { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 80%; padding: 9px 13px; border-radius: 12px; font-size: 0.92rem; line-height: 1.4; }
.chat-msg.visitor { align-self: flex-end; background: var(--blue-gradient); color: #fff; border-bottom-right-radius: 3px; }
.chat-msg.agent { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 3px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-input-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.chat-input-row button { padding: 0 16px; border: none; border-radius: var(--radius-sm); background: var(--navy-900); color: #fff; font-weight: 700; cursor: pointer; }
