/**
 * Wizard Module CSS
 * Styles specific to product finder wizard
 * v8.0 - Updated with floating card overlap effect
 */

/* ============================================
   WIZARD CONTAINER - FLOATING OVERLAP EFFECT
   ============================================ */

.lp-content .lp-wizard-section {
  background: var(--lp-bg); /* Remove background to allow overlap */
  padding: 0 0 var(--lp-spacing-2xl) 0;
  margin-top: -100px; /* Negative margin to pull wizard up and overlap hero */
  position: relative;
  z-index: 10; /* Ensure wizard floats above hero */
}

/* Floating decorative image - peeks from top of card (configured in wizard JSON) */
.lp-content .wizard-floating-image {
  position: absolute;
  top: -300px; /* Extends up above the card */
  left: 0;
  right: 0;
  height: 300px; /* Height of floating image */
  background-repeat: no-repeat;
  background-position: center top;
  background-size: contain; /* Keeps aspect ratio, fits within container */
  pointer-events: none;
  z-index: 5; /* Behind the floating card */
}

/* Floating card wrapper - creates the elevated white card effect */
.lp-content .wizard-floating-card {
  background: var(--lp-border-light);
  border-radius: var(--lp-radius-2xl, 1.5rem);
  padding: var(--lp-spacing-2xl, 3rem) var(--lp-spacing-xl, 2rem);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 10; /* Above antennas */
}

/* Center-aligned headers within wizard */
.lp-content .lp-wizard-section .section-title {
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--lp-text-dark);
  margin-bottom: 0.5rem;
  border-radius: 100px;
}

.lp-content .lp-wizard-section .section-subtitle {
  text-align: center;
  font-size: 1rem;
  color: var(--lp-text-muted);
  margin-bottom: var(--lp-spacing-lg);
}

/* Legacy finder-wizard class support */
.lp-content .finder-wizard {
  background: var(--lp-card);
  border: 1px solid var(--lp-border);
  border-radius: var(--lp-radius-2xl);
  padding: var(--lp-spacing-xl);
  margin-bottom: var(--lp-spacing-xl);
  box-shadow: var(--lp-shadow-lg);
}

/* ============================================
   WIZARD HEADER
   ============================================ */

.lp-content .wizard-header {
  text-align: center;
  margin-bottom: var(--lp-spacing-lg);
  padding-bottom: var(--lp-spacing-lg);
  border-bottom: 2px solid var(--lp-border-light);
}

.lp-content .wizard-header h3 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--lp-text-dark);
  margin-bottom: 0.5rem;
}

.lp-content .wizard-header p {
  font-size: 1rem;
  color: var(--lp-text-muted);
}

/* ============================================
   WIZARD BREADCRUMB NAVIGATION
   ============================================ */

.lp-content .wizard-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0 1rem 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--lp-text-muted);
  border-bottom: 1px solid var(--lp-border-light);
  justify-content: center;
}

.lp-content .wizard-breadcrumb .crumb {
  color: var(--lp-text);
  font-weight: 500;
}

.lp-content .wizard-breadcrumb .crumb.link {
  color: var(--lp-brand);
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.lp-content .wizard-breadcrumb .crumb.link:hover {
  color: var(--lp-brand-dark);
}

.lp-content .wizard-breadcrumb .sep {
  color: var(--lp-muted);
  font-weight: 300;
}

/* ============================================
   WIZARD PROGRESS BAR (default)
   ============================================ */

.lp-content .wizard-progress {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--lp-spacing-lg);
}

.lp-content .wizard-progress-step {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--lp-radius-full);
  background: var(--lp-border-light);
  color: var(--lp-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.lp-content .wizard-progress-step.active {
  background: var(--lp-brand);
  color: var(--lp-text-light);
  box-shadow: 0 0 0 4px rgba(207, 28, 60, 0.1);
  transform: scale(1.1);
}

.lp-content .wizard-progress-step.completed {
  background: var(--lp-success);
  color: var(--lp-text-light);
}

.lp-content .wizard-progress-line {
  width: 3rem;
  height: 2px;
  background: var(--lp-border);
  transition: all 0.3s ease;
}

.lp-content .wizard-progress-line.completed {
  background: var(--lp-success);
}

/* ============================================
   PROGRESS BAR LAYOUT
   ============================================ */

.lp-content .wizard-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--lp-border-light);
  border-radius: var(--lp-radius-full);
  overflow: hidden;
  margin-bottom: var(--lp-spacing-md);
}

.lp-content .wizard-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lp-brand), var(--lp-brand-dark));
  border-radius: var(--lp-radius-full);
  transition: width 0.4s ease;
}

.lp-content .wizard-progress-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: var(--lp-spacing-lg);
}

/* ============================================
   CARD STEPS LAYOUT
   ============================================ */

.lp-content .wizard-card-steps-indicator {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: var(--lp-spacing-lg);
  flex-wrap: wrap;
}

.lp-content .wizard-card-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--lp-bg-light);
  border: 2px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  min-width: 120px;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.lp-content .wizard-card-step.active {
  background: var(--lp-brand);
  border-color: var(--lp-brand);
  opacity: 1;
  transform: scale(1.05);
  box-shadow: var(--lp-shadow-md);
}

.lp-content .wizard-card-step.active .wizard-card-step-number,
.lp-content .wizard-card-step.active .wizard-card-step-title {
  color: var(--lp-text-light);
}

.lp-content .wizard-card-step.completed {
  opacity: 1;
  background: var(--lp-success-light);
  border-color: var(--lp-success);
}

.lp-content .wizard-card-step-number {
  width: 2rem;
  height: 2rem;
  border-radius: var(--lp-radius-full);
  background: var(--lp-border);
  color: var(--lp-text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.lp-content .wizard-card-step-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lp-text);
  text-align: center;
}

/* ============================================
   TIMELINE LAYOUT
   ============================================ */

.lp-content .wizard-timeline-indicator {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: var(--lp-spacing-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.lp-content .wizard-timeline-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--lp-bg-light);
  border: 2px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  transition: all 0.3s ease;
  opacity: 0.5;
  position: relative;
}

.lp-content .wizard-timeline-item::before {
  content: '';
  position: absolute;
  left: 1.5rem;
  top: 100%;
  width: 2px;
  height: 1rem;
  background: var(--lp-border);
}

.lp-content .wizard-timeline-item:last-child::before {
  display: none;
}

.lp-content .wizard-timeline-item.active {
  opacity: 1;
  background: var(--lp-brand);
  border-color: var(--lp-brand);
  transform: translateX(8px);
}

.lp-content .wizard-timeline-item.active .wizard-timeline-marker,
.lp-content .wizard-timeline-item.active .wizard-timeline-content {
  color: var(--lp-text-light);
}

.lp-content .wizard-timeline-item.completed {
  opacity: 1;
  background: var(--lp-success-light);
  border-color: var(--lp-success);
}

.lp-content .wizard-timeline-marker {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--lp-radius-full);
  background: var(--lp-border);
  color: var(--lp-text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.lp-content .wizard-timeline-content {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--lp-text);
}

/* ============================================
   WIZARD STEPS
   ============================================ */

.lp-content .wizard-step {
  display: none;
  animation: fadeInUp 0.4s ease;
}

.lp-content .wizard-step.active {
  display: block;
}
.lp-content .wizard-step-title-wrap{
  
}
.lp-content .wizard-step-title {
  text-align: center;
}
.lp-content .wizard-step-title > p{
  font-size: 1.5rem;
  font-weight: 700;
  display: inline-block;
  background: var(--lp-green-text);
  color: var(--lp-bg-light);
  padding: 10px 20px;
  border-radius: 100px;
}
.lp-content .wizard-step-title span{
  display: inline-block;
  padding: 10px;
}
.lp-content .wizard-step-title span:first-child{
    background: var(--lp-brand);
    color: #FFF;
    border-radius: 5px;
}
.lp-content .wizard-step-title span:last-child{
    background: rgba(0 0 0 / 5%);
    border-radius: 5px;
}
.lp-content .wizard-step-description {
  font-size: 1rem;
  color: var(--lp-text-muted);
  margin-bottom: var(--lp-spacing-lg);
  text-align: center;
}

/* ============================================
   WIZARD OPTIONS GRID
   ============================================ */

.lp-content .wizard-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: var(--lp-spacing-md);
}

.lp-content .wizard-options-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lp-content .wizard-option {
  background: var(--lp-bg-light);
  border: 2px solid var(--lp-border);
  border-radius: var(--lp-radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.lp-content .wizard-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--lp-gradient-primary);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.lp-content .wizard-option:hover {
  border-color: var(--lp-brand);
  transform: translateY(-4px);
  box-shadow: var(--lp-shadow-md);
}

.lp-content .wizard-option.selected {
  background: var(--lp-brand);
  border-color: var(--lp-brand);
  color: var(--lp-text-light);
}

.lp-content .wizard-option.selected::before {
  display: none;
}

.lp-content .wizard-option-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  position: relative;
  z-index: 1;
}

/* Icon variations - emoji vs image */
.lp-content .wizard-option-icon-emoji {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  display: block;
  position: relative;
  z-index: 1;
  line-height: 1;
}

.lp-content .wizard-option-icon-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  display: block;
  position: relative;
  z-index: 1;
}

.lp-content .wizard-option-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--lp-text-dark);
  position: relative;
  z-index: 1;
  transition: color 0.2s ease;
}

.lp-content .wizard-option.selected .wizard-option-label {
  color: var(--lp-text-light);
}

.lp-content .wizard-option-sublabel {
  font-size: 0.875rem;
  color: var(--lp-text-muted);
  margin-top: 0.25rem;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease;
}

.lp-content .wizard-option.selected .wizard-option-sublabel {
  color: rgba(255, 255, 255, 0.85);
}

.lp-content .wizard-option-description {
  font-size: 0.875rem;
  color: var(--lp-text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease;
}

.lp-content .wizard-option.selected .wizard-option-description {
  color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   WIZARD LOADING STATES
   ============================================ */

.lp-content .wizard-option.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.lp-content .wizard-option-loading {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border: 3px solid var(--lp-border);
  border-top-color: var(--lp-brand);
  border-radius: 50%;
  animation: spinCentered 0.8s linear infinite;
}

.lp-content .wizard-option.loading .wizard-option-loading {
  display: block;
}

.lp-content .wizard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--lp-spacing-xl);
}

.lp-content .wizard-loading-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid var(--lp-border);
  border-top-color: var(--lp-brand);
  border-radius: var(--lp-radius-full);
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

/* ============================================
   WIZARD NAVIGATION
   ============================================ */

.lp-content .wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--lp-spacing-lg);
  padding-top: var(--lp-spacing-lg);
  border-top: 2px solid var(--lp-border-light);
  gap: 1rem;
}

.lp-content .wizard-nav .btn {
  padding: 0.75rem 1.5rem;
  min-width: 120px;
}

/* ============================================
   WIZARD RESULTS
   ============================================ */

.lp-content .wizard-results {
  margin-top: var(--lp-spacing-lg);
  padding: var(--lp-spacing-lg);
  background: var(--lp-bg-section);
  border-radius: var(--lp-radius-xl);
  border: 2px dashed var(--lp-border);
}

.lp-content .wizard-results-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lp-text-dark);
  margin-bottom: 1rem;
  text-align: center;
}

/* ============================================
   WIZARD PRODUCT HIGHLIGHTS & LAYOUTS
   ============================================ */

/* Variant Card - Base Styles */
.lp-content .variant-card {
  background: var(--lp-card);
  border: 2px solid var(--lp-border);
  border-radius: 12px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.lp-content .variant-card:hover {
  box-shadow: var(--lp-shadow-lg);
  transform: translateY(-4px);
}

.lp-content .variant-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: var(--lp-bg-light);
  border-bottom: 1px solid var(--lp-border-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lp-content .variant-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
}

.lp-content .variant-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lp-content .variant-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--lp-text-dark);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
  /* Limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product highlights/bullets - constrained */
.lp-content .variant-info .lp-bullets-compact {
  margin: 0.75rem 0 0.75rem 1.25rem;
  padding: 0;
  list-style: disc;
  /* Limit height to prevent card from getting too tall */
  max-height: 90px;
  overflow: hidden;
}

.lp-content .variant-info .lp-bullets-compact li {
  margin: 4px 0;
  font-size: 0.875rem;
  color: var(--lp-text);
  line-height: 1.4;
  /* Limit each bullet to 2 lines max */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product description - constrained */
.lp-content .variant-info .lp-desc {
  font-size: 0.9rem;
  color: var(--lp-text-muted);
  line-height: 1.5;
  margin: 0.5rem 0;
  /* Limit to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Per-Product Highlight Banner */
.lp-content .wizard-product-highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  margin-bottom: 0;
}

/* Wizard Product Wrapper - contains highlight + card */
.lp-content .wizard-product-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.lp-content .wizard-product-wrapper .variant-card {
  border-radius: 0 0 12px 12px; /* Round only bottom corners when highlight present */
  margin-top: 0;
}

.lp-content .wizard-product-wrapper:not(:has(.wizard-product-highlight)) .variant-card {
  border-radius: 12px; /* Full rounding when no highlight */
}

/* Grid Layout (default) - 3 columns on desktop, responsive on smaller screens */
.lp-content .variants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: var(--lp-spacing-lg);
}

/* Row Layout - single column, wider cards */
.lp-content .variants-row {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: var(--lp-spacing-lg);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.lp-content .variants-row .variant-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  text-align: left;
}

.lp-content .variants-row .variant-image {
  width: 100%;
  height: auto;
}

.lp-content .variants-row .variant-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinCentered {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  /* Reduce overlap on mobile */
  .lp-content .lp-wizard-section {
    margin-top: -60px;
  }
  
  /* Hide floating decorative image on mobile */
  .lp-content .wizard-floating-image {
    display: none;
  }
  
  .lp-content .wizard-floating-card {
    padding: var(--lp-spacing-lg) var(--lp-spacing-md);
  }
  
  .lp-content .finder-wizard {
    padding: var(--lp-spacing-lg);
  }
  
  .lp-content .wizard-options {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
  }
  
  .lp-content .wizard-option {
    padding: 1.25rem 0.75rem;
  }
  
  .lp-content .wizard-option-icon,
  .lp-content .wizard-option-icon-emoji {
    font-size: 2rem;
  }
  
  .lp-content .wizard-option-icon-img {
    width: 50px;
    height: 50px;
  }
  
  .lp-content .wizard-nav {
    flex-direction: column-reverse;
  }
  
  .lp-content .wizard-nav .btn {
    width: 100%;
  }
  
  .lp-content .wizard-breadcrumb {
    font-size: 0.8rem;
    gap: 0.25rem;
  }
  
  .lp-content .wizard-breadcrumb .sep {
    display: none;
  }
  
  .lp-content .wizard-breadcrumb .crumb::after {
    content: ' /';
    color: var(--lp-muted);
    margin-left: 0.25rem;
  }
  
  .lp-content .wizard-breadcrumb .crumb:last-child::after {
    content: '';
  }
  
  .lp-content .wizard-card-steps-indicator,
  .lp-content .wizard-timeline-indicator {
    padding: 0 1rem;
  }
  
  .lp-content .wizard-card-step {
    min-width: 100px;
    padding: 0.75rem;
  }
  
  /* Product results responsive */
  .lp-content .variants-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .lp-content .variants-row .variant-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .lp-content .wizard-product-highlight {
    font-size: 12px;
    padding: 10px 15px;
  }
}

@media (max-width: 480px) {
  /* Further reduce overlap on small mobile */
  .lp-content .lp-wizard-section {
    margin-top: -40px;
  }
  
  .lp-content .wizard-options {
    grid-template-columns: 1fr;
  }
  
  .lp-content .wizard-card-steps-indicator {
    flex-direction: column;
  }
  
  .lp-content .wizard-card-step {
    width: 100%;
  }
  
  /* Adjust product cards for very small screens */
  .lp-content .variant-image {
    height: 180px;
  }
  
  .lp-content .variant-info {
    padding: 1rem;
  }
  
  .lp-content .variant-info h3 {
    font-size: 1rem;
  }
  
  .lp-content .variant-info .lp-bullets-compact {
    font-size: 0.8rem;
    max-height: 80px;
  }
  
  .lp-content .wizard-product-highlight {
    font-size: 11px;
    padding: 8px 12px;
  }
}