/* =============================================================
   NORVIK — Contemporary Fashion Demo Store
   Scandinavian-inspired minimal design
   ============================================================= */

:root {
  --brand:         #1a2c1f;
  --btn-primary:   #1a2c1f;
  --btn-hover:     #0f1d14;
  --btn-secondary: #f4f3f0;
  --text:          #1a1a1a;
  --text-muted:    #6b7280;
  --bg:            #f8f7f4;
  --surface:       #ffffff;
  --border:        #e8e5df;
  --badge-bg:      #c0392b;
  --badge-text:    #ffffff;
  --eligible-tag:  #d4edda;
  --eligible-text: #155724;
  --accent:        #6b8f71;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── Header / Nav ─────────────────────────────────────────── */
.kb-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 40px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.kb-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.kb-nav {
  display: flex;
  gap: 32px;
  align-items: center;
  flex: 1;
}

.kb-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}

.kb-nav a:hover,
.kb-nav a.active { color: var(--text); }

.kb-cart-link {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.kb-cart-badge {
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transition: transform 0.15s;
}

.kb-cart-badge:empty,
.kb-cart-badge[data-count="0"] { display: none; }

/* ── Layout container ─────────────────────────────────────── */
.kb-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Page header ──────────────────────────────────────────── */
.kb-page-header {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.kb-page-header h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.kb-page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 5px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.kb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 22px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1;
  letter-spacing: 0.3px;
}

.kb-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.kb-btn-primary {
  background: var(--btn-primary);
  color: #fff;
}
.kb-btn-primary:hover { background: var(--btn-hover); }

.kb-btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}
.kb-btn-ghost:hover { background: var(--btn-secondary); }

.kb-btn-sm { padding: 7px 14px; font-size: 12px; }
.kb-btn-full { width: 100%; }

/* ── Filter tabs (PLP) ────────────────────────────────────── */
.kb-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.kb-filter-tab {
  padding: 6px 18px;
  border-radius: 2px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.kb-filter-tab.active,
.kb-filter-tab:hover {
  background: var(--btn-primary);
  color: #fff;
  border-color: var(--btn-primary);
}

/* ── Product grid (PLP) ───────────────────────────────────── */
.kb-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding-bottom: 72px;
}

@media (max-width: 1024px) { .kb-product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .kb-product-grid { grid-template-columns: repeat(2, 1fr); } }

.kb-product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.kb-product-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.kb-product-card.hidden { display: none; }

/* Product image area */
.kb-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  text-align: center;
  padding: 12px;
  letter-spacing: 0.2px;
  overflow: hidden;
  position: relative;
}

.kb-card-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.kb-card-body { padding: 14px 16px 16px; }

.kb-card-brand {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}

.kb-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 5px 0 3px;
  line-height: 1.3;
}

.kb-card-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.kb-card-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kb-no-tryon-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 0;
}

/* ── PDP layout ───────────────────────────────────────────── */
.kb-pdp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 40px 0 72px;
}

@media (max-width: 768px) {
  .kb-pdp-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* PDP image area */
.kb-pdp-img-col { display: flex; flex-direction: column; gap: 10px; }

.kb-pdp-main-img {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  position: relative;
  background: #ede8e0;
}

.kb-pdp-main-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: opacity 0.2s;
}

.kb-pdp-thumbs {
  display: flex;
  gap: 8px;
}

.kb-pdp-thumb {
  width: 64px;
  height: 78px;
  border-radius: 3px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  position: relative;
  background: #ede8e0;
}

.kb-pdp-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.kb-pdp-thumb.active,
.kb-pdp-thumb:hover { border-color: var(--btn-primary); }

/* PDP info column */
.kb-pdp-info-col { padding-top: 4px; }

.kb-pdp-brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.kb-pdp-name {
  font-size: 28px;
  font-weight: 700;
  margin: 10px 0 6px;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.4px;
}

.kb-pdp-price {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 10px 0 28px;
}

.kb-size-section { margin-bottom: 28px; }

.kb-size-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kb-size-selected {
  color: var(--text);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.kb-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-size-btn {
  min-width: 50px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  color: var(--text);
}

.kb-size-btn:hover,
.kb-size-btn.selected {
  border-color: var(--btn-primary);
  background: var(--btn-primary);
  color: #fff;
}

.kb-pdp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-pdp-actions .kb-btn {
  width: 100%;
  padding: 16px;
  font-size: 14px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.kb-pdp-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 30px 0;
}

.kb-pdp-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.kb-pdp-meta {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-pdp-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.kb-pdp-meta-item span:first-child { font-size: 15px; }

/* ── Cart page ────────────────────────────────────────────── */
.kb-cart-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 36px 0 72px;
  align-items: start;
}

@media (max-width: 768px) {
  .kb-cart-layout { grid-template-columns: 1fr; }
}

.kb-cart-table {
  width: 100%;
  border-collapse: collapse;
}

.kb-cart-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0 8px 14px 0;
  border-bottom: 1px solid var(--border);
}

.kb-cart-table td {
  padding: 20px 8px 20px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.kb-cart-item-img {
  width: 64px;
  height: 80px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.kb-cart-item-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kb-cart-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kb-cart-item-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.kb-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 4px 8px;
}

.kb-qty-ctrl button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 0 2px;
  transition: color 0.12s;
}

.kb-qty-ctrl button:hover { color: var(--text); }

.kb-qty-val {
  font-size: 14px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.kb-line-total { font-size: 14px; font-weight: 600; }

.kb-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: color 0.12s;
  line-height: 1;
}

.kb-remove-btn:hover { color: #c0392b; }

/* Cart summary */
.kb-cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 28px;
  position: sticky;
  top: 80px;
}

.kb-cart-summary h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}

.kb-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.kb-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 18px 0 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.kb-cart-empty {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}

.kb-cart-empty p { font-size: 16px; margin-bottom: 16px; }
