/* Custom Builder layout */
.builder-section { padding: 40px 0 80px; }
/* Revert to side-by-side layout: preview (left) + configuration (right) */
.builder-grid { display:grid; grid-template-columns: minmax(520px, 1.2fr) 0.8fr; gap:36px; align-items:start; }
/* Stack on narrow screens */
@media (max-width: 980px) {
  .builder-grid { grid-template-columns: 1fr; }
  .preview-column { order:0; }
  .config-column { order:1; }
}
.preview-card {
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.preview-card { position:relative; min-height:500px; margin-left:-12px; }
/* Slightly smaller overall + shifted left */
.preview-card img { width:100%; height:auto; max-height:680px; object-fit:contain; object-position:center center; background:#f5f5f5; padding:12px 16px 12px 8px; display:block; }
.preview-card .summary-second-image { margin-top:10px; border-radius:10px; }
.preview-card::after { content:""; position:absolute; inset:0; pointer-events:none; border-radius:10px; box-shadow:inset 0 0 0 1px #eee; }
/* .preview-notes removed per user request */

.config-column h2 { margin-bottom: 10px; }
.config-list { background: transparent; border: 0; padding: 0; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.part-card { background: #fff; border: 1px solid #eaeaea; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); padding: 14px; }
.part-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.part-title { font-weight: 700; font-size: 1rem; }
.part-select { width: 100%; padding: 8px; border-radius: 8px; border: 1px solid #ddd; }
.part-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.part-price { color: #111; font-weight: 600; font-size: .95rem; }
.info-toggle { background: #f5f5f5; color: #333; border: 1px solid #e2e2e2; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: .85rem; }
.info-panel { border-top: 1px solid #f0f0f0; margin-top: 10px; padding-top: 8px; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.info-panel.open { max-height: 400px; }
.info-desc { color: #444; font-size: .9rem; margin-bottom: 6px; }
.info-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: .85rem; color: #333; }
.info-stat { background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 6px 8px; }

.selected-summary { margin-top: 20px; }
.selected-items { border: 1px solid #eee; border-radius: 10px; padding: 12px 14px; background: #fff; min-height: 120px; }
.selected-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #eee; }
.selected-item:last-child { border-bottom: 0; }

.totals { margin-top: 18px; padding: 12px 14px; background: #fff; border: 1px solid #eaeaea; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.totals .row { display: flex; justify-content: space-between; padding: 6px 0; }
.totals .grand { font-weight: 800; font-size: 1.1rem; }

.builder-ctas { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.primary-btn { background: #333; color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; border: none; cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease; }
.primary-btn:active { transform: scale(0.97); background: #222; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }
.secondary-btn { background: #f5f5f5; color: #111; padding: 10px 14px; border-radius: 8px; text-decoration: none; border: none; cursor: pointer; transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease; }
.secondary-btn:active { transform: scale(0.97); background: #e8e8e8; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }

@media (max-width: 980px) {
  .builder-grid { grid-template-columns: 1fr; }
}

/* Wizard */
.wizard-progress { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 16px; }
.wizard-progress .wp-step { flex:1 1 auto; min-width:80px; position:relative; background:#f3f3f3; color:#555; padding:6px 8px; border-radius:6px; font-size:.78rem; font-weight:800; text-transform:uppercase; letter-spacing:.5px; text-align:center; }
.wizard-progress .wp-step.active { background:#333; color:#fff; }
.wizard-progress .wp-step.completed { background:#666; color:#fff; }

.wizard-steps { position:relative; }
.wizard-step { display:none; animation: fadeIn .25s ease; background:#fff; border:1px solid #eaeaea; border-radius:14px; padding:18px 18px 22px; margin-bottom:16px; box-shadow:0 1px 3px rgba(0,0,0,.06); }
.wizard-step.active { display:block; }
.wizard-step h3 { margin:0 0 14px; font-size:1.05rem; }

.wizard-options { display:grid; gap:10px; }
.wizard-option { border:1px solid #dcdcdc; border-radius:10px; padding:10px 12px; background:#f7f7f7; display:flex; align-items:center; gap:12px; cursor:pointer; position:relative; transition: all 0.2s ease; }
.wizard-option input { margin:0; }
.wizard-option:hover { background:#ededed; border-color:#c8c8c8; }
.wizard-option.selected { border:3px solid #6610f2; background:#f0e7ff; box-shadow: 0 4px 12px rgba(102, 16, 242, 0.25); }
.wo-main { flex:1 1 auto; }
.wo-main { flex:1 1 auto; display:grid; grid-template-columns:1fr 1fr auto; align-items:center; column-gap:14px; }
.wo-title { font-weight:700; font-size:1rem; letter-spacing:.3px; }
.wo-price { font-weight:700; color:#111; font-size:1.05rem; white-space:nowrap; justify-self:center; text-align:center; }
.wo-more { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:6px; border:1px solid transparent; background:transparent; cursor:pointer; transition:.18s ease; font-size:.6rem; font-weight:700; letter-spacing:.5px; text-transform:uppercase; }
.wo-more:hover { background:#e5e5e5; }
.wo-more:active { transform:scale(.96); }
.wo-more svg { width:14px; height:14px; stroke:#333; stroke-width:2.2; fill:none; }
.wo-more-text { display:inline-block; }

/* Off-canvas detail panel */
.option-detail-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.35); backdrop-filter:blur(2px); z-index:2000; opacity:0; pointer-events:none; transition:opacity .25s ease; }
.option-detail-backdrop.show { opacity:1; pointer-events:auto; }
.option-detail-panel { position:fixed; top:0; right:0; width:700px; max-width:98%; height:64%; margin-top:62px; border-top-left-radius:20px; border-bottom-left-radius:20px; background:#fff; box-shadow: -8px 0 34px -12px rgba(0,0,0,.4),0 6px 18px -6px rgba(0,0,0,.22); z-index:2001; transform:translateX(100%); transition:transform .75s cubic-bezier(.28,.03,.22,1); display:flex; flex-direction:column; overflow:hidden; }
.option-detail-panel.open { transform:translateX(0); }
.odp-head { padding:18px 20px 12px; border-bottom:1px solid #eee; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.odp-head h4 { margin:0; font-size:1.05rem; letter-spacing:.5px; }
.odp-close { background:transparent; border:0; cursor:pointer; padding:6px; border-radius:6px; }
.odp-close:hover { background:#f0f0f0; }
.odp-body { padding:18px 22px 70px; overflow-y:auto; font-size:.87rem; line-height:1.5; }
.option-detail-panel .odp-img-wrap { width:100%; max-width:480px; max-height:360px; overflow:visible; border-radius:10px; margin:0 auto 16px; background:#fff; display:flex; align-items:center; justify-content:center; position:relative; padding:0; }
.option-detail-panel .odp-img-wrap.odp-img-carousel { display:flex; }
.option-detail-panel .odp-img-track { width:100%; display:flex; align-items:center; justify-content:center; }
.option-detail-panel .odp-img-slide { display:none; width:100%; }
.option-detail-panel .odp-img-slide.active { display:flex; align-items:center; justify-content:center; }
.option-detail-panel .odp-img-nav { position:absolute; top:50%; transform:translateY(-50%); width:32px; height:48px; border:none; border-radius:999px; background:rgba(0,0,0,.45); color:#fff; font-size:1.35rem; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .2s ease; opacity:1; z-index:10; }
.option-detail-panel .odp-img-nav:hover { background:rgba(0,0,0,.65); }
.option-detail-panel .odp-img-nav.prev { left:10px; }
.option-detail-panel .odp-img-nav.next { right:10px; }
.option-detail-panel .odp-img-wrap.odp-img-carousel .odp-img { width:auto; max-width:100%; }
.option-detail-panel .odp-img-dots { position:absolute; bottom:10px; left:50%; transform:translateX(-50%); display:flex; gap:6px; z-index:10; }
.option-detail-panel .odp-img-dot { width:10px; height:10px; border-radius:50%; border:0; background:rgba(255,255,255,.6); cursor:pointer; padding:0; }
.option-detail-panel .odp-img-dot.active { background:#fff; }
.option-detail-panel .odp-img-dot:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.option-detail-panel .odp-img-wrap img { width:auto; height:auto; display:block; object-fit:contain; max-height:340px; max-width:100%; }
.option-detail-panel .odp-img-wrap.odp-img-bottom { 
  margin-top:18px; 
  margin-bottom:0; 
  max-height:none; /* allow full natural height within limit below */
  overflow:visible; 
  background:#fff; 
  padding:12px; 
}
.option-detail-panel .odp-img-wrap.odp-img-bottom img { 
  object-fit:contain; 
  width:auto; 
  max-width:100%; 
  max-height:300px; /* allow more presence while keeping tall images contained */
}
.odp-price { font-weight:800; font-size:1.28rem; margin:4px 0 14px; letter-spacing:.5px; }
.odp-desc { margin-bottom:14px; color:#444; }
.odp-subtitle { font-size:.72rem; font-weight:800; letter-spacing:.5px; text-transform:uppercase; margin:4px 0 10px; color:#222; }
.odp-stats { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }
.odp-stat { background:#f2f2f2; border:1px solid #ddd; font-size:.82rem; padding:6px 12px; border-radius:8px; letter-spacing:.4px; font-weight:600; }
.wo-desc { display:none !important; }
.wo-stats { display:flex; flex-wrap:wrap; gap:4px; margin-top:6px; }
.wo-stats { grid-column:1 / -1; }
.wo-stat { background:#fff; border:1px solid #d6d6d6; font-size:.6rem; padding:2px 5px; border-radius:4px; }

/* Frame Colour swatches */
.color-swatch-grid { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:12px; }
.color-swatch { display:grid; grid-template-columns: 80px 1fr; align-items: center; border:1px solid #dcdcdc; border-radius:8px; padding:0; background:#f7f7f7; cursor:pointer; overflow:hidden; min-height:72px; position:relative; transition: all 0.2s ease; }
.color-swatch:hover { background:#ededed; border-color:#c8c8c8; }
.color-swatch.selected { border:3px solid #6610f2; background:#f0e7ff; box-shadow: 0 4px 12px rgba(102, 16, 242, 0.25); transform: scale(1.02); }
.color-swatch input { display:none; }
  .color-swatch .swatch { display:block; width:100%; height:100%; border:none; border-radius:0; background-size:cover; background-position:center; }
  .color-swatch .swatch-name { font-weight:700; color:#111; padding:8px 6px 8px 6px; position:relative; font-size:0.88rem; line-height:1.25; word-wrap:break-word; overflow-wrap:break-word; hyphens:auto; }
.color-swatch.selected .swatch { box-shadow:none; }
.color-swatch.selected .swatch-name::before { content: "✓"; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); color: #6610f2; font-weight: 900; font-size: 1.1rem; }

/* Custom radio styling to remove default blue focus/checked accent (modern browsers) */
.wizard-option input[type=radio] { accent-color: #555; }
/* Fallback custom ring if accent-color unsupported */
.wizard-option input[type=radio]:checked { outline: none; }

.wizard-nav { display:flex; justify-content:space-between; gap:10px; margin:4px 0 18px; }
.wizard-nav button { flex:1 1 0; }

/* Emphasize Next button */
#next-step.primary-btn { font-size:1rem; font-weight:700; padding:14px 26px; }
.wizard-totals { margin-top:4px; }
.wizard-final-ctas { margin-top:18px; }
.wizard-final-ctas .primary-btn,
.wizard-final-ctas .secondary-btn {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 700;
}

@keyframes fadeIn { from { opacity:0; transform: translateY(4px);} to { opacity:1; transform: translateY(0);} }

.summary-list { border:1px solid #eaeaea; border-radius:12px; background:#fff; padding:14px 16px; margin:14px 0; }
.summary-row { display:flex; justify-content:space-between; padding:6px 0; border-bottom:1px dashed #eaeaea; font-size:.85rem; }
.summary-row:last-child { border-bottom:0; }

/* Bike Description in Summary */
.bike-description {
  margin-top: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.bike-description h4 {
  margin: 0 0 16px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #dee2e6;
}
.bike-description h4::before {
  content: "⚡";
  font-size: 1.1rem;
}
.bike-description p {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
}
.bike-description p:last-child {
  margin-bottom: 0;
}

/* Adjust builder page title spacing */
.page-title-banner { min-height:70px; align-items:flex-end; display:flex; }
.page-title-banner .banner-content { 
  text-align:left; 
  padding:16px 24px 6px 24px; 
  width:100%; 
  max-width:1400px; 
  margin:0 auto; 
}
.page-title-banner h1 { margin:0; line-height:1.1; }
/* Tighten space before builder grid */
.builder-section { padding-top:6px; }

/* Detail panel fallbacks */
.odp-stats-empty { font-size:.8rem; color:#666; background:#fafafa; border:1px dashed #ddd; border-radius:8px; padding:8px 10px; }
.option-detail-panel .odp-img-wrap.odp-img-placeholder { background:#fafafa; border:1px dashed #ddd; }
.option-detail-panel .odp-img-placeholder-inner { color:#777; font-size:.85rem; padding:24px 0; }

/* Loading Spinner */
.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #333;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 20px auto 10px;
}

.loading-text {
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Weight Input Styles */
.weight-input-container {
  padding: 20px;
  text-align: center;
}

.weight-instruction {
  font-size: 1rem;
  color: #333;
  margin-bottom: 24px;
  font-weight: 500;
}

.weight-input-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.weight-input {
  width: 200px;
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.weight-input:focus {
  outline: none;
  border-color: #6610f2;
  box-shadow: 0 0 0 3px rgba(102, 16, 242, 0.15);
}

.weight-input::placeholder {
  color: #999;
  font-size: 0.9rem;
}

.weight-unit-select {
  padding: 14px 16px;
  font-size: 1.1rem;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.weight-unit-select:focus {
  outline: none;
  border-color: #6610f2;
}

.weight-note {
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
  margin-top: 16px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* =============================================
   MOBILE RESPONSIVE FIXES
   ============================================= */

@media (max-width: 768px) {
  /* Color swatches - 2 columns on tablets */
  .color-swatch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  
  /* Wizard options - stack better */
  .wo-main {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  
  .wo-price {
    justify-self: start;
  }
  
  /* Smaller padding on builder section */
  .builder-section {
    padding: 20px 0 60px;
  }
  
  /* Preview card adjustments */
  .preview-card {
    min-height: 350px;
    margin-left: 0;
  }
  
  .preview-card img {
    max-height: 400px;
    padding: 8px;
  }
  
  /* Detail panel - full width on mobile */
  .option-detail-panel {
    width: 100%;
    max-width: 100%;
    height: 80%;
    margin-top: 0;
    border-radius: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    top: auto;
    bottom: 0;
    transform: translateY(100%);
    pointer-events: none; /* Prevent touch interception when off-screen on mobile */
  }
  
  .option-detail-panel.open {
    transform: translateY(0);
    pointer-events: auto; /* Re-enable interaction when panel is visible */
  }
}

@media (max-width: 480px) {
  /* Color swatches - 1 column on phones */
  .color-swatch-grid {
    grid-template-columns: 1fr;
  }
  
  /* Smaller wizard step padding */
  .wizard-step {
    padding: 14px 14px 18px;
  }
  
  .wizard-step h3 {
    font-size: 0.95rem;
  }
  
  /* Config grid - single column */
  .config-grid {
    grid-template-columns: 1fr;
  }
  
  /* Totals section */
  .totals {
    padding: 10px 12px;
  }
  
  .totals .grand {
    font-size: 1rem;
  }
  
  /* CTA buttons */
  .builder-ctas {
    flex-direction: column;
    position: relative;
    z-index: 100;
  }
  
  .primary-btn, .secondary-btn {
    width: 100%;
    text-align: center;
  }
  
  /* Ensure wizard-final-ctas buttons are touchable on mobile */
  .wizard-final-ctas {
    position: relative;
    z-index: 100;
  }
  
  .wizard-final-ctas .primary-btn,
  .wizard-final-ctas .secondary-btn {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    touch-action: manipulation;
    cursor: pointer;
  }
}
