/* ==========================================================
   PN Tech Custom Kit Builder & Hardware Customizer
   Styling for Interactive Wizard, Pre-built Carousel,
   Gaming 3D START Button, Floating Dock, and Summary Modal.
   All text and UI English Only.
   ========================================================== */

:root {
  --kb-emerald: #10b981;
  --kb-emerald-dark: #059669;
  --kb-emerald-deep: #047857;
  --kb-emerald-glow: rgba(16, 185, 129, 0.35);
  --kb-amber: #f59e0b;
  --kb-card-bg: #ffffff;
  --kb-border: #E8DFC8;
  --kb-border-active: #10b981;
  --kb-dock-bg: rgba(255, 255, 255, 0.95);
}

/* Page Intro & Breadcrumb */
.kb-hero-section {
  padding: 2.5rem 0 1.5rem;
  background: radial-gradient(circle at 50% 0%, #FAF6EE 0%, #FAF7F2 100%);
  border-bottom: 1px solid var(--line);
}

.kb-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 0.85rem;
  transition: color 0.15s;
}

.kb-breadcrumb:hover {
  color: var(--board);
}

.kb-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.kb-main-title {
  margin: 0 0 0.4rem;
  font-size: 2.2rem;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.kb-badge-new {
  background: linear-gradient(135deg, var(--kb-emerald), var(--kb-emerald-dark));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px var(--kb-emerald-glow);
}

.kb-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 720px;
  line-height: 1.55;
}

/* ==================== 1. PRE-BUILT KITS CAROUSEL ==================== */
.kb-section-box {
  margin: 2.5rem 0;
}

.kb-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.kb-prebuilt-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  gap: 0.4rem;
}

.kb-prebuilt-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--ink);
  font-weight: 700;
}

.kb-prebuilt-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 600px;
}

.kb-carousel-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.kb-slider-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

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

.kb-carousel-track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-behavior: auto;
  scroll-snap-type: none;
  padding: 0.5rem 0.25rem 1.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
}

.kb-carousel-track::-webkit-scrollbar {
  display: none;
}

.kb-carousel-track:active {
  cursor: grabbing;
}

.kb-prebuilt-card {
  flex: 0 0 250px;
  width: 250px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  user-select: none;
}

.kb-prebuilt-card:hover {
  transform: translateY(-4px);
  border-color: var(--board);
  box-shadow: 0 14px 30px rgba(59, 40, 27, 0.08);
}

.kb-prebuilt-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(36, 31, 33, 0.85);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  z-index: 2;
}

.kb-prebuilt-thumb {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: contain;
  background: #FAF8F5;
  padding: 0.75rem;
  border-bottom: 1px solid var(--line);
  transition: transform 0.2s ease;
}

.kb-prebuilt-card:hover .kb-prebuilt-thumb {
  transform: scale(1.03);
}

.kb-prebuilt-body {
  padding: 0.85rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kb-prebuilt-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}

.kb-prebuilt-desc {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-prebuilt-summary-box {
  background: #FAF6EE;
  border: 1px dashed #DCC28D;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  font-size: 0.72rem;
  color: #5A3D29;
  margin-top: 0.15rem;
  margin-bottom: 0.3rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kb-prebuilt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(232, 223, 200, 0.5);
}

.kb-prebuilt-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--board-deep);
}

.kb-btn-add-prebuilt {
  background: var(--board);
  color: #fff;
  border: none;
  padding: 0.42rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  font-family: inherit;
}

.kb-btn-add-prebuilt:hover {
  background: #241F21;
  transform: scale(1.02);
}

/* ==================== 2. START MAKING YOUR KIT (HERO & 3D GAME CTA) ==================== */
.kb-start-banner {
  background: linear-gradient(135deg, #241F21 0%, #3B281B 60%, #1e1b18 100%);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  text-align: center;
  color: #fff;
  margin: 3rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px -10px rgba(36, 31, 33, 0.45);
  border: 2px solid rgba(212, 163, 115, 0.25);
}

.kb-start-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.kb-start-tag {
  display: inline-block;
  background: rgba(212, 163, 115, 0.2);
  border: 1px solid rgba(212, 163, 115, 0.4);
  color: #F7EFE6;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 1rem;
}

.kb-start-banner h2 {
  margin: 0 0 0.75rem;
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.kb-start-banner p {
  margin: 0 auto 2rem;
  font-size: 1.1rem;
  color: #E8DFC8;
  max-width: 640px;
  line-height: 1.6;
}

/* Game-Style 3D Green START CTA Button */
.kb-game-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #ffffff;
  background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
  padding: 1.15rem 3.5rem;
  border: none;
  border-radius: 18px;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  box-shadow: 
    0 8px 0 #065f46,
    0 16px 30px rgba(16, 185, 129, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.6);
  transition: all 0.12s ease-in-out;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  user-select: none;
  animation: kb-btn-pulse 2.8s infinite;
}

.kb-game-cta-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, #4ade80 0%, #10b981 50%, #047857 100%);
  box-shadow: 
    0 10px 0 #065f46,
    0 22px 38px rgba(16, 185, 129, 0.55),
    inset 0 2px 4px rgba(255, 255, 255, 0.7);
}

.kb-game-cta-btn:active {
  transform: translateY(6px);
  box-shadow: 
    0 2px 0 #065f46,
    0 6px 14px rgba(16, 185, 129, 0.3),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

@keyframes kb-btn-pulse {
  0%, 100% {
    box-shadow: 0 8px 0 #065f46, 0 16px 30px rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 8px 0 #065f46, 0 20px 42px rgba(16, 185, 129, 0.6);
  }
}

/* ==================== 3. CATEGORY SELECTION ==================== */
.kb-category-container {
  margin: 3rem 0;
  display: none;
}

.kb-category-container.active {
  display: block;
}

.kb-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.kb-category-card {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  text-align: left;
}

.kb-category-card:hover {
  border-color: var(--kb-emerald);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(16, 185, 129, 0.12);
}

.kb-category-card.selected {
  border-color: var(--kb-emerald);
  background: #F0FDF4;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.kb-category-icon {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #FAF6EE;
  border: 1px solid #DCC28D;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1.25rem;
  transition: transform 0.2s ease;
}

.kb-category-card:hover .kb-category-icon {
  transform: scale(1.1) rotate(4deg);
}

.kb-category-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
}

.kb-category-desc {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.kb-category-action {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--kb-emerald-dark);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ==================== 4. STEP-BY-STEP WIZARD ==================== */
.kb-wizard-container {
  display: none;
  margin: 2.5rem 0 6rem;
}

.kb-wizard-container.active {
  display: block;
}

/* Wizard Header with Progress Indicator */
.kb-wizard-header {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 16px rgba(59, 40, 27, 0.04);
  margin-bottom: 1.75rem;
}

.kb-wizard-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.kb-domain-pill {
  background: #FAF6EE;
  border: 1px solid #DCC28D;
  color: var(--board);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.kb-step-counter {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.kb-step-counter span.highlight {
  color: var(--kb-emerald-dark);
}

.kb-reset-btn {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.kb-reset-btn:hover {
  background: #fee2e2;
}

/* ==================== Interactive Numbered Stepper (Supports 10+ steps) ==================== */
.kb-stepper-wrap {
  width: 100%;
  margin-top: 0.85rem;
  position: relative;
}

.kb-stepper-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.5rem 0.25rem 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.kb-stepper-scroll::-webkit-scrollbar {
  display: none;
}

.kb-stepper-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}

/* Background Connecting Track Line */
.kb-stepper-track-bg {
  position: absolute;
  top: 17px;
  left: 17px;
  right: 17px;
  height: 4px;
  background: #E8DFC8;
  border-radius: 99px;
  z-index: 1;
  overflow: hidden;
}

/* Dynamic Gradient Progress Fill */
.kb-stepper-track-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981 0%, #059669 100%);
  border-radius: 99px;
  width: 0%;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* Nodes Container */
.kb-stepper-nodes {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  z-index: 2;
  gap: 0.5rem;
}

/* Individual Stepper Item */
.kb-stepper-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  min-width: 44px;
  padding: 0 2px;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.kb-stepper-item:hover {
  transform: translateY(-2px);
}

.kb-stepper-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

/* 1. Completed Step Node */
.kb-stepper-item.is-completed .kb-stepper-circle {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #ffffff;
  border: 2px solid #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.kb-stepper-item.is-completed:hover .kb-stepper-circle {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  transform: scale(1.05);
}

.kb-step-check {
  font-weight: 800;
  font-size: 0.95rem;
}

/* 2. Active Step Node (Current Step) */
.kb-stepper-item.is-active {
  transform: translateY(-2px);
}

.kb-stepper-item.is-active .kb-stepper-circle {
  background: #ffffff;
  color: var(--kb-emerald-dark);
  border: 3px solid var(--kb-emerald);
  font-size: 0.95rem;
  font-weight: 900;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.22), 0 4px 14px rgba(16, 185, 129, 0.35);
  animation: kbPulseRing 2s infinite ease-in-out;
}

@keyframes kbPulseRing {
  0% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), 0 4px 12px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.15), 0 6px 16px rgba(16, 185, 129, 0.45);
  }
  100% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25), 0 4px 12px rgba(16, 185, 129, 0.3);
  }
}

/* 3. Upcoming Step Node */
.kb-stepper-item.is-upcoming .kb-stepper-circle {
  background: #FAF8F5;
  color: #8C7A6B;
  border: 2px solid #E8DFC8;
}

.kb-stepper-item.is-upcoming:hover .kb-stepper-circle {
  border-color: #DCC28D;
  color: var(--ink);
  background: #FFFDF9;
}

/* Step Label beneath the circle */
.kb-stepper-label {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s, font-weight 0.2s;
}

.kb-stepper-item.is-active .kb-stepper-label {
  color: var(--kb-emerald-dark);
  font-weight: 800;
}

.kb-stepper-item.is-completed .kb-stepper-label {
  color: var(--ink);
}

/* Multi-step mode (Handles up to 10+ steps elegantly) */
.kb-stepper-wrap.is-many-steps .kb-stepper-inner {
  min-width: max-content;
  gap: 1.15rem;
  padding: 0 0.5rem;
}

.kb-stepper-wrap.is-many-steps .kb-stepper-label {
  max-width: 70px;
  font-size: 0.68rem;
}

/* Step Toolbar & Search */
.kb-step-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.kb-step-info-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
}

.kb-step-info-desc {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Reusable Step Search Bar */
.kb-search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.45rem 0.85rem;
  min-width: 280px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-search-box:focus-within {
  border-color: var(--kb-emerald);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.kb-search-input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  margin-left: 0.5rem;
}

.kb-search-clear {
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
  display: none;
}

/* Component Cards Grid */
.kb-components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kb-comp-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.kb-comp-card:hover {
  border-color: var(--board);
  box-shadow: 0 8px 24px rgba(59, 40, 27, 0.06);
}

.kb-comp-card.is-selected {
  border-color: var(--kb-emerald);
  background: #FAFFF9;
  box-shadow: 0 0 0 2px var(--kb-emerald-glow);
}

.kb-comp-selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--kb-emerald);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  display: none;
}

.kb-comp-card.is-selected .kb-comp-selected-badge {
  display: inline-block;
}

.kb-comp-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #FAF8F5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
}

.kb-comp-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.2s ease;
}

.kb-comp-card:hover .kb-comp-img {
  transform: scale(1.05);
}

.kb-comp-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  min-height: 2.7rem;
}

.kb-comp-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--board-deep);
  margin-bottom: 0.85rem;
}

/* Quantity Controls */
.kb-qty-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 0.5rem;
}

.kb-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #FAF8F5;
  overflow: hidden;
}

.kb-stepper button {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}

.kb-stepper button:hover {
  background: #E8DFC8;
}

.kb-stepper span,
.kb-stepper input.kb-stepper-input,
.kb-stepper input[type="number"] {
  width: 38px;
  min-width: 32px;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--board, #3B281B);
  background: transparent;
  border: none;
  outline: none;
  padding: 0.15rem 0.1rem;
  font-family: inherit;
  -moz-appearance: textfield;
}

.kb-stepper input.kb-stepper-input::-webkit-outer-spin-button,
.kb-stepper input.kb-stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.kb-stepper input.kb-stepper-input:focus {
  background: #FFFFFF;
  box-shadow: inset 0 0 0 1.5px var(--accent-gold, #D4A373);
  border-radius: 4px;
}

.kb-btn-add-comp {
  background: #FAF6EE;
  border: 1.5px solid #DCC28D;
  color: var(--board);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: 1;
  text-align: center;
}

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

.kb-comp-card.is-selected .kb-btn-add-comp {
  background: var(--kb-emerald);
  border-color: var(--kb-emerald);
  color: #fff;
}

/* Navigation Controls (Back, Skip, Next) */
.kb-nav-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem 1.75rem;
  margin-top: 2rem;
  box-shadow: 0 4px 16px rgba(59, 40, 27, 0.04);
}

.kb-btn-wizard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.kb-btn-back {
  background: #FAF8F5;
  border: 1.5px solid var(--line);
  color: var(--ink);
}

.kb-btn-back:hover:not(:disabled) {
  background: #E8DFC8;
}

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

.kb-btn-skip {
  background: #fff;
  border: 1.5px dashed #94a3b8;
  color: #64748b;
  font-size: 0.9rem;
}

.kb-btn-skip:hover {
  border-color: var(--board);
  color: var(--board);
  background: #FAF6EE;
}

.kb-btn-next {
  background: linear-gradient(135deg, var(--kb-emerald), var(--kb-emerald-dark));
  color: #fff;
  box-shadow: 0 4px 14px var(--kb-emerald-glow);
}

.kb-btn-next:hover {
  background: linear-gradient(135deg, #34d399, var(--kb-emerald));
  transform: translateY(-1px);
}

/* ==================== 5. GENERAL LIVE CATALOG SEARCH STAGE ==================== */
.kb-general-search-stage {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  padding: 2rem;
  margin: 2.5rem 0;
  display: none;
}

.kb-general-search-stage.active {
  display: block;
}

/* ==================== 6. FLOATING ACTION DOCK ==================== */
.kb-floating-dock {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2.5rem);
  max-width: 980px;
  background: var(--kb-dock-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(212, 163, 115, 0.45);
  border-radius: 20px;
  padding: 0.85rem 1.6rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: 0 16px 36px rgba(59, 40, 27, 0.15), 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 900;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.kb-floating-dock:not(.is-visible) {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 30px);
}

/* Left: Order Price Only (Req 2) */
.kb-dock-left {
  display: flex;
  align-items: center;
  min-width: 130px;
  flex-shrink: 0;
}

.kb-dock-price-wrap {
  display: flex;
  flex-direction: column;
}

.kb-dock-price-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.kb-dock-price-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--board-deep);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* Center: Elegant Step Navigation (Req 1) */
.kb-dock-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex: 1;
}

.kb-dock-btn-nav {
  padding: 0.68rem 1.25rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: inherit;
  outline: none;
}

/* Previous / Back Step Button */
.kb-dock-btn-prev {
  background: #FFFFFF;
  border: 1.5px solid #DCC28D;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(59, 40, 27, 0.06);
}

.kb-dock-btn-prev:hover:not(:disabled) {
  background: #FAF6EE;
  border-color: var(--board);
  color: var(--board-deep);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 40, 27, 0.12);
}

.kb-dock-btn-prev:active:not(:disabled) {
  transform: translateY(0);
}

.kb-dock-btn-prev:disabled,
.kb-dock-btn-prev.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #E8DFC8;
  background: #F5EFEB;
  transform: none !important;
  box-shadow: none !important;
}

/* Next / Forward Step Button */
.kb-dock-btn-next {
  background: linear-gradient(135deg, #3B281B, #241F21);
  border: 1.5px solid #241F21;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 40, 27, 0.22);
}

.kb-dock-btn-next:hover:not(:disabled) {
  background: linear-gradient(135deg, #533b28, #3B281B);
  border-color: #3B281B;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(59, 40, 27, 0.35);
}

.kb-dock-btn-next:active:not(:disabled) {
  transform: translateY(0);
}

.kb-dock-btn-next:disabled,
.kb-dock-btn-next.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Right: Review Kit (Req 3) */
.kb-dock-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 130px;
  flex-shrink: 0;
}

.kb-dock-btn-review {
  background: linear-gradient(135deg, var(--kb-emerald), var(--kb-emerald-dark));
  color: #fff;
  border: none;
  padding: 0.72rem 1.45rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px var(--kb-emerald-glow);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  font-family: inherit;
}

.kb-dock-btn-review:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.kb-dock-btn-review:active {
  transform: translateY(0);
}

/* ==================== 7. KIT SUMMARY MODAL ==================== */
.kb-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 20, 21, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.kb-modal-overlay.open {
  display: flex;
}

.kb-summary-modal-box {
  background: #fff;
  border-radius: 24px;
  max-width: 860px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.4);
  border: 1.5px solid var(--line);
  animation: kb-modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes kb-modal-pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.kb-modal-header {
  padding: 1.25rem 1.75rem;
  background: var(--board);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kb-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kb-modal-close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.kb-modal-body {
  padding: 1.5rem 1.75rem;
  overflow-y: auto;
  flex: 1;
}

.kb-multiplier-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAF8F5;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.kb-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.kb-summary-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1.5px solid #e2e8f0;
}

.kb-summary-table td {
  padding: 0.85rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  vertical-align: middle;
}

.kb-summary-footer {
  padding: 1.25rem 1.75rem;
  background: #FAF8F5;
  border-top: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==================== MOBILE RESPONSIVE OPTIMIZATION (Req 8) ==================== */
@media (max-width: 768px) {
  .kb-hero-section {
    padding: 1.5rem 0 1rem;
  }
  .kb-main-title {
    font-size: 1.7rem;
  }
  .kb-start-banner {
    padding: 1.75rem 1rem;
    margin: 1.75rem 0;
  }
  .kb-start-banner h2 {
    font-size: 1.6rem;
  }
  .kb-game-cta-btn {
    padding: 0.9rem 1.5rem;
    font-size: 1.05rem;
    width: 100%;
  }

  /* Compact Multi-Card Mobile Prebuilt Carousel */
  .kb-prebuilt-card {
    flex: 0 0 185px !important;
    border-radius: 12px !important;
  }
  .kb-prebuilt-thumb {
    padding: 0.5rem !important;
    aspect-ratio: 16 / 12 !important;
  }
  .kb-prebuilt-body {
    padding: 0.65rem !important;
    gap: 0.25rem !important;
  }
  .kb-prebuilt-title {
    font-size: 0.85rem !important;
  }
  .kb-prebuilt-desc {
    font-size: 0.72rem !important;
  }
  .kb-prebuilt-summary-box {
    display: none !important;
  }
  .kb-prebuilt-price {
    font-size: 0.95rem !important;
  }
  .kb-btn-add-prebuilt {
    padding: 0.35rem 0.55rem !important;
    font-size: 0.72rem !important;
  }
  .kb-btn-add-prebuilt svg {
    width: 13px !important;
    height: 13px !important;
  }

  /* Kit Builder: Hide mobile bottom-nav so wizard floating dock has clean prominence without double-bottom bars */
  .bottom-nav {
    display: none !important;
  }

  /* WhatsApp button in kit-builder sits cleanly above the floating action dock */
  .floating-wa {
    bottom: 130px !important;
    left: 14px !important;
    z-index: 9999 !important;
  }

  /* Compact Uncluttered Mobile Floating Dock */
  .kb-floating-dock {
    width: calc(100% - 1rem);
    padding: 0.65rem 0.85rem;
    bottom: 0.5rem;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "left right"
      "center center";
    gap: 0.55rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .kb-dock-left {
    grid-area: left;
    min-width: 0;
    align-items: center;
  }
  .kb-dock-price-label {
    font-size: 0.65rem;
  }
  .kb-dock-price-val {
    font-size: 1.25rem;
  }
  .kb-dock-right {
    grid-area: right;
    min-width: 0;
  }
  .kb-dock-btn-review {
    padding: 0.55rem 0.95rem;
    font-size: 0.85rem;
    border-radius: 10px;
  }
  .kb-dock-center {
    grid-area: center;
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .kb-dock-btn-nav {
    flex: 1;
    padding: 0.6rem 0.65rem;
    font-size: 0.82rem;
    justify-content: center;
    border-radius: 10px;
  }

  /* Wizard Step Mobile Cleanup */
  .kb-wizard-container {
    padding: 1.25rem 1rem;
    margin-bottom: 6.5rem; /* prevent dock overlap */
  }
  .kb-wizard-header {
    margin-bottom: 1.25rem;
  }
  .kb-wizard-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .kb-step-counter {
    font-size: 1.05rem;
  }
  .kb-stepper-inner {
    min-width: max-content;
    gap: 0.85rem;
    padding: 0 0.5rem;
  }
  .kb-stepper-circle {
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }
  .kb-stepper-track-bg {
    top: 15px;
    left: 15px;
    right: 15px;
  }
  .kb-stepper-label {
    max-width: 58px;
    font-size: 0.65rem;
  }
  .kb-step-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }
  .kb-search-box {
    min-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* 2-Column Responsive Component Grid */
  .kb-components-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.75rem;
  }
  .kb-comp-card {
    padding: 0.75rem;
    border-radius: 14px;
  }
  .kb-comp-name {
    font-size: 0.82rem;
    min-height: 2.2rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
  }
  .kb-comp-price {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
  }
  .kb-qty-control {
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
  }
  .kb-stepper {
    width: 100%;
    justify-content: space-between;
  }
  .kb-stepper button {
    width: 28px;
    height: 28px;
    font-size: 1rem;
  }
  .kb-stepper span,
  .kb-stepper input.kb-stepper-input {
    width: auto;
    flex: 1;
    font-size: 0.88rem;
    min-width: 28px;
  }
  .kb-btn-add-comp {
    width: 100%;
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
  }

  /* Nav Controls */
  .kb-nav-controls-bar {
    padding: 0.85rem 1rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-radius: 14px;
  }
  .kb-btn-wizard {
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    flex: 1;
    justify-content: center;
  }
  .kb-btn-skip {
    flex-basis: 100%;
    order: 3;
    padding: 0.45rem;
  }

  /* Summary Modal Mobile Optimization */
  .kb-summary-modal-box {
    max-height: 94vh;
    border-radius: 18px;
  }
  .kb-modal-header {
    padding: 1rem 1.25rem;
  }
  .kb-modal-header h3 {
    font-size: 1.05rem;
  }
  .kb-modal-body {
    padding: 1rem;
  }
  .kb-summary-table th,
  .kb-summary-table td {
    padding: 0.65rem 0.35rem;
    font-size: 0.82rem;
  }
  .kb-summary-footer {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .kb-summary-footer > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .kb-summary-footer > div:last-child {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }
  .kb-summary-footer button {
    width: 100%;
  }

  .kb-general-search-stage {
    padding: 1.25rem 1rem;
    margin-bottom: 6.5rem;
  }
}

@media (max-width: 480px) {
  .kb-components-grid {
    grid-template-columns: 1fr;
  }
  .kb-dock-actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================================================
   Mobile Floating Cart & WhatsApp Relocation for Kit Builder
   Prevents overlapping with the bottom kit navigation dock
   ========================================================= */
@media (max-width: 768px) {
  #openBottomCart,
  .floating-mobile-cart-btn {
    position: fixed !important;
    top: 66px !important;
    right: 14px !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    padding: 0.45rem 1rem !important;
    font-size: 0.88rem !important;
    border-radius: 999px !important;
    background: rgba(22, 14, 9, 0.94) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1.5px solid rgba(220, 194, 141, 0.6) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    z-index: 99999 !important;
  }

  #openBottomCart:active,
  .floating-mobile-cart-btn:active {
    transform: scale(0.96) !important;
  }

  .floating-wa {
    bottom: 112px !important;
    left: 14px !important;
  }
}
