/* ============================================================
   Billigfones.dk B2B Shop - Design System
   ============================================================ */
:root {
  --c-primary:        #0b3d91;
  --c-primary-dark:   #082c69;
  --c-primary-light:  #1e6dd8;
  --c-accent:         #f1c40f;
  --c-accent-dark:    #c79f00;
  --c-bg:             #f7f8fb;
  --c-surface:        #ffffff;
  --c-surface-2:      #f3f4f6;
  --c-border:         #e5e7eb;
  --c-border-strong:  #d1d5db;
  --c-text:           #1f2937;
  --c-text-mute:      #6b7280;
  --c-text-soft:      #9ca3af;
  --c-success-bg:     #d1fae5; --c-success-fg: #065f46;
  --c-warning-bg:     #fef3c7; --c-warning-fg: #7c5e00;
  --c-info-bg:        #e0e7ff; --c-info-fg:    #3730a3;
  --c-danger-bg:      #fee2e2; --c-danger-fg:  #991b1b;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 28px rgba(0,0,0,.10);
  --shadow-xl: 0 24px 60px rgba(0,0,0,.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ============================================================
   LOGIN PAGE (full-screen hero)
   ============================================================ */
body.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(125deg, var(--c-primary) 0%, var(--c-primary-light) 45%, #3b8ce6 100%);
  position: relative; overflow: hidden;
}
body.login-page::before, body.login-page::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .45; pointer-events: none; z-index: 0;
}
body.login-page::before { width: 520px; height: 520px; background: var(--c-accent); top: -180px; right: -120px; }
body.login-page::after  { width: 480px; height: 480px; background: #3b82f6; bottom: -200px; left: -160px; }

.login-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.97);
  width: 100%; max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
}
.login-card .brand { text-align: center; margin-bottom: 22px; }
.login-card .brand img { max-height: 60px; }
.login-card .brand h1 { color: var(--c-primary); font-size: 18px; margin-top: 8px; font-weight: 700; }
.login-card .brand p  { color: var(--c-text-mute); font-size: 13px; margin-top: 4px; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 13px; color: #374151; font-weight: 600; }
.login-card input { width: 100%; padding: 11px 13px; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); font-size: 14px; transition: .15s; }
.login-card input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(11,61,145,.12); }
.login-card .btn { width: 100%; margin-top: 18px; }
.foot-link { text-align: center; margin-top: 14px; font-size: 13px; color: var(--c-text-mute); }
.foot-link a { color: var(--c-primary); font-weight: 600; }
.foot-link a:hover { text-decoration: underline; }

/* ============================================================
   APP CHROME (after login)
   ============================================================ */
.topbar {
  background: var(--c-primary); color: #fff;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
  box-shadow: var(--shadow-sm);
}
.topbar .brand-row a { color: #fff; display: flex; align-items: center; gap: 12px; }
.topbar .brand-row img { height: 36px; background: #fff; padding: 4px 10px; border-radius: var(--r-sm); }
.topbar .brand-row strong { font-size: 13px; opacity: .85; letter-spacing: .5px; }

.snav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.snav a { color: #cfd9ee; padding: 6px 4px; transition: .15s; }
.snav a:hover { color: #fff; }
.snav .user { background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: var(--r-sm); font-size: 12px; }
.cartbadge { background: var(--c-accent); color: #1a1a1a; border-radius: var(--r-pill); padding: 1px 9px; font-size: 12px; font-weight: 700; margin-left: 4px; }

.container { max-width: 1240px; margin: 28px auto; padding: 0 20px; }

.shop-footer {
  margin-top: 40px;
  background: #1a2742; color: #cfd9ee;
  padding: 32px 20px 18px;
  font-size: 13px;
}
.shop-footer .inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 24px; }
.shop-footer h4 { color: #fff; font-size: 13px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.shop-footer a { color: #cfd9ee; }
.shop-footer a:hover { color: #fff; }
.shop-footer .copy { max-width: 1240px; margin: 24px auto 0; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); text-align: center; font-size: 12px; color: rgba(255,255,255,.6); }

/* ============================================================
   HERO BANNER (shop browse)
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
  color: #fff;
  padding: 36px 32px;
  border-radius: var(--r-lg);
  margin-bottom: 22px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero::before { content: ''; position: absolute; inset: -20px -20px auto auto; width: 240px; height: 240px; background: var(--c-accent); border-radius: 50%; filter: blur(60px); opacity: .35; pointer-events: none; }
.hero h1 { position: relative; font-size: 24px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.3px; }
.hero p  { position: relative; opacity: .9; font-size: 14px; margin-bottom: 16px; }
.hero-stats { position: relative; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stat { background: rgba(255,255,255,.14); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.2); padding: 8px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; }
.hero-stat strong { font-weight: 700; }

/* ============================================================
   CARDS / BUTTONS / FORMS
   ============================================================ */
.card { background: var(--c-surface); border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--c-border); }
.card h2 { color: var(--c-primary); font-size: 18px; margin-bottom: 4px; }
.card .hint { color: var(--c-text-mute); font-size: 13px; margin-bottom: 14px; }
.card .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }

.btn { cursor: pointer; border: 0; padding: 10px 18px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; text-decoration: none; display: inline-block; transition: .15s; }
.btn.primary { background: var(--c-primary); color: #fff; }
.btn.primary:hover { background: var(--c-primary-dark); box-shadow: 0 4px 12px rgba(11,61,145,.25); }
.btn.secondary { background: var(--c-surface-2); color: var(--c-text); }
.btn.secondary:hover { background: var(--c-border); }
.btn.danger { background: #ef4444; color: #fff; }
.btn.danger:hover { background: #dc2626; }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); }
.btn.ghost:hover { background: rgba(255,255,255,.1); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

form label { display: block; margin: 12px 0 6px; font-size: 13px; color: #374151; font-weight: 600; }
form input[type=text], form input[type=email], form input[type=password], form input[type=number], form textarea, form select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); font-size: 14px; transition: .15s;
}
form input:focus, form textarea:focus, form select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(11,61,145,.1); }

/* ============================================================
   FILTER TOOLBAR
   ============================================================ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search-wrap { position: relative; flex: 1 1 320px; max-width: 480px; }
.search-wrap input { width: 100%; padding: 12px 40px 12px 14px; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); font-size: 14px; background: #fff; transition: .15s; }
.search-wrap input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(11,61,145,.12); }
.search-wrap::after { content: '🔍'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--c-text-soft); pointer-events: none; }

.facet { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--c-border-strong); border-radius: var(--r-sm); padding: 0 10px; font-size: 13px; }
.facet label { margin: 0; font-weight: 600; color: var(--c-text-mute); font-size: 12px; }
.facet select { border: 0; padding: 9px 4px; font-size: 13px; background: transparent; outline: none; }

.results-info { font-size: 13px; color: var(--c-text-mute); margin-bottom: 14px; }

/* ============================================================
   CATALOG: SERIES → MODEL → COLOR → GB
   ============================================================ */
.series-block { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); margin-bottom: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.series-head { padding: 14px 22px; background: linear-gradient(90deg, var(--c-primary) 0, var(--c-primary-light) 100%); color: #fff; display: flex; align-items: center; justify-content: space-between; }
.series-name { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.series-count { font-size: 12px; opacity: .9; font-weight: 600; background: rgba(255,255,255,.14); padding: 3px 10px; border-radius: var(--r-pill); }

.product-row { padding: 18px 22px; border-bottom: 1px solid #f1f5f9; }
.product-row:last-child { border-bottom: 0; }
.product-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.product-img { width: 64px; height: 64px; border-radius: var(--r-md); background: var(--c-surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; border: 1px solid var(--c-border); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img .ni { font-size: 28px; color: #cbd5e1; }
.product-name { font-size: 17px; font-weight: 700; color: var(--c-text); }
.product-name .badge { font-size: 11px; font-weight: 600; color: var(--c-text-mute); background: var(--c-surface-2); padding: 2px 8px; border-radius: var(--r-pill); margin-left: 8px; vertical-align: 1px; }

.color-group { margin-left: 78px; margin-top: 8px; padding-left: 14px; border-left: 3px solid #f1f5f9; }
.color-name { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--c-text-mute); margin-bottom: 8px; }
.gb-pills { display: flex; flex-wrap: wrap; gap: 8px; }

.gb-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--c-surface-2);
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  font-size: 13px; transition: .15s;
}
.gb-pill:hover { border-color: var(--c-primary); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(11,61,145,.10); background: #fff; }
.gb-pill .gbtag { background: var(--c-primary); color: #fff; padding: 3px 9px; border-radius: var(--r-sm); font-weight: 700; font-size: 12px; min-width: 56px; text-align: center; }
.gb-pill .grade { padding: 3px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; }
.gb-pill .grade.premium     { background: var(--c-success-bg); color: var(--c-success-fg); }
.gb-pill .grade.fremragende { background: var(--c-warning-bg); color: var(--c-warning-fg); }
.gb-pill .grade.god         { background: var(--c-info-bg);    color: var(--c-info-fg);    }
.gb-pill .grade.brugt       { background: var(--c-danger-bg);  color: var(--c-danger-fg);  }
.gb-pill .stock { font-size: 11px; color: var(--c-text-mute); font-weight: 600; }
.gb-pill .price { font-weight: 700; color: var(--c-primary); font-size: 15px; }
.gb-pill button { background: var(--c-primary); color: #fff; border: 0; padding: 6px 12px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; cursor: pointer; }
.gb-pill button:hover { background: var(--c-primary-dark); }
.gb-pill button:disabled { background: #9ca3af; cursor: not-allowed; }
.gb-pill button.added { background: var(--c-success-fg); }

.no-results { background: var(--c-surface); border: 1px dashed var(--c-border-strong); border-radius: var(--r-lg); padding: 60px 20px; text-align: center; color: var(--c-text-soft); font-size: 14px; }
.no-results .ic { font-size: 48px; margin-bottom: 8px; }

/* ============================================================
   TABLES
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.tbl th { background: var(--c-surface-2); text-align: left; padding: 10px; font-size: 12px; color: var(--c-text-mute); text-transform: uppercase; letter-spacing: .3px; border-bottom: 1px solid var(--c-border); }
.tbl td { padding: 12px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tr:hover td { background: #fafbfd; }
.tbl tfoot td { background: #f9fafb; padding: 14px 10px; font-weight: 600; }

/* ============================================================
   ALERTS / STATUS
   ============================================================ */
.alert { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert.success { background: var(--c-success-bg); color: var(--c-success-fg); border: 1px solid #a7f3d0; }
.alert.error   { background: var(--c-danger-bg);  color: var(--c-danger-fg);  border: 1px solid #fecaca; }
.alert.info    { background: #dbeafe;             color: #1e40af;             border: 1px solid #bfdbfe; }
.alert.warning { background: var(--c-warning-bg); color: var(--c-warning-fg); border: 1px solid #fde68a; }
.alert::before { font-size: 16px; }
.alert.success::before { content: '✓'; }
.alert.error::before   { content: '✗'; }
.alert.info::before    { content: 'ⓘ'; }
.alert.warning::before { content: '!'; }

/* ============================================================
   PILLS / STATUS BADGES
   ============================================================ */
.pill { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; background: var(--c-surface-2); color: #374151; }
.pill.ok   { background: var(--c-success-bg); color: var(--c-success-fg); }
.pill.no   { background: var(--c-danger-bg);  color: var(--c-danger-fg);  }
.pill.warn { background: var(--c-warning-bg); color: var(--c-warning-fg); }
.pill.info { background: #dbeafe;             color: #1e40af;             }

/* ============================================================
   SNAV ACTIVE LINK HIGHLIGHT
   ============================================================ */
.snav a.active, .snav a:is([href$="dashboard.php"]):is([aria-current]),
.snav .user { background: rgba(255,255,255,.14); padding: 5px 12px; border-radius: var(--r-sm); font-size: 12px; }

/* ============================================================
   CUSTOM PRICE BADGE (in shop index)
   ============================================================ */
.custom-price-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0;
  padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700;
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 760px) {
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 20px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .container { margin: 14px auto; padding: 0 12px; }
  .color-group { margin-left: 0; padding-left: 10px; }
  .product-head { gap: 10px; }
  .product-img { width: 48px; height: 48px; }
  .gb-pill { padding: 8px 10px; flex-wrap: wrap; }
  .card { padding: 16px; }
}
