/* BULKOMI PHASE 6 / FAZ 1 — AUDIT + DESIGN SYSTEM + FOUNDATION
   Scope: shared tokens, primitives and non-destructive base geometry.
   Do not put page-specific redesigns in this file. */
:root {
  --b6-brand-primary: #FF6B00;
  --b6-white: #FFFFFF;
  --b6-neutral-50: #F8FAFC;
  --b6-neutral-100: #F1F5F9;
  --b6-neutral-200: #E2E8F0;
  --b6-neutral-300: #CBD5E1;
  --b6-neutral-400: #94A3B8;
  --b6-neutral-500: #64748B;
  --b6-neutral-600: #475569;
  --b6-neutral-700: #334155;
  --b6-neutral-800: #1E293B;
  --b6-neutral-900: #0F172A;
  --b6-text-primary: #0F172A;
  --b6-text-secondary: #475569;
  --b6-text-tertiary: #64748B;
  --b6-success: #15803D;
  --b6-warning: #B45309;
  --b6-error: #B91C1C;
  --b6-info: #1D4ED8;
  --b6-space-1: 4px;
  --b6-space-2: 8px;
  --b6-space-3: 12px;
  --b6-space-4: 16px;
  --b6-space-5: 20px;
  --b6-space-6: 24px;
  --b6-space-8: 32px;
  --b6-space-10: 40px;
  --b6-space-12: 48px;
  --b6-space-14: 56px;
  --b6-space-16: 64px;
  --b6-space-20: 80px;
  --b6-space-24: 96px;
  --b6-radius-input: 10px;
  --b6-radius-button: 10px;
  --b6-radius-card: 14px;
  --b6-radius-modal: 16px;
  --b6-radius-surface: 20px;
  --b6-public-max: 1320px;
  --b6-shadow-sm: 0 1px 2px rgba(15,23,42,.05);
  --b6-shadow-md: 0 8px 24px rgba(15,23,42,.08);
  --b6-focus: 0 0 0 3px rgba(255,107,0,.20);
}

:where(body[data-bulkomi-phase6="foundation"]) {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--b6-text-primary);
  background: var(--b6-white);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:where(body[data-bulkomi-phase6="foundation"]) *,
:where(body[data-bulkomi-phase6="foundation"]) *::before,
:where(body[data-bulkomi-phase6="foundation"]) *::after { box-sizing: border-box; }

:where(body[data-bulkomi-phase6="foundation"]) h1,
:where(body[data-bulkomi-phase6="foundation"]) h2,
:where(body[data-bulkomi-phase6="foundation"]) h3 { color: var(--b6-text-primary); letter-spacing: -.02em; }
:where(body[data-bulkomi-phase6="foundation"]) h1 { font-weight: 700; }
:where(body[data-bulkomi-phase6="foundation"]) h2 { font-weight: 700; }
:where(body[data-bulkomi-phase6="foundation"]) h3 { font-weight: 600; }

:where(body[data-bulkomi-phase6="foundation"] .b6-container,
       body[data-bulkomi-phase6="foundation"] .b6-shell__inner) {
  width: min(calc(100% - 64px), var(--b6-public-max));
  margin-inline: auto;
}
.b6-shell { min-height:100%; width:100%; }
.b6-shell__inner { padding-block:32px 64px; }
.b6-shell--auth .b6-shell__inner { width:min(calc(100% - 32px),520px); }
.b6-shell--account .b6-shell__inner { width:min(calc(100% - 64px),1160px); }
.b6-shell--seller .b6-shell__inner, .b6-shell--admin .b6-shell__inner { width:min(calc(100% - 64px),1600px); }
.b6-shell--checkout .b6-shell__inner { width:min(calc(100% - 64px),1180px); }
.b6-form-layout { width:min(100%,900px); }
.b6-list-pattern, .b6-detail-pattern, .b6-form-pattern { display:grid; gap:24px; }
.b6-detail-pattern__content { min-width:0; }
.b6-detail-pattern--rail { grid-template-columns:minmax(0,1fr) minmax(280px,360px); align-items:start; }

/* Typography roles */
.b6-hero-h1 { font-size: 40px; line-height: 1.15; font-weight: 700; }
.b6-page-h1 { font-size: 34px; line-height: 1.2; font-weight: 700; }
.b6-panel-h1 { font-size: 28px; line-height: 1.25; font-weight: 700; }
.b6-h2 { font-size: 26px; line-height: 1.25; font-weight: 700; }
.b6-h3 { font-size: 20px; line-height: 1.35; font-weight: 600; }
.b6-product-h1 { font-size: 30px; line-height: 1.22; font-weight: 700; }
.b6-price-primary { font-size: 32px; line-height: 1.1; font-weight: 700; }
.b6-price-card { font-size: 22px; line-height: 1.2; font-weight: 700; }
.b6-card-title { font-size: 16px; line-height: 1.35; font-weight: 600; }
.b6-body { font-size: 15px; font-weight: 400; color: var(--b6-text-primary); }
.b6-label { font-size: 14px; font-weight: 600; color: var(--b6-text-primary); }
.b6-helper { font-size: 13px; font-weight: 400; color: var(--b6-text-secondary); }
.b6-meta { font-size: 12px; font-weight: 500; color: var(--b6-text-tertiary); }

/* Unified focus */
:where(body[data-bulkomi-phase6="foundation"]) :focus-visible {
  outline: 2px solid var(--b6-brand-primary);
  outline-offset: 2px;
  box-shadow: var(--b6-focus);
}

/* Buttons */
.b6-button,
:where(body[data-bulkomi-phase6="foundation"] .btn[data-b6-button]) {
  min-height: 44px;
  border-radius: var(--b6-radius-button);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font: 600 14px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.b6-button:hover { transform: translateY(-1px); }
.b6-button:active { transform: translateY(0); }
.b6-button--primary { background: var(--b6-brand-primary); color: #fff; border-color: var(--b6-brand-primary); }
.b6-button--secondary { background: #fff; color: var(--b6-text-primary); border-color: var(--b6-neutral-300); }
.b6-button--tertiary { background: transparent; color: var(--b6-text-secondary); border-color: transparent; }
.b6-button--danger { background: var(--b6-error); color: #fff; border-color: var(--b6-error); }
.b6-button--sm { min-height: 36px; padding-inline: 12px; }
.b6-button--commerce { min-height: 48px; }
.b6-button--payment { min-height: 52px; }
.b6-button[disabled], .b6-button[aria-disabled="true"] { opacity: .52; cursor: not-allowed; transform: none; }

.b6-icon-button { width: 44px; height: 44px; border: 1px solid var(--b6-neutral-300); border-radius: 10px; background: #fff; color: var(--b6-text-secondary); display:inline-grid; place-items:center; cursor:pointer; }
.b6-icon { width: 18px; height: 18px; stroke-width: 1.9; flex: 0 0 auto; }

/* Form system */
.b6-field { display:grid; gap:8px; }
.b6-input, .b6-select, .b6-textarea,
:where(body[data-bulkomi-phase6="foundation"] input[data-b6-control],
       body[data-bulkomi-phase6="foundation"] select[data-b6-control],
       body[data-bulkomi-phase6="foundation"] textarea[data-b6-control]) {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--b6-neutral-300);
  border-radius: var(--b6-radius-input);
  background: #fff;
  color: var(--b6-text-primary);
  padding: 10px 12px;
  font: 400 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}
.b6-textarea { min-height: 112px; resize: vertical; }
.b6-input::placeholder, .b6-textarea::placeholder { color: var(--b6-neutral-400); }
.b6-input:disabled, .b6-select:disabled, .b6-textarea:disabled { background: var(--b6-neutral-100); color: var(--b6-neutral-500); cursor:not-allowed; }

/* Cards / surfaces */
.b6-card { background:#fff; border:1px solid var(--b6-neutral-200); border-radius:var(--b6-radius-card); box-shadow:var(--b6-shadow-sm); }
.b6-surface { background:#fff; border:1px solid var(--b6-neutral-200); border-radius:var(--b6-radius-surface); }
.b6-modal { background:#fff; border:1px solid var(--b6-neutral-200); border-radius:var(--b6-radius-modal); box-shadow:var(--b6-shadow-md); }

/* Badges and states */
.b6-badge { display:inline-flex; align-items:center; gap:6px; min-height:24px; padding:3px 8px; border-radius:999px; background:var(--b6-neutral-100); color:var(--b6-text-secondary); font-size:12px; font-weight:600; }
.b6-status--success { background:#F0FDF4; color:#166534; }
.b6-status--warning { background:#FFFBEB; color:#92400E; }
.b6-status--error { background:#FEF2F2; color:#991B1B; }
.b6-status--info { background:#EFF6FF; color:#1E40AF; }
.b6-status--brand { background:#FFF7ED; color:#9A3412; }

.b6-alert { display:grid; grid-template-columns:auto minmax(0,1fr); gap:10px; padding:12px 14px; border:1px solid var(--b6-neutral-200); border-radius:12px; background:var(--b6-neutral-50); }
.b6-alert--success { background:#F0FDF4; border-color:#BBF7D0; }
.b6-alert--warning { background:#FFFBEB; border-color:#FDE68A; }
.b6-alert--error { background:#FEF2F2; border-color:#FECACA; }
.b6-alert--info { background:#EFF6FF; border-color:#BFDBFE; }

/* Page patterns */
.b6-page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; margin-bottom:24px; }
.b6-page-header__copy { min-width:0; }
.b6-page-header__actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.b6-section-header { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:16px; }
.b6-toolbar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:12px; border:1px solid var(--b6-neutral-200); border-radius:12px; background:#fff; }
.b6-filter-chips { display:flex; gap:8px; flex-wrap:wrap; }
.b6-grid-12 { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:24px; }

/* Tables */
.b6-table-wrap { overflow:auto; border:1px solid var(--b6-neutral-200); border-radius:14px; background:#fff; }
.b6-table { width:100%; border-collapse:collapse; min-width:720px; }
.b6-table th { height:44px; padding:0 14px; text-align:left; font-size:12px; font-weight:600; color:var(--b6-text-secondary); background:var(--b6-neutral-50); border-bottom:1px solid var(--b6-neutral-200); }
.b6-table td { min-height:52px; padding:14px; font-size:14px; font-weight:400; color:var(--b6-text-primary); border-bottom:1px solid var(--b6-neutral-100); vertical-align:middle; }
.b6-table tr:last-child td { border-bottom:0; }

/* Empty / error / loading */
.b6-empty, .b6-error-state { text-align:center; padding:48px 24px; border:1px dashed var(--b6-neutral-300); border-radius:14px; background:var(--b6-neutral-50); }
.b6-skeleton { position:relative; overflow:hidden; background:var(--b6-neutral-100); border-radius:8px; color:transparent !important; }
.b6-skeleton::after { content:""; position:absolute; inset:0; transform:translateX(-100%); background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent); animation:b6-shimmer 1.4s infinite; }
@keyframes b6-shimmer { to { transform:translateX(100%); } }

/* Overlay primitives */
.b6-overlay { position:fixed; inset:0; background:rgba(15,23,42,.46); display:grid; place-items:center; z-index:1000; padding:24px; }
.b6-drawer { position:fixed; top:0; right:0; bottom:0; width:min(440px,92vw); background:#fff; border-left:1px solid var(--b6-neutral-200); box-shadow:var(--b6-shadow-md); z-index:1001; }
.b6-toast-region { position:fixed; right:20px; bottom:20px; z-index:1100; display:grid; gap:8px; width:min(380px,calc(100vw - 32px)); }
.b6-toast { padding:12px 14px; border:1px solid var(--b6-neutral-200); border-radius:12px; background:#fff; box-shadow:var(--b6-shadow-md); color:var(--b6-text-primary); }

/* Sticky regression guard: hero and filter controls are never viewport-sticky. */
:where(body[data-bulkomi-phase6="foundation"] .buyer-hero,
       body[data-bulkomi-phase6="foundation"] .hero-section,
       body[data-bulkomi-phase6="foundation"] .home-hero) { position:relative !important; top:auto !important; }
:where(body[data-bulkomi-phase6="foundation"] .filter-toolbar,
       body[data-bulkomi-phase6="foundation"] .filters-toolbar,
       body[data-bulkomi-phase6="foundation"] .filter-bar,
       body[data-bulkomi-phase6="foundation"] #openFilterPanel) { position:static !important; top:auto !important; }

/* Responsive foundation */
@media (max-width: 1024px) {
  :where(body[data-bulkomi-phase6="foundation"] .b6-container, body[data-bulkomi-phase6="foundation"] .b6-shell__inner) { width:min(calc(100% - 48px),var(--b6-public-max)); }
  .b6-grid-12 { gap:20px; }
}
@media (max-width: 768px) {
  :where(body[data-bulkomi-phase6="foundation"] .b6-container, body[data-bulkomi-phase6="foundation"] .b6-shell__inner) { width:calc(100% - 32px); }
  .b6-detail-pattern--rail { grid-template-columns:1fr; }
  .b6-page-header, .b6-section-header { align-items:stretch; flex-direction:column; gap:12px; }
  .b6-page-header__actions { justify-content:flex-start; }
  .b6-hero-h1 { font-size:34px; }
  .b6-page-h1 { font-size:30px; }
  .b6-grid-12 { grid-template-columns:1fr; gap:16px; }
  .b6-overlay { padding:16px; }
}
@media (max-width: 430px) {
  .b6-hero-h1 { font-size:30px; }
  .b6-page-h1 { font-size:28px; }
  .b6-panel-h1 { font-size:26px; }
  .b6-h2 { font-size:24px; }
  .b6-product-h1 { font-size:27px; }
  .b6-price-primary { font-size:30px; }
}
@media (prefers-reduced-motion: reduce) {
  :where(body[data-bulkomi-phase6="foundation"]) *,
  :where(body[data-bulkomi-phase6="foundation"]) *::before,
  :where(body[data-bulkomi-phase6="foundation"]) *::after {
    scroll-behavior:auto !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}