/* ====================================
   iOptical Lab - Lens Wizard Styles
   ==================================== */

/* --- Overlay --- */
.lens-wizard-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8eef5 100%);
  overflow-y: auto;
  animation: lensWizardFadeIn 0.35s ease-out;
}

.lens-wizard-overlay.active {
  display: block;
}

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

/* --- Layout --- */
.lens-wizard {
  display: flex;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.lens-wizard-left {
  width: 38%;
  background: #fff;
  padding: 40px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-shadow: 4px 0 24px rgba(0,0,0,0.04);
}

.lens-wizard-right {
  width: 62%;
  padding: 40px 56px;
  display: flex;
  flex-direction: column;
}

/* --- Back to Frame Link --- */
.lw-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #555;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 32px;
  cursor: pointer;
  transition: color 0.2s;
}
.lw-back-link:hover { color: #222; }
.lw-back-link i { font-size: 12px; }

/* --- Left Panel Product Info --- */
.lw-product-image {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 24px;
}

.lw-product-name {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a2e;
  text-align: center;
  margin-bottom: 4px;
}

.lw-product-meta {
  font-size: 13px;
  color: #888;
  text-align: center;
  margin-bottom: 24px;
}

.lw-subtotal-bar {
  margin-top: auto;
  border-top: 1px solid #e5e9ef;
  padding-top: 20px;
}

.lw-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lw-subtotal-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.lw-subtotal-value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
}

.lw-subtotal-breakdown {
  margin-top: 8px;
  font-size: 12px;
  color: #888;
}

.lw-subtotal-breakdown div {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

/* --- Progress Bar --- */
.lw-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
  position: relative;
}

.lw-step-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #bbb;
  transition: color 0.3s;
  white-space: nowrap;
}

.lw-step-indicator.active { color: #2563eb; }
.lw-step-indicator.completed { color: #22c55e; }

.lw-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: #e5e9ef;
  color: #999;
  transition: all 0.3s;
  flex-shrink: 0;
}

.lw-step-indicator.active .lw-step-dot {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 12px rgba(37,99,235,0.3);
}

.lw-step-indicator.completed .lw-step-dot {
  background: #22c55e;
  color: #fff;
}

.lw-step-line {
  width: 60px;
  height: 2px;
  background: #e5e9ef;
  margin: 0 6px;
  transition: background 0.3s;
}

.lw-step-line.completed {
  background: #22c55e;
}

/* --- Step Content --- */
.lw-step-content {
  display: none;
  animation: lensStepSlideIn 0.3s ease-out;
  flex: 1;
}

.lw-step-content.active {
  display: block;
}

@keyframes lensStepSlideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.lw-step-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.lw-step-subtitle {
  font-size: 14px;
  color: #888;
  margin-bottom: 28px;
}

/* --- Selection Cards --- */
.lw-card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lw-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border: 2px solid #e5e9ef;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  background: #fff;
  position: relative;
}

.lw-card:hover {
  border-color: #93b4eb;
  box-shadow: 0 4px 16px rgba(37,99,235,0.08);
  transform: translateY(-1px);
}

.lw-card.selected {
  border-color: #2563eb;
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 100%);
  box-shadow: 0 4px 20px rgba(37,99,235,0.12);
}

.lw-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #555;
  flex-shrink: 0;
  transition: all 0.25s;
}

.lw-card.selected .lw-card-icon {
  background: #2563eb;
  color: #fff;
}

.lw-card-body {
  flex: 1;
}

.lw-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 2px;
}

.lw-card-desc {
  font-size: 13px;
  color: #888;
  line-height: 1.4;
}

.lw-card-price {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
}

.lw-card-price.free {
  color: #22c55e;
}

.lw-card-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.lw-card-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s;
}

.lw-card.selected .lw-card-check {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.lw-card.selected .lw-card-check::after {
  content: '\2713';
  font-size: 14px;
  font-weight: 700;
}

/* --- Prescription Form --- */
.lw-rx-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.lw-rx-form {
  display: none;
  animation: lensStepSlideIn 0.3s ease-out;
}

.lw-rx-form.active {
  display: block;
}

.lw-rx-table {
  width: 100%;
  margin-bottom: 20px;
}

.lw-rx-table th {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 6px;
  text-align: center;
}

.lw-rx-table td {
  padding: 6px;
}

.lw-rx-table .lw-rx-eye-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  padding-right: 12px;
}

.lw-rx-table select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: auto;
}

.lw-rx-table select:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.lw-rx-pd-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.lw-rx-pd-row label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.lw-rx-pd-row select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  appearance: auto;
}

.lw-rx-pd-split {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 16px;
}

.lw-rx-prism {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #555;
}

.lw-rx-notes textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 13px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.lw-rx-notes textarea:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.lw-rx-notes textarea::placeholder {
  color: #bbb;
}

/* --- Upload Area --- */
.lw-upload-area {
  border: 2px dashed #d0d5dd;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  margin-bottom: 20px;
}

.lw-upload-area:hover {
  border-color: #2563eb;
  background: #f8faff;
}

.lw-upload-area i {
  font-size: 32px;
  color: #93b4eb;
  margin-bottom: 12px;
}

.lw-upload-area p {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.lw-upload-area .lw-upload-hint {
  font-size: 12px;
  color: #aaa;
  margin-top: 4px;
}

.lw-upload-success {
  display: none;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  color: #15803d;
  font-size: 14px;
}

.lw-upload-success.active {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Navigation Buttons --- */
.lw-nav-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e9ef;
}

.lw-btn {
  padding: 14px 36px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.lw-btn-back {
  background: #fff;
  color: #555;
  border: 1px solid #ddd;
}
.lw-btn-back:hover {
  background: #f5f5f5;
  color: #333;
}

.lw-btn-skip {
  background: #fff;
  color: #888;
  border: 1px solid #ddd;
}
.lw-btn-skip:hover {
  background: #f5f5f5;
}

.lw-btn-continue {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.lw-btn-continue:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 6px 20px rgba(37,99,235,0.4);
  transform: translateY(-1px);
}

.lw-btn-cart {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
}
.lw-btn-cart:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 6px 20px rgba(245,158,11,0.4);
  transform: translateY(-1px);
}

.lw-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- Choose Lenses CTA on Product Page --- */
.btn-choose-lenses {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(245,158,11,0.3);
  width: 100%;
  justify-content: center;
}

.btn-choose-lenses:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 6px 20px rgba(245,158,11,0.4);
  transform: translateY(-1px);
}

.btn-choose-lenses i {
  font-size: 18px;
}

.btn-frame-only {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

.btn-frame-only:hover {
  border-color: #999;
  color: #333;
  background: #f9f9f9;
}

/* --- Lens badge in cart --- */
.cart-lens-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

.cart-lens-details {
  font-size: 12px;
  color: #666;
  margin-top: 4px;
  line-height: 1.6;
}

.cart-lens-rx-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ef4444;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

/* --- Footer trust badges --- */
.lw-trust-badges {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
  margin-top: auto;
  font-size: 12px;
  color: #999;
}

.lw-trust-badges span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- How to read prescription link --- */
.lw-rx-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #2563eb;
  cursor: pointer;
  margin-bottom: 20px;
  text-decoration: none;
}

.lw-rx-help:hover {
  text-decoration: underline;
}

/* --- Lens index visual icon --- */
.lw-lens-visual {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lw-lens-thickness {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #93b4eb;
  position: relative;
}

.lw-lens-thickness.thin {
  border-width: 2px;
}
.lw-lens-thickness.ultra-thin {
  border-width: 1px;
}

/* --- Package tabs (Essential / Clarity) --- */
.lw-package-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e9ef;
}

.lw-package-tab {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.lw-package-tab:hover { color: #555; }

.lw-package-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .lens-wizard {
    flex-direction: column;
  }

  .lens-wizard-left {
    width: 100%;
    height: auto;
    position: relative;
    padding: 24px;
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .lw-product-image {
    width: 120px;
    max-height: 120px;
    margin-bottom: 0;
  }

  .lw-product-name { font-size: 16px; text-align: left; }
  .lw-product-meta { text-align: left; margin-bottom: 0; }

  .lw-subtotal-bar {
    margin-top: 0;
    margin-left: auto;
    border-top: none;
    padding-top: 0;
    border-left: 1px solid #e5e9ef;
    padding-left: 16px;
  }

  .lens-wizard-right {
    width: 100%;
    padding: 24px;
  }

  .lw-back-link { margin-bottom: 16px; }
}

@media (max-width: 576px) {
  .lens-wizard-left {
    flex-direction: column;
    text-align: center;
  }

  .lw-subtotal-bar {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid #e5e9ef;
    padding-top: 12px;
    width: 100%;
  }

  .lw-rx-table { font-size: 12px; }
  .lw-rx-table select { font-size: 12px; padding: 6px 4px; }

  .lw-step-indicator span:not(.lw-step-dot) { display: none; }
  .lw-step-line { width: 24px; }
}
