/**
 * GawangPinas Universal Design System — 2026 Enterprise Edition
 * High-Craft, Zero AI Slop, Authentic Philippine B2B Commerce Architecture
 * Shared across: gawangpinas.com, login, shop, seller, supplier, admin
 */

/* ==========================================================================
   1. GLOBAL TOKENS & DESIGN VARIABLES
   ========================================================================== */

:root,
[data-theme="light"] {
  /* ── Typography: Single Unified Sans Hierarchy ── */
  --gp-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --gp-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Font Scale (Fixed rem for apps, clean hierarchy) */
  --gp-font-size-xs: 0.6875rem;
  /* 11px - Micro metadata, tags */
  --gp-font-size-sm: 0.78125rem;
  /* 12.5px - Secondary labels, table cells */
  --gp-font-size-base: 0.875rem;
  /* 14px - App body text, inputs */
  --gp-font-size-md: 0.9375rem;
  /* 15px - Lead body text, navigation */
  --gp-font-size-lg: 1.125rem;
  /* 18px - Section subheadings, card titles */
  --gp-font-size-xl: 1.375rem;
  /* 22px - Page headers, modal titles */
  --gp-font-size-2xl: 1.75rem;
  /* 28px - Module titles, major headers */
  --gp-font-size-3xl: 2.25rem;
  /* 36px - Section display titles */
  --gp-font-size-display: clamp(2rem, 3.5vw, 2.75rem);
  /* 32px-44px Marketing display */

  /* Font Weights */
  --gp-font-regular: 400;
  --gp-font-medium: 500;
  --gp-font-semibold: 600;
  --gp-font-bold: 700;
  --gp-font-extrabold: 800;

  /* Line Heights */
  --gp-line-height-tight: 1.2;
  --gp-line-height-snug: 1.35;
  --gp-line-height-normal: 1.5;
  --gp-line-height-loose: 1.65;

  /* Tabular Numerals (Financials, stock counts, timestamps) */
  --gp-tabular-nums: 'tnum' 1, 'cv05' 1;

  /* ── Strict Anti-Bubble Radius Ladder ── */
  --gp-radius-xs: 4px;
  /* Checkboxes, micro-tags, tooltips */
  --gp-radius-sm: 6px;
  /* Inputs, search controls, table buttons */
  --gp-radius-md: 8px;
  /* Interactive buttons, dropdown menus */
  --gp-radius-lg: 12px;
  /* Cards, dashboard modules, panels */
  --gp-radius-xl: 16px;
  /* Modals, hero display containers */
  --gp-radius-full: 9999px;
  /* Strictly reserved for semantic status pills & avatars */

  /* ── Spacing Scale (Base 4px / Strict Rhythm) ── */
  --gp-space-1: 4px;
  --gp-space-2: 8px;
  --gp-space-3: 12px;
  --gp-space-4: 16px;
  --gp-space-5: 20px;
  --gp-space-6: 24px;
  --gp-space-8: 32px;
  --gp-space-10: 40px;
  --gp-space-12: 48px;
  --gp-space-16: 64px;

  /* ── Brand Color Palette (National Royal Blue & Slate Navy) ── */
  --gp-primary: #2563eb;
  --gp-primary-hover: #1d4ed8;
  --gp-primary-active: #1e3a8a;
  --gp-primary-light: #eff6ff;
  --gp-primary-border: #bfdbfe;
  --gp-primary-glow: rgba(37, 99, 235, 0.16);

  /* Neutrals / Surfaces */
  --gp-navy: #0f172a;
  --gp-slate: #1e293b;
  --gp-background: #f8fafc;
  --gp-surface: #ffffff;
  --gp-surface-2: #f1f5f9;
  --gp-surface-3: #e2e8f0;
  --gp-surface-elevated: #ffffff;

  /* Text Hierarchy (High Contrast, WCAG AAA/AA) */
  --gp-text-main: #0f172a;
  --gp-text-heading: #0f172a;
  --gp-text-secondary: #334155;
  --gp-text-muted: #64748b;
  --gp-text-faint: #94a3b8;
  --gp-text-inverse: #ffffff;

  /* Borders & Dividers */
  --gp-border: #e2e8f0;
  --gp-border-strong: #cbd5e1;
  --gp-border-focus: #2563eb;

  /* ── Semantic Colors (High Distinction) ── */
  --gp-success: #059669;
  --gp-success-bg: #dcfce7;
  --gp-success-text: #15803d;
  --gp-success-border: #bbf7d0;

  --gp-warning: #d97706;
  --gp-warning-bg: #fef3c7;
  --gp-warning-text: #b45309;
  --gp-warning-border: #fde68a;

  --gp-danger: #e11d48;
  --gp-danger-bg: #ffe4e6;
  --gp-danger-text: #be123c;
  --gp-danger-border: #fecdd3;

  --gp-info: #0284c7;
  --gp-info-bg: #e0f2fe;
  --gp-info-text: #0369a1;
  --gp-info-border: #bae6fd;

  /* ── Role Identity Accents (Confined to badges and active sidebars) ── */
  --gp-subsite-marketplace: #0284c7;
  /* Cyan-blue: Buyer Marketplace */
  --gp-subsite-seller: #0f766e;
  /* Deep teal: MSME Seller */
  --gp-subsite-supplier: #854415;
  /* Warm bronze: B2B Supplier & Manufacturer */
  --gp-subsite-admin: #4338ca;
  /* Slate indigo: Administration */

  /* ── Natural Depth & Shadow Scale (Zero Colored Halos) ── */
  --gp-shadow-none: none;
  --gp-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --gp-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
  --gp-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.03);
  --gp-shadow-card-hover: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 10px 20px -3px rgba(15, 23, 42, 0.06);
  --gp-shadow-dropdown: 0 10px 25px -5px rgba(15, 23, 42, 0.10), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --gp-shadow-modal: 0 20px 40px -12px rgba(15, 23, 42, 0.18);
  --gp-shadow-toast: 0 12px 28px -4px rgba(15, 23, 42, 0.16);

  /* ── Z-Index Hierarchy ── */
  --gp-z-dropdown: 100;
  --gp-z-sticky: 500;
  --gp-z-drawer: 800;
  --gp-z-modal-backdrop: 900;
  --gp-z-modal: 1000;
  --gp-z-toast: 1100;
  --gp-z-tooltip: 1200;

  /* ── Motion Budget (Fast & Snappy Exponential Ease-Out) ── */
  --gp-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --gp-transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --gp-transition-smooth: 220ms cubic-bezier(0.19, 1, 0.22, 1);

  /* ── Browser Surface Styling ── */
  --gp-selection-bg: #dbeafe;
  --gp-selection-text: #1e3a8a;
  --gp-caret-color: #2563eb;
  --gp-focus-ring: rgba(37, 99, 235, 0.22);

  /* Sticky header surface: the ONLY translucent, blurred plane in the system */
  --gp-header-bg: rgba(255, 255, 255, 0.85);

  /* Dark footer plane: one consistent footer across every public surface */
  --gp-footer-bg: #0f172a;
  --gp-footer-text: #94a3b8;
  --gp-footer-heading: #ffffff;
  --gp-footer-link: #cbd5e1;
  --gp-footer-link-hover: #ffffff;
  --gp-footer-border: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════════════════════════
   2. DARK THEME TOKENS
   ═══════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --gp-background: #090d16;
  --gp-surface: #0f172a;
  --gp-surface-2: #162036;
  --gp-surface-3: #1e293b;
  --gp-surface-elevated: #162036;

  --gp-text-main: #f8fafc;
  --gp-text-heading: #ffffff;
  --gp-text-secondary: #cbd5e1;
  --gp-text-muted: #94a3b8;
  --gp-text-faint: #64748b;
  --gp-text-inverse: #0f172a;

  --gp-border: #1e293b;
  --gp-border-strong: #334155;
  --gp-border-focus: #3b82f6;

  --gp-primary: #3b82f6;
  --gp-primary-hover: #60a5fa;
  --gp-primary-active: #2563eb;
  --gp-primary-light: rgba(59, 130, 246, 0.16);
  --gp-primary-border: rgba(59, 130, 246, 0.35);
  --gp-primary-glow: rgba(59, 130, 246, 0.25);

  --gp-success-bg: rgba(5, 150, 105, 0.18);
  --gp-success-text: #34d399;
  --gp-success-border: rgba(5, 150, 105, 0.32);

  --gp-warning-bg: rgba(217, 119, 6, 0.18);
  --gp-warning-text: #fbbf24;
  --gp-warning-border: rgba(217, 119, 6, 0.32);

  --gp-danger-bg: rgba(225, 29, 72, 0.18);
  --gp-danger-text: #fb7185;
  --gp-danger-border: rgba(225, 29, 72, 0.32);

  --gp-info-bg: rgba(2, 132, 199, 0.18);
  --gp-info-text: #38bdf8;
  --gp-info-border: rgba(2, 132, 199, 0.32);

  /* ── Role Identity Accents (Lifted for dark-surface legibility) ──
     Light-mode role accents are tuned for white surfaces and go muddy on
     dark navy, so each is lifted one step while keeping its hue identity. */
  --gp-subsite-marketplace: #38bdf8;
  /* Cyan-blue: Buyer Marketplace */
  --gp-subsite-seller: #2dd4bf;
  /* Teal: MSME Seller */
  --gp-subsite-supplier: #deb085;
  /* Warm bronze: B2B Supplier & Manufacturer */
  --gp-subsite-admin: #818cf8;
  /* Indigo: Administration */

  --gp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --gp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --gp-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
  --gp-shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.45);
  --gp-shadow-dropdown: 0 10px 25px -5px rgba(0, 0, 0, 0.55);
  --gp-shadow-modal: 0 24px 48px -12px rgba(0, 0, 0, 0.75);

  --gp-selection-bg: #1e3a8a;
  --gp-selection-text: #dbeafe;
  --gp-caret-color: #60a5fa;
  --gp-focus-ring: rgba(59, 130, 246, 0.3);

  --gp-header-bg: rgba(15, 23, 42, 0.85);

  /* Dark footer plane: one consistent footer across every public surface */
  --gp-footer-bg: #0f172a;
  --gp-footer-text: #94a3b8;
  --gp-footer-heading: #ffffff;
  --gp-footer-link: #cbd5e1;
  --gp-footer-link-hover: #ffffff;
  --gp-footer-border: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   3. BROWSER SURFACE THEME & GLOBAL RESETS
   ========================================================================== */

::selection {
  background: var(--gp-selection-bg);
  color: var(--gp-selection-text);
}

input,
textarea {
  caret-color: var(--gp-caret-color);
}

/* Numbers in tables, prices, and stock cards default to tabular */
.gp-num,
.tabular-nums,
.price-val,
.order-total,
.stock-qty {
  font-feature-settings: var(--gp-tabular-nums);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   4. UNIVERSAL 7-STATE BUTTON SYSTEM (.gp-btn)
   ========================================================================== */

.gp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--gp-space-2);
  height: 38px;
  min-height: 38px;
  padding: 0 var(--gp-space-4);
  font-family: var(--gp-font-family);
  font-size: var(--gp-font-size-base);
  font-weight: var(--gp-font-semibold);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--gp-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  transition: background-color var(--gp-transition-fast),
    border-color var(--gp-transition-fast),
    color var(--gp-transition-fast),
    box-shadow var(--gp-transition-fast),
    transform var(--gp-transition-fast);
  outline: none;
  position: relative;
}

/* Focus Visible Contract: 3px outline with 2px offset */
.gp-btn:focus-visible,
.btn:focus-visible,
.sl-btn:focus-visible,
.spl-btn:focus-visible {
  outline: 3px solid var(--gp-primary);
  outline-offset: 2px;
}

/* Active Press Response: 1px instant feedback */
.gp-btn:active:not(:disabled),
.btn:active:not(:disabled),
.sl-btn:active:not(:disabled),
.spl-btn:active:not(:disabled) {
  transform: translateY(1px);
}

/* Disabled State */
.gp-btn:disabled,
.gp-btn.is-disabled,
.btn:disabled,
.btn.is-disabled,
.sl-btn:disabled,
.sl-btn.is-disabled,
.spl-btn:disabled,
.spl-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Loading State with Inline Spinner */
.gp-btn.is-loading,
.btn.is-loading,
.sl-btn.is-loading,
.spl-btn.is-loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}

.gp-btn.is-loading::after,
.btn.is-loading::after,
.sl-btn.is-loading::after,
.spl-btn.is-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: gp-btn-spin 0.7s linear infinite;
}

@keyframes gp-btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Button Variants ── */

/* Primary Button */
.gp-btn--primary {
  background-color: var(--gp-primary);
  color: #ffffff;
  border-color: var(--gp-primary);
  box-shadow: var(--gp-shadow-xs);
}

.gp-btn--primary:hover:not(:disabled) {
  background-color: var(--gp-primary-hover);
  border-color: var(--gp-primary-hover);
  color: #ffffff;
  box-shadow: var(--gp-shadow-sm);
}

.gp-btn--primary:active:not(:disabled) {
  background-color: var(--gp-primary-active);
  border-color: var(--gp-primary-active);
}

/* Secondary / Outline Button */
.gp-btn--secondary,
.gp-btn--outline {
  background-color: var(--gp-surface);
  color: var(--gp-text-main);
  border-color: var(--gp-border-strong);
  box-shadow: var(--gp-shadow-xs);
}

.gp-btn--secondary:hover:not(:disabled),
.gp-btn--outline:hover:not(:disabled) {
  background-color: var(--gp-surface-2);
  border-color: var(--gp-text-muted);
  color: var(--gp-text-heading);
}

/* Ghost / Tertiary Button */
.gp-btn--ghost {
  background-color: transparent;
  color: var(--gp-text-secondary);
  border-color: transparent;
}

.gp-btn--ghost:hover:not(:disabled) {
  background-color: var(--gp-surface-2);
  color: var(--gp-text-heading);
}

/* Danger Button */
.gp-btn--danger {
  background-color: var(--gp-danger);
  color: #ffffff;
  border-color: var(--gp-danger);
  box-shadow: var(--gp-shadow-xs);
}

.gp-btn--danger:hover:not(:disabled) {
  background-color: #be123c;
  border-color: #be123c;
  color: #ffffff;
}

/* Success Button */
.gp-btn--success {
  background-color: var(--gp-success);
  color: #ffffff;
  border-color: var(--gp-success);
  box-shadow: var(--gp-shadow-xs);
}

.gp-btn--success:hover:not(:disabled) {
  background-color: #047857;
  border-color: #047857;
  color: #ffffff;
}

/* ── Button Sizing Hierarchy ── */

.gp-btn--sm {
  height: 32px;
  min-height: 32px;
  padding: 0 var(--gp-space-3);
  font-size: var(--gp-font-size-sm);
  border-radius: var(--gp-radius-sm);
  gap: 6px;
}

.gp-btn--lg {
  height: 46px;
  min-height: 46px;
  padding: 0 var(--gp-space-6);
  font-size: var(--gp-font-size-md);
  border-radius: var(--gp-radius-md);
  gap: 10px;
}

.gp-btn--icon-only {
  width: 38px;
  padding: 0;
}

.gp-btn--icon-only.gp-btn--sm {
  width: 32px;
}

.gp-btn--block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   5. UNIVERSAL FORM CONTROLS (.gp-input, .gp-select, .gp-textarea)
   ========================================================================== */

.gp-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--gp-space-1);
  margin-bottom: var(--gp-space-4);
}

.gp-label {
  font-family: var(--gp-font-family);
  font-size: var(--gp-font-size-sm);
  font-weight: var(--gp-font-semibold);
  color: var(--gp-text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gp-label-hint {
  font-size: var(--gp-font-size-xs);
  font-weight: var(--gp-font-regular);
  color: var(--gp-text-muted);
}

.gp-input,
.gp-select,
.gp-textarea {
  width: 100%;
  font-family: var(--gp-font-family);
  font-size: var(--gp-font-size-base);
  color: var(--gp-text-main);
  background-color: var(--gp-surface);
  border: 1px solid var(--gp-border-strong);
  border-radius: var(--gp-radius-sm);
  padding: 0 var(--gp-space-3);
  box-sizing: border-box;
  outline: none;
  transition: border-color var(--gp-transition-fast),
    box-shadow var(--gp-transition-fast);
}

.gp-input {
  height: 38px;
  min-height: 38px;
}

.gp-select {
  height: 38px;
  min-height: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  appearance: none;
}

.gp-textarea {
  padding: var(--gp-space-2) var(--gp-space-3);
  min-height: 80px;
  line-height: var(--gp-line-height-normal);
  resize: vertical;
}

.gp-input::placeholder,
.gp-textarea::placeholder {
  color: var(--gp-text-faint);
}

/* Input Focus State */
.gp-input:focus,
.gp-select:focus,
.gp-textarea:focus {
  border-color: var(--gp-primary);
  box-shadow: 0 0 0 3px var(--gp-focus-ring);
}

/* Input Disabled State */
.gp-input:disabled,
.gp-select:disabled,
.gp-textarea:disabled {
  background-color: var(--gp-surface-2);
  color: var(--gp-text-muted);
  cursor: not-allowed;
}

/* Input Error State */
.gp-input.has-error,
.gp-select.has-error,
.gp-textarea.has-error {
  border-color: var(--gp-danger);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}

.gp-error-msg {
  font-size: var(--gp-font-size-xs);
  color: var(--gp-danger-text);
  font-weight: var(--gp-font-medium);
  margin-top: 2px;
}

/* ==========================================================================
   6. UNIVERSAL CARD & PANEL ARCHITECTURE (.gp-card)
   ========================================================================== */

.gp-card {
  background-color: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  box-shadow: var(--gp-shadow-card);
  box-sizing: border-box;
  overflow: hidden;
  position: relative;
  transition: border-color var(--gp-transition-fast),
    box-shadow var(--gp-transition-fast);
}

.gp-card--interactive:hover {
  border-color: var(--gp-border-strong);
  box-shadow: var(--gp-shadow-card-hover);
}

.gp-card-header {
  padding: var(--gp-space-4) var(--gp-space-5);
  border-bottom: 1px solid var(--gp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gp-space-3);
  background-color: var(--gp-surface);
}

.gp-card-title {
  font-family: var(--gp-font-family);
  font-size: var(--gp-font-size-md);
  font-weight: var(--gp-font-bold);
  color: var(--gp-text-heading);
  letter-spacing: -0.01em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--gp-space-2);
}

.gp-card-body {
  padding: var(--gp-space-5);
}

.gp-card-footer {
  padding: var(--gp-space-3) var(--gp-space-5);
  border-top: 1px solid var(--gp-border);
  background-color: var(--gp-surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gp-space-2);
}

/* ==========================================================================
   7. UNIVERSAL STATUS INDICATOR SYSTEM (.gp-status)
   Restrained dots & compact semantic pills only. No bubble UI.
   ========================================================================== */

.gp-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--gp-font-size-xs);
  font-weight: var(--gp-font-semibold);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

/* Status Dot: 8px restrained circle */
.gp-status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Status Pill: Compact, high-contrast, strictly 9999px radius */
.gp-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--gp-radius-full);
  font-size: var(--gp-font-size-xs);
  font-weight: var(--gp-font-semibold);
  border: 1px solid transparent;
  line-height: 1.25;
}

/* Status Variants */
.gp-status--active,
.gp-status--verified,
.gp-status--completed,
.gp-status--success {
  color: var(--gp-success-text);
  background-color: var(--gp-success-bg);
  border-color: var(--gp-success-border);
}

.gp-status--active .gp-status-dot,
.gp-status--verified .gp-status-dot,
.gp-status--completed .gp-status-dot {
  background-color: var(--gp-success);
}

.gp-status--pending,
.gp-status--processing,
.gp-status--warning {
  color: var(--gp-warning-text);
  background-color: var(--gp-warning-bg);
  border-color: var(--gp-warning-border);
}

.gp-status--pending .gp-status-dot,
.gp-status--processing .gp-status-dot {
  background-color: var(--gp-warning);
}

.gp-status--danger,
.gp-status--rejected,
.gp-status--suspended,
.gp-status--failed {
  color: var(--gp-danger-text);
  background-color: var(--gp-danger-bg);
  border-color: var(--gp-danger-border);
}

.gp-status--danger .gp-status-dot,
.gp-status--rejected .gp-status-dot,
.gp-status--suspended .gp-status-dot {
  background-color: var(--gp-danger);
}

.gp-status--neutral,
.gp-status--draft,
.gp-status--inactive {
  color: var(--gp-text-muted);
  background-color: var(--gp-surface-2);
  border-color: var(--gp-border);
}

.gp-status--neutral .gp-status-dot,
.gp-status--draft .gp-status-dot {
  background-color: var(--gp-text-muted);
}

.gp-status--info {
  color: var(--gp-info-text);
  background-color: var(--gp-info-bg);
  border-color: var(--gp-info-border);
}

.gp-status--info .gp-status-dot {
  background-color: var(--gp-info);
}

/* ==========================================================================
   8. BRAND HEADER ARCHITECTURE
   ========================================================================== */

.gp-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--gp-space-3);
  text-decoration: none;
  user-select: none;
}

.gp-brand-logo {
  width: 38px;
  height: 38px;
  min-width: 38px;
  max-width: 38px;
  max-height: 38px;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--gp-shadow-xs);
  flex-shrink: 0;
}

.gp-brand-logo img,
.gp-brand-logo svg {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
}

.gp-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.gp-brand-title {
  font-family: var(--gp-font-family);
  font-size: 19px;
  font-weight: var(--gp-font-extrabold);
  line-height: 1.1;
  color: var(--gp-text-heading);
  letter-spacing: -0.02em;
}

.gp-brand-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 11px;
  font-weight: var(--gp-font-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: var(--gp-radius-sm);
  border: 1px solid var(--gp-border);
  background-color: var(--gp-surface-2);
  color: var(--gp-text-secondary);
  line-height: 1.25;
}

/* Specific subsite role badge accents with dark-safe contrast */
.gp-brand-badge--marketplace {
  color: var(--gp-subsite-marketplace);
  border-color: rgba(2, 132, 199, 0.35);
  background-color: rgba(2, 132, 199, 0.1);
}

.gp-brand-badge--seller {
  color: var(--gp-subsite-seller);
  border-color: rgba(13, 148, 136, 0.35);
  background-color: rgba(13, 148, 136, 0.1);
}

.gp-brand-badge--supplier {
  color: #c88a58;
  border-color: rgba(200, 138, 88, 0.35);
  background-color: rgba(200, 138, 88, 0.1);
}

.gp-brand-badge--admin {
  color: var(--gp-subsite-admin);
  border-color: rgba(79, 70, 229, 0.35);
  background-color: rgba(79, 70, 229, 0.1);
}

/* ==========================================================================
   9. PUBLIC FOOTER ARCHITECTURE (.gp-footer)
   Consistent 4-column public layout for landing, shop, seller & supplier
   ========================================================================== */

.gp-footer {
  background-color: var(--gp-footer-bg);
  border-top: 1px solid var(--gp-footer-border);
  padding: var(--gp-space-12) 0 var(--gp-space-8);
  font-family: var(--gp-font-family);
  color: var(--gp-footer-text);
  box-sizing: border-box;
}

.gp-footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--gp-space-8);
  margin-bottom: var(--gp-space-10);
}

.gp-footer-brand p {
  font-size: var(--gp-font-size-base);
  line-height: var(--gp-line-height-normal);
  color: var(--gp-footer-text);
  margin-top: var(--gp-space-3);
  max-width: 320px;
}

/* Brand mark inside the dark footer plane */
.gp-footer .gp-brand-title {
  color: var(--gp-footer-heading);
}

.gp-footer-col h3,
.gp-footer-col h4,
.gp-footer-heading {
  font-size: var(--gp-font-size-sm);
  font-weight: var(--gp-font-bold);
  color: var(--gp-text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gp-footer-heading);
  margin-bottom: var(--gp-space-4);
}

.gp-footer-links,
.gp-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gp-space-2);
}

.gp-footer-links a,
.gp-footer-col ul a {
  font-size: var(--gp-font-size-base);
  color: var(--gp-footer-link);
  text-decoration: none;
  transition: color var(--gp-transition-fast);
}

.gp-footer-links a:hover,
.gp-footer-col ul a:hover {
  color: var(--gp-footer-link-hover);
}

.gp-footer-links a:focus-visible,
.gp-footer-col ul a:focus-visible,
.gp-footer-legal-links a:focus-visible {
  outline: 3px solid var(--gp-footer-link-hover);
  outline-offset: 2px;
  border-radius: var(--gp-radius-xs);
}

.gp-footer-bottom {
  padding-top: var(--gp-space-6);
  border-top: 1px solid var(--gp-footer-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--gp-font-size-sm);
  color: var(--gp-footer-text);
  flex-wrap: wrap;
  gap: var(--gp-space-4);
}

.gp-footer-legal-links {
  display: flex;
  align-items: center;
  gap: var(--gp-space-4);
}

.gp-footer-legal-links a {
  color: var(--gp-footer-link);
  text-decoration: none;
  transition: color var(--gp-transition-fast);
}

.gp-footer-legal-links a:hover {
  color: var(--gp-footer-link-hover);
}

@media (max-width: 900px) {
  .gp-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gp-space-6);
  }
}

@media (max-width: 600px) {
  .gp-footer-grid {
    grid-template-columns: 1fr;
  }

  .gp-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   10. UNIVERSAL MODAL SYSTEM (.gp-modal)
   ========================================================================== */

.gp-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--gp-z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gp-space-4);
  animation: gp-fade-in var(--gp-transition-normal);
}

.gp-modal {
  background-color: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-xl);
  box-shadow: var(--gp-shadow-modal);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--gp-z-modal);
  animation: gp-modal-scale var(--gp-transition-smooth);
}

.gp-modal--lg {
  max-width: 800px;
}

.gp-modal-header {
  padding: var(--gp-space-4) var(--gp-space-5);
  border-bottom: 1px solid var(--gp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gp-modal-title {
  font-size: var(--gp-font-size-lg);
  font-weight: var(--gp-font-bold);
  color: var(--gp-text-heading);
  margin: 0;
}

.gp-modal-close {
  background: transparent;
  border: none;
  color: var(--gp-text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--gp-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--gp-transition-fast), background-color var(--gp-transition-fast);
}

.gp-modal-close:hover {
  background-color: var(--gp-surface-2);
  color: var(--gp-text-heading);
}

.gp-modal-body {
  padding: var(--gp-space-5);
  overflow-y: auto;
}

.gp-modal-footer {
  padding: var(--gp-space-4) var(--gp-space-5);
  border-top: 1px solid var(--gp-border);
  background-color: var(--gp-surface-2);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--gp-space-2);
}

@keyframes gp-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes gp-modal-scale {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ==========================================================================
   11. APPLICATION SHELL, NAVIGATION & WAYFINDING
   ========================================================================== */

/* Page container: shared horizontal rhythm across every subsite */
.gp-container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--gp-space-6);
  box-sizing: border-box;
}

/* Sticky header. The ONLY backdrop-filter plane permitted in the system. */
.gp-header {
  position: sticky;
  top: 0;
  z-index: var(--gp-z-sticky);
  background-color: var(--gp-header-bg);
  border-bottom: 1px solid var(--gp-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gp-space-6);
  height: 64px;
}

.gp-header-nav {
  display: flex;
  align-items: center;
  gap: var(--gp-space-4);
}

/* Horizontal navigation */
.gp-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.gp-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--gp-space-3);
  border-radius: var(--gp-radius-sm);
  font-size: var(--gp-font-size-base);
  font-weight: var(--gp-font-medium);
  color: var(--gp-text-secondary);
  text-decoration: none;
  transition:
    color var(--gp-transition-fast),
    background-color var(--gp-transition-fast);
}

.gp-nav-link:hover {
  color: var(--gp-text-heading);
  background-color: var(--gp-surface-2);
}

.gp-nav-link:focus-visible {
  outline: 3px solid var(--gp-primary);
  outline-offset: 2px;
}

.gp-nav-link[aria-current="page"],
.gp-nav-link.is-active {
  color: var(--gp-primary);
  background-color: var(--gp-primary-light);
  font-weight: var(--gp-font-semibold);
}

/* Breadcrumb */
.gp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gp-space-2);
  font-size: var(--gp-font-size-sm);
  color: var(--gp-text-muted);
}

.gp-breadcrumb a {
  color: var(--gp-text-secondary);
  text-decoration: none;
  transition: color var(--gp-transition-fast);
}

.gp-breadcrumb a:hover {
  color: var(--gp-primary);
}

.gp-breadcrumb-sep {
  color: var(--gp-text-faint);
  user-select: none;
}

.gp-breadcrumb [aria-current="page"] {
  color: var(--gp-text-heading);
  font-weight: var(--gp-font-semibold);
}

/* Pagination */
.gp-pagination {
  display: flex;
  align-items: center;
  gap: var(--gp-space-1);
}

.gp-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--gp-space-2);
  border: 1px solid transparent;
  border-radius: var(--gp-radius-sm);
  font-size: var(--gp-font-size-base);
  font-weight: var(--gp-font-medium);
  color: var(--gp-text-secondary);
  text-decoration: none;
  font-feature-settings: var(--gp-tabular-nums);
  font-variant-numeric: tabular-nums;
  transition:
    color var(--gp-transition-fast),
    background-color var(--gp-transition-fast),
    border-color var(--gp-transition-fast);
}

.gp-page-link:hover {
  background-color: var(--gp-surface-2);
  border-color: var(--gp-border);
  color: var(--gp-text-heading);
}

.gp-page-link:focus-visible {
  outline: 3px solid var(--gp-primary);
  outline-offset: 2px;
}

.gp-page-link[aria-current="page"],
.gp-page-link.is-active {
  background-color: var(--gp-primary);
  border-color: var(--gp-primary);
  color: #ffffff;
  font-weight: var(--gp-font-semibold);
}

.gp-page-link[aria-disabled="true"],
.gp-page-link.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Compact chip: a tag, NOT a status pill. Radius stays on the ladder. */
.gp-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gp-space-2);
}

.gp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 var(--gp-space-3);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-sm);
  background-color: var(--gp-surface);
  color: var(--gp-text-secondary);
  font-family: var(--gp-font-family);
  font-size: var(--gp-font-size-sm);
  font-weight: var(--gp-font-medium);
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--gp-transition-fast),
    background-color var(--gp-transition-fast),
    border-color var(--gp-transition-fast);
}

.gp-chip:hover {
  border-color: var(--gp-border-strong);
  color: var(--gp-text-heading);
}

.gp-chip:focus-visible {
  outline: 3px solid var(--gp-primary);
  outline-offset: 2px;
}

.gp-chip[aria-pressed="true"],
.gp-chip.is-active {
  background-color: var(--gp-primary);
  border-color: var(--gp-primary);
  color: #ffffff;
  font-weight: var(--gp-font-semibold);
}

/* Section rhythm and headings. Headings carry their own weight: no kickers. */
.gp-section {
  padding: var(--gp-space-16) 0;
}

.gp-section--tight {
  padding: var(--gp-space-12) 0;
}

.gp-section-header {
  max-width: 720px;
  margin-bottom: var(--gp-space-8);
}

.gp-section-title {
  margin: 0;
  font-family: var(--gp-font-family);
  font-size: var(--gp-font-size-2xl);
  font-weight: var(--gp-font-extrabold);
  line-height: var(--gp-line-height-tight);
  letter-spacing: -0.02em;
  color: var(--gp-text-heading);
}

.gp-section-subtitle {
  margin: var(--gp-space-3) 0 0;
  font-size: var(--gp-font-size-md);
  line-height: var(--gp-line-height-normal);
  color: var(--gp-text-muted);
}

@media (max-width: 768px) {
  .gp-container {
    padding: 0 var(--gp-space-4);
  }

  .gp-section {
    padding: var(--gp-space-12) 0;
  }

  .gp-header-inner {
    height: 56px;
  }
}

/* ==========================================================================
   12. COMMERCE PRODUCT CARD (.gp-product-card)
   Data-forward layout. No nested cards, no centred decorative icon stacks.
   ========================================================================== */

.gp-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gp-space-5);
}

.gp-product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--gp-surface);
  border: 1px solid var(--gp-border);
  border-radius: var(--gp-radius-lg);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition:
    border-color var(--gp-transition-fast),
    box-shadow var(--gp-transition-fast),
    transform var(--gp-transition-fast);
}

.gp-product-card:hover {
  border-color: var(--gp-border-strong);
  box-shadow: var(--gp-shadow-card-hover);
  transform: translateY(-2px);
}

.gp-product-card:focus-visible {
  outline: 3px solid var(--gp-primary);
  outline-offset: 2px;
}

.gp-product-media {
  display: block;
  aspect-ratio: 4 / 3;
  background-color: var(--gp-surface-2);
  overflow: hidden;
}

.gp-product-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gp-product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--gp-space-2);
  padding: var(--gp-space-4);
}

.gp-product-vendor {
  font-size: var(--gp-font-size-xs);
  font-weight: var(--gp-font-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gp-text-muted);
}

.gp-product-title {
  margin: 0;
  font-size: var(--gp-font-size-base);
  font-weight: var(--gp-font-semibold);
  line-height: var(--gp-line-height-snug);
  color: var(--gp-text-heading);
}

/* Weight, not colour, carries the price. Figures never jitter. */
.gp-product-price {
  display: flex;
  align-items: baseline;
  gap: var(--gp-space-2);
  font-feature-settings: var(--gp-tabular-nums);
  font-variant-numeric: tabular-nums;
}

.gp-product-price-value {
  font-size: var(--gp-font-size-lg);
  font-weight: var(--gp-font-bold);
  letter-spacing: -0.01em;
  color: var(--gp-text-heading);
}

.gp-product-price-unit {
  font-size: var(--gp-font-size-xs);
  font-weight: var(--gp-font-medium);
  color: var(--gp-text-muted);
}

.gp-product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gp-space-2);
  margin-top: auto;
  padding-top: var(--gp-space-3);
  border-top: 1px solid var(--gp-border);
  font-size: var(--gp-font-size-xs);
  color: var(--gp-text-muted);
}

/* ==========================================================================
   13. BACKWARD COMPATIBILITY ALIASES
   Allows existing stylesheets to map effortlessly to GawangPinas global tokens
   ========================================================================== */

:root {
  --gp-font-body: var(--gp-font-family);
  --gp-font-heading: var(--gp-font-family);
}