/* Kit Builder Page */
.kb-page {
  /* padding handled by global styles.css rule */
  min-height: 100vh;
  background: var(--light-bg, #f5f5f5);
}

.kb-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* Hero */
.kb-hero {
  text-align: center;
  padding: 40px 20px 30px;
}

.kb-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.kb-hero p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 30px;
}

/* Step Indicator */
.kb-steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 600px;
  margin: 0 auto;
}

.kb-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.kb-step.active {
  opacity: 1;
}

.kb-step.completed {
  opacity: 0.8;
}

.kb-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-color, #c41e3a);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.kb-step.completed .kb-step-num {
  background: #28a745;
}

.kb-step-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.kb-step-line {
  flex: 1;
  height: 2px;
  background: #ddd;
  min-width: 30px;
  max-width: 80px;
  margin: 0 8px;
  margin-bottom: 20px;
}

/* Panels */
.kb-panel {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-top: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.kb-panel.hidden {
  display: none;
}

.kb-panel h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.kb-hint {
  color: #888;
  margin-bottom: 24px;
}

.kb-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.kb-back-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #666;
  transition: all 0.2s;
}

.kb-back-btn:hover {
  border-color: var(--accent-color, #c41e3a);
  color: var(--accent-color, #c41e3a);
}

.kb-rim-badge {
  display: inline-block;
  background: var(--accent-color, #c41e3a);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  vertical-align: middle;
}

/* Size Grid (Step 1) */
.kb-size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 700px;
  margin: 0 auto;
}

.kb-size-btn {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 30px 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.kb-size-btn:hover {
  border-color: var(--accent-color, #c41e3a);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.kb-size-btn.selected {
  border-color: var(--accent-color, #c41e3a);
  background: rgba(196, 30, 58, 0.04);
}

.kb-size-num {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-color, #c41e3a);
}

.kb-size-desc {
  display: block;
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

/* Filter Bar */
.kb-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f8f8f8;
  border-radius: 8px;
}

.kb-filter-bar select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
}

.kb-sort {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kb-sort label {
  font-size: 0.85rem;
  color: #888;
}

/* Product Grid */
.kb-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.kb-product-card {
  background: white;
  border: 2px solid #eee;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.kb-product-card:hover {
  border-color: var(--accent-color, #c41e3a);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.kb-product-card.selected {
  border-color: var(--accent-color, #c41e3a);
  background: rgba(196, 30, 58, 0.03);
  box-shadow: 0 0 0 1px var(--accent-color, #c41e3a);
}

.kb-product-card img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 6px;
  background: #f9f9f9;
}

.kb-product-card .kb-card-brand {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 4px;
}

.kb-product-card .kb-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 4px;
  min-height: 2.6em;
}

.kb-product-card .kb-card-spec {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 8px;
}

.kb-product-card .kb-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-color, #c41e3a);
}

.kb-product-card .kb-card-price-each {
  font-size: 0.75rem;
  color: #999;
}

/* Selected Tire Preview (shown in step 3) */
.kb-selected-tire {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #f0fdf0;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  margin-bottom: 20px;
}

.kb-selected-tire img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 6px;
}

.kb-selected-tire .kb-sel-info {
  flex: 1;
}

.kb-selected-tire .kb-sel-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.kb-selected-tire .kb-sel-spec {
  font-size: 0.8rem;
  color: #666;
}

.kb-selected-tire .kb-sel-price {
  font-weight: 700;
  color: #28a745;
}

/* Review Panel (Step 4) */
.kb-review {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
  align-items: start;
}

.kb-review-items {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.kb-review-card {
  flex: 1;
  min-width: 220px;
  max-width: 300px;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.kb-review-card img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  margin-bottom: 12px;
}

.kb-review-card h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.kb-review-card .kb-rev-spec {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 8px;
}

.kb-review-card .kb-rev-price {
  font-size: 1.2rem;
  font-weight: 700;
}

.kb-review-plus {
  font-size: 2rem;
  font-weight: 300;
  color: #ccc;
}

/* Review Summary */
.kb-review-summary {
  background: #f9f9f9;
  border-radius: 12px;
  padding: 24px;
}

.kb-mounted-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #d4edda;
  color: #155724;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 20px;
}

.kb-mounted-badge svg {
  flex-shrink: 0;
}

.kb-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.kb-qty-row label {
  font-weight: 600;
  font-size: 0.9rem;
}

.kb-qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.kb-qty-control button {
  width: 36px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s;
}

.kb-qty-control button:hover {
  background: #e0e0e0;
}

.kb-qty-control span {
  width: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.kb-price-breakdown {
  margin-bottom: 20px;
}

.kb-price-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 0.95rem;
}

.kb-price-line.kb-price-total {
  border-bottom: none;
  border-top: 2px solid #333;
  font-size: 1.2rem;
  font-weight: 700;
  padding-top: 12px;
  margin-top: 4px;
}

.kb-free {
  color: #28a745;
  font-weight: 600;
}

.kb-extras {
  margin-bottom: 20px;
}

.kb-extras h3 {
  font-size: 0.9rem;
  margin-bottom: 10px;
  color: #666;
}

.kb-addon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 0.9rem;
}

.kb-addon input {
  accent-color: var(--accent-color, #c41e3a);
}

.kb-add-to-cart {
  width: 100%;
  padding: 16px;
  background: var(--accent-color, #c41e3a);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.kb-add-to-cart:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.kb-note {
  font-size: 0.8rem;
  color: #999;
  text-align: center;
  margin-top: 16px;
}

.kb-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #999;
}

.kb-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: #999;
}

/* Responsive */
@media (max-width: 768px) {
  .kb-size-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kb-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kb-review {
    grid-template-columns: 1fr;
  }

  .kb-review-items {
    flex-direction: column;
  }

  .kb-review-card {
    max-width: 100%;
  }

  .kb-review-plus {
    transform: rotate(90deg);
  }

  .kb-steps-indicator {
    gap: 0;
  }

  .kb-step-label {
    font-size: 0.65rem;
  }

  .kb-hero h1 {
    font-size: 1.6rem;
  }
}
