/* ==========================================================================
   CALCULATEUR - Wizard 3 étapes
   ========================================================================== */

.calc-shell {
  background: var(--bg);
  min-height: calc(100vh - var(--header-h));
  padding: var(--sp-8) 0 var(--sp-16);
}

.calc-header { text-align: center; margin-bottom: var(--sp-8); }
.calc-header h1 { font-size: clamp(1.6rem, 3vw + 1rem, 2.4rem); margin-bottom: var(--sp-2); }
.calc-header p { color: var(--text-muted); max-width: 560px; margin: 0 auto; }

/* Stepper */
.calc-steps {
  display: flex; justify-content: center; gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}
.calc-step {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-weight: 500; font-size: 0.9rem;
  color: var(--text-muted);
  transition: all var(--t-fast);
}
.calc-step .step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--cream-200); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}
.calc-step.active { background: var(--teal-900); color: #fff; border-color: var(--teal-900); }
.calc-step.active .step-num { background: var(--accent); color: #fff; }
.calc-step.done { background: var(--teal-50); color: var(--teal-900); border-color: var(--teal-100); }
.calc-step.done .step-num { background: var(--success); color: #fff; }

.calc-panel {
  display: none;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.calc-panel.active { display: block; }
@media (min-width: 900px) { .calc-panel { padding: var(--sp-12); } }

/* Layout wizard step 1 : inventaire */
.inventory-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-6);
}
@media (min-width: 1024px) {
  .inventory-layout { grid-template-columns: 1fr 340px; gap: var(--sp-8); }
}

.inventory-main {}
.inventory-search {
  position: relative;
  margin-bottom: var(--sp-6);
}
.inventory-search input {
  width: 100%; padding: var(--sp-3) var(--sp-4) var(--sp-3) 44px;
  border: 1.5px solid var(--border); border-radius: var(--r-full);
  background: var(--surface); font-size: 1rem;
}
.inventory-search input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(13,74,94,.1); }
.inventory-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-500); }

.piece-tabs {
  display: flex; gap: var(--sp-2);
  overflow-x: auto; padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-6);
  scrollbar-width: thin;
}
.piece-tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-full);
  background: var(--cream-100);
  border: 1.5px solid transparent;
  color: var(--ink-700);
  font-weight: 500; font-size: 0.9rem;
  white-space: nowrap;
  transition: all var(--t-fast);
  cursor: pointer;
}
.piece-tab:hover { border-color: var(--teal-100); }
.piece-tab.active { background: var(--teal-900); color: #fff; }
.piece-tab .count { opacity: .7; margin-left: 4px; font-size: 0.8em; }

.meubles-grid {
  display: grid; gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.meuble-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  text-align: center;
  transition: all var(--t-fast);
  position: relative;
}
.meuble-card:hover { border-color: var(--teal-100); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.meuble-card.has-quantity { border-color: var(--accent); background: linear-gradient(180deg, #fff, var(--coral-100)); }
.meuble-card.hidden { display: none; }
.meuble-thumb {
  width: 100%; aspect-ratio: 1;
  object-fit: contain; background: var(--cream-50);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-2);
}
.meuble-title {
  font-size: 0.85rem; font-weight: 500;
  color: var(--ink-900); margin-bottom: 4px;
  min-height: 2.4em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.meuble-volume { font-size: 0.75rem; color: var(--text-muted); margin-bottom: var(--sp-2); }
.meuble-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.qty-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--cream-100); color: var(--teal-900);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem;
  transition: all var(--t-fast);
}
.qty-btn:hover { background: var(--teal-900); color: #fff; }
.qty-btn:disabled { opacity: .3; cursor: not-allowed; }
.qty-input {
  width: 42px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 4px; font-weight: 600; font-size: 0.95rem;
}

.no-results { text-align: center; padding: var(--sp-12); color: var(--text-muted); grid-column: 1/-1; }

/* Panier sidebar */
.cart-sidebar {
  background: var(--cream-100);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  border: 1px solid var(--border);
  position: sticky; top: calc(var(--header-h) + var(--sp-4));
  max-height: calc(100vh - var(--header-h) - var(--sp-8));
  overflow-y: auto;
}
.cart-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-4); }
.cart-header h3 { font-family: var(--font-sans); font-size: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal-900); }
.cart-header .count-badge {
  background: var(--accent); color: #fff;
  padding: 2px 10px; border-radius: var(--r-full);
  font-size: 0.85rem; font-weight: 600;
}
.cart-items { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); max-height: 260px; overflow-y: auto; }
.cart-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
}
.cart-item-title { flex: 1; margin-right: var(--sp-2); }
.cart-item-qty { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.cart-item-remove { color: var(--danger); opacity: .5; padding: 4px; }
.cart-item-remove:hover { opacity: 1; }
.cart-empty { text-align: center; color: var(--text-muted); padding: var(--sp-6) 0; font-size: 0.9rem; }

.cart-summary {
  padding: var(--sp-4); background: var(--surface); border-radius: var(--r-md); margin-bottom: var(--sp-4);
}
.cart-summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.95rem; }
.cart-summary-row.total { font-weight: 700; font-size: 1.1rem; color: var(--teal-900); border-top: 1px solid var(--border); margin-top: var(--sp-2); padding-top: var(--sp-2); }

/* Step 2 : récap */
.recap-list {
  display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-6);
}
.recap-piece {
  background: var(--cream-50); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
}
.recap-piece summary {
  font-weight: 600; color: var(--teal-900); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0;
}
.recap-piece summary::after { content: '▾'; opacity: .5; }
.recap-piece[open] summary::after { content: '▴'; }
.recap-piece-items { margin-top: var(--sp-3); display: flex; flex-direction: column; gap: 4px; padding-left: var(--sp-4); }
.recap-item {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.9rem; padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.recap-item:last-child { border-bottom: none; }
.recap-item .remove-item { color: var(--danger); opacity: .4; padding: 4px; cursor: pointer; }
.recap-item .remove-item:hover { opacity: 1; }

.estimation-box {
  background: linear-gradient(135deg, var(--teal-800), var(--teal-900));
  color: #fff;
  padding: var(--sp-6);
  border-radius: var(--r-lg);
  text-align: center;
  margin-bottom: var(--sp-6);
}
.estimation-box h3 { color: #fff; margin-bottom: var(--sp-2); font-size: 1.1rem; font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.05em; }
.estimation-price { font-family: var(--font-display); font-size: 3rem; font-weight: 700; margin: var(--sp-3) 0; }
.estimation-details { font-size: 0.9rem; opacity: .85; margin-top: var(--sp-3); }
.estimation-hint { font-size: 0.8rem; opacity: .7; margin-top: var(--sp-2); font-style: italic; }

/* Step 3 : formulaire */
.form-legend {
  font-family: var(--font-display); font-size: 1.2rem;
  color: var(--teal-900);
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}

/* Nav wizard */
.wizard-nav {
  display: flex; justify-content: space-between;
  margin-top: var(--sp-8); padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}
.wizard-nav .spacer { flex: 1; }
