/* ===================================================================
   233 E 21st Street — Design Selections
   Nelson Building Company
   =================================================================== */

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --surface-alt: #F5F3F0;
  --border: #E8E4DF;
  --border-light: #F0ECE7;
  --text-primary: #1A1A1A;
  --text-secondary: #6B6560;
  --text-muted: #9E978F;
  --accent: #2C2C2C;
  --accent-warm: #A68B6B;
  --accent-warm-light: #F5F0EB;
  --approved: #2D8B55;
  --approved-bg: #EDF7F0;
  --approved-border: #B8DEC5;
  --rejected: #C4453A;
  --rejected-bg: #FDF0EF;
  --rejected-border: #F0C4C0;
  --pending: #C68A2E;
  --pending-bg: #FFF8ED;
  --selected-ring: #A68B6B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --sidebar-width: 260px;
  --header-height: 60px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--text-primary); background: var(--bg); line-height: 1.55; }

/* ── HEADER ─────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
}
.header-inner {
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-name { font-family: var(--font-display); font-size: 17px; color: var(--text-primary); letter-spacing: 0.01em; }
.brand-divider { color: var(--border); font-weight: 300; }
.project-name { font-size: 13px; color: var(--text-secondary); font-weight: 400; letter-spacing: 0.02em; }
.header-right { display: flex; align-items: center; gap: 16px; }
.progress-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-alt); padding: 6px 14px; border-radius: 20px;
  font-size: 13px; color: var(--text-secondary);
}
.progress-count { font-weight: 700; color: var(--accent-warm); font-size: 15px; }

/* ── APP LAYOUT ─────────────────────────────────── */
.app-layout {
  display: flex; margin-top: var(--header-height); min-height: calc(100vh - var(--header-height));
}

/* ── SIDEBAR ────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--header-height); left: 0; bottom: 0;
  width: var(--sidebar-width); background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 0; overflow-y: auto;
  display: flex; flex-direction: column;
  z-index: 90;
}
.sidebar-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 0 20px; margin-bottom: 12px;
}
.nav-list { list-style: none; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; cursor: pointer;
  font-size: 14px; color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}
.nav-link:hover { background: var(--surface-alt); color: var(--text-primary); }
.nav-link.active {
  background: var(--accent-warm-light); color: var(--text-primary);
  border-left-color: var(--accent-warm); font-weight: 500;
}
.nav-icon { display: flex; align-items: center; color: var(--text-muted); flex-shrink: 0; }
.nav-link.active .nav-icon { color: var(--accent-warm); }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: var(--surface-alt);
  color: var(--text-muted); white-space: nowrap;
}
.nav-link.active .nav-badge { background: var(--accent-warm); color: #fff; }
.nav-badge.complete { background: var(--approved); color: #fff; }

.sidebar-summary {
  padding: 16px 20px; border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── MOBILE NAV ─────────────────────────────────── */
.mobile-nav-toggle {
  display: none; position: fixed; bottom: 24px; right: 24px; z-index: 200;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  box-shadow: var(--shadow-lg); cursor: pointer;
  align-items: center; justify-content: center;
}

/* ── MAIN CONTENT ───────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width); flex: 1;
  padding: 32px 40px 80px; max-width: 1100px;
}

/* ── HERO ───────────────────────────────────────── */
.hero-section { margin-bottom: 48px; }
.hero-section h1 {
  font-family: var(--font-display); font-size: 32px; font-weight: 400;
  color: var(--text-primary); margin-bottom: 8px;
}
.hero-subtitle { font-size: 15px; color: var(--text-secondary); max-width: 520px; line-height: 1.6; }
.hero-stats { display: flex; gap: 24px; margin-top: 24px; }
.stat-card {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px 28px; min-width: 100px;
}
.stat-number { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }

/* ── CATEGORY SECTION ───────────────────────────── */
.category-section {
  margin-bottom: 56px; scroll-margin-top: calc(var(--header-height) + 20px);
}
.category-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}
.category-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-warm-light); color: var(--accent-warm);
}
.category-title {
  font-family: var(--font-display); font-size: 24px; color: var(--text-primary);
}

/* ── SECTION BLOCK ──────────────────────────────── */
.section-block { margin-bottom: 36px; }
.section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted);
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

/* ── PRODUCTS GRID ──────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ── OPTION GROUP ───────────────────────────────── */
.option-group {
  grid-column: 1 / -1;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.option-group-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent-warm);
  margin-bottom: 16px;
}
.option-group .product-card { border-color: var(--border-light); }

/* Option cards in a responsive grid */
.option-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── PRODUCT CARD ───────────────────────────────── */
.product-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
}
.product-card:hover {
  border-color: #CCC;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Status states */
.product-card.status-approved {
  border-color: var(--approved-border);
  background: var(--approved-bg);
}
.product-card.status-approved .card-status-badge::after {
  content: 'APPROVED';
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 4px;
  background: var(--approved); color: #fff;
}
.product-card.status-rejected {
  border-color: var(--rejected-border);
  opacity: 0.55;
}
.product-card.status-rejected .card-status-badge::after {
  content: 'REJECTED';
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 10px; border-radius: 4px;
  background: var(--rejected); color: #fff;
}
.product-card.status-rejected:hover { opacity: 0.8; }

/* ── CARD IMAGE ─────────────────────────────────── */
.card-img-wrap {
  position: relative; background: #F8F7F5;
  display: flex; align-items: center; justify-content: center;
  height: 200px; overflow: hidden;
}
.card-img-wrap img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  padding: 12px;
  transition: transform 0.3s ease;
}
.product-card:hover .card-img-wrap img { transform: scale(1.03); }
.card-img-wrap.multi .img-count {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 11px; font-weight: 500; padding: 3px 8px;
  border-radius: 4px;
}

/* Placeholder */
.card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  height: 200px; background: #F8F7F5; color: var(--text-muted);
  font-size: 13px;
}

/* ── CARD BODY ──────────────────────────────────── */
.card-body { padding: 16px 18px 14px; }
.card-title {
  font-weight: 600; font-size: 15px; color: var(--text-primary);
  margin-bottom: 4px; line-height: 1.3;
}
.card-location {
  font-size: 12px; color: var(--text-secondary); margin-bottom: 2px;
}
.card-size {
  font-size: 12px; color: var(--text-muted); margin-bottom: 4px;
}
.card-spec {
  font-size: 12px; color: var(--text-secondary); line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ── CARD PRICING ───────────────────────────────── */
.card-pricing {
  display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px;
}
.card-price {
  font-size: 17px; font-weight: 700; color: var(--text-primary);
}
.card-price.included {
  font-size: 14px; font-weight: 500; color: var(--text-muted); font-style: italic;
}
.card-qty { font-size: 13px; font-weight: 400; color: var(--text-muted); }
.card-total {
  font-size: 12px; color: var(--text-muted); font-weight: 400;
}

/* ── CARD LINK ──────────────────────────────────── */
.card-link {
  font-size: 12px; color: var(--accent-warm); text-decoration: none;
  font-weight: 500; display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 12px;
}
.card-link:hover { text-decoration: underline; }
.card-link svg { width: 12px; height: 12px; }

/* ── CARD ACTIONS ───────────────────────────────── */
.card-actions {
  display: flex; gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--border-light);
  margin-top: 4px;
}
.action-btn {
  flex: 1; padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
  font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  color: var(--text-secondary);
}
.action-btn:hover { background: var(--surface-alt); }

/* Approve button */
.approve-btn { color: var(--approved); border-color: var(--approved-border); }
.approve-btn:hover { background: var(--approved-bg); }
.approve-btn.active {
  background: var(--approved); color: #fff;
  border-color: var(--approved);
}
.approve-btn.active svg { stroke: #fff; }

/* Reject button */
.reject-btn { color: var(--rejected); border-color: var(--rejected-border); }
.reject-btn:hover { background: var(--rejected-bg); }
.reject-btn.active {
  background: var(--rejected); color: #fff;
  border-color: var(--rejected);
}
.reject-btn.active svg { stroke: #fff; }

/* ── CARD NOTES ─────────────────────────────────── */
.card-note {
  margin-top: 10px;
}
.note-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  font-family: var(--font-body); padding: 0;
}
.note-toggle:hover { color: var(--text-secondary); }
.note-area {
  margin-top: 8px;
}
.note-area.has-note { display: block !important; }
.note-input {
  width: 100%; border: 1px solid var(--border-light);
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 13px;
  color: var(--text-primary);
  padding: 10px 12px;
  resize: vertical; min-height: 56px; line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
}
.note-input:focus { border-color: var(--accent-warm); }
.note-input::placeholder { color: var(--text-muted); }

/* ── TBD BADGE ──────────────────────────────────── */
.tbd-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 4px;
  background: var(--pending); color: #fff;
}

/* TBD card style */
.product-card.is-tbd {
  border-style: dashed;
  border-color: var(--border-light);
  opacity: 0.75;
}
.product-card.is-tbd:hover { opacity: 1; }

/* Existing item style */
.product-card.is-existing { border-color: var(--border-light); }

/* Option card sub-style */
.product-card.is-option {
  border-color: var(--border-light);
}

/* ── MODAL ──────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); position: relative;
}
.modal-close {
  position: absolute; top: 12px; right: 16px; z-index: 10;
  background: none; border: none; font-size: 28px; color: var(--text-muted);
  cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 32px; }
.modal-images {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.modal-img-wrap {
  flex: 1; min-width: 200px;
  background: #F8F7F5; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; max-height: 360px;
}
.modal-img-wrap img {
  max-width: 100%; max-height: 360px; object-fit: contain; padding: 12px;
}
.modal-details h3 {
  font-family: var(--font-display); font-size: 22px; margin-bottom: 8px;
}
.modal-spec { font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.modal-location { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.modal-size { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.modal-price { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.modal-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent-warm); font-weight: 500; font-size: 14px;
  text-decoration: none; margin-top: 8px;
}
.modal-link:hover { text-decoration: underline; }

/* ── TOAST ──────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 600;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--accent); color: #fff; padding: 12px 20px;
  border-radius: var(--radius-md); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s ease;
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .sidebar.open {
    display: flex; z-index: 150;
    width: 280px; box-shadow: var(--shadow-lg);
  }
  .mobile-nav-toggle { display: flex; }
  .main-content { margin-left: 0; padding: 24px 16px 80px; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .hero-section h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .products-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-wrap: wrap; }
  .stat-card { padding: 12px 20px; }
  .brand-divider, .project-name { display: none; }
}
