/* fww-b2b-portal shared styles */
:root {
  --lime: #9BBC0E;
  --ivory: #FFFFFF;
  --marquee: #D9E8FF;
  --blue: #2086BA;
  --ink: #000000;
  --muted: #5a5a5a;
  --line: #e5e5e5;
  --danger: #c0392b;
  --success: #27ae60;
  --warn: #e67e22;
  --bg: #f7f8fa;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
header {
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand .b2b-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--blue);
  margin-left: 8px;
  vertical-align: middle;
  border-left: 3px solid var(--lime);
  padding-left: 8px;
}
nav.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  padding: 0 24px;
}
nav.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
nav.main-nav a:hover { background: var(--bg); color: var(--ink); }
nav.main-nav a.active { color: var(--blue); background: var(--marquee); }
.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cart-badge {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--ivory);
  pointer-events: none;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.header-right a { color: var(--blue); font-weight: 500; }

/* ── Layout ── */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 26px;
  margin: 0 0 4px;
}
.page-subtitle {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 24px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
  min-height: 44px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--lime); color: var(--ink); }
.btn-primary:hover:not(:disabled) { opacity: 0.88; }
.btn-secondary { background: var(--marquee); color: var(--blue); }
.btn-secondary:hover:not(:disabled) { background: #c8ddf5; }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn-outline:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: #fdecea; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #f5c6c3; }
.btn-sm { padding: 6px 14px; font-size: 13px; min-height: 36px; }
.btn-lg { padding: 14px 28px; font-size: 16px; min-height: 52px; }
.btn-full { width: 100%; }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-lime    { background: var(--lime); color: var(--ink); }
.badge-blue    { background: var(--marquee); color: var(--blue); }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-paid    { background: #d4edda; color: #155724; }
.badge-shipped { background: #cce5ff; color: #004085; }
.badge-closed  { background: var(--line); color: var(--muted); }
.badge-instock  { background: #d4edda; color: #155724; }
.badge-outofstock { background: #fdecea; color: var(--danger); }

/* ── Cards ── */
.card {
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg); }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-label .optional { font-weight: 400; color: var(--muted); }
input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--ivory);
  transition: border-color 0.15s;
  appearance: none;
  min-height: 44px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--blue);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
     letter-spacing: 0.5px; color: var(--muted); padding: 8px 12px; border-bottom: 2px solid var(--line); }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Price display ── */
.price-b2b { font-weight: 700; font-size: 18px; color: var(--ink); }
.price-msrp { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.price-discount { font-size: 12px; font-weight: 700; color: var(--lime); }

/* ── Quantity stepper ── */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  height: 44px;
}
.qty-stepper button {
  width: 40px;
  height: 100%;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
}
.qty-stepper button:hover { background: var(--line); }
.qty-stepper input {
  width: 52px;
  height: 100%;
  border: none;
  border-left: 1.5px solid var(--line);
  border-right: 1.5px solid var(--line);
  border-radius: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  min-height: unset;
  padding: 0 4px;
}
.qty-stepper input:focus { outline: none; border-color: var(--blue); }

/* ── Toast ── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--ivory);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  transition: transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Loading ── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 48px; color: var(--muted); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty-state h3 { font-size: 20px; margin: 0 0 8px; color: var(--ink); }
.empty-state p { margin: 0 0 24px; }

/* ── Alert ── */
.alert { padding: 14px 18px; border-radius: var(--radius); font-size: 14px; margin-bottom: 18px; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c3; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-info { background: var(--marquee); color: var(--blue); border: 1px solid #b8d4f0; }

/* ── Responsive ── */
@media (max-width: 640px) {
  header { padding: 0 16px; }
  nav.main-nav { display: none; }
  main { padding: 20px 16px 80px; }
  .page-title { font-size: 22px; }
  /* Mobile: cart shows as icon-only (label lives in the hamburger menu) */
  .nav-cart-label { display: none; }
}

/* ── Hamburger nav (mobile) ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
@media (max-width: 640px) {
  .hamburger { display: flex; }
}
.mobile-nav {
  display: none;
  position: fixed;
  top: 56px;
  left: 0; right: 0;
  background: var(--ivory);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  z-index: 99;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a.active { color: var(--blue); }
