/* Welcome Guide — non-blocking slide-in panel
   Bottom-right floating panel (desktop) / bottom sheet (mobile).
   Users can continue browsing while the guide is visible. */

/* Overlay: non-blocking floating container */
.wg-overlay {
  display: none;
  position: fixed;
  top: auto;
  left: auto;
  bottom: 20px;
  right: 20px;
  width: auto;
  height: auto;
  z-index: 1100;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  animation: none;
  overflow: visible;
  box-sizing: border-box;
  pointer-events: none;
}
.wg-overlay.wg-active {
  display: block;
}

/* Dialog: floating card */
.wg-dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  max-width: 380px;
  width: 380px;
  padding: 28px 24px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05);
  animation: wgSlideIn .35s ease;
  overflow: hidden;
  box-sizing: border-box;
  pointer-events: auto;
}
@keyframes wgSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Slide-out animation */
.wg-overlay.wg-closing .wg-dialog {
  animation: wgSlideOut .3s ease forwards;
}
@keyframes wgSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(20px) scale(.97); }
}

.wg-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--muted, #6b7280);
  cursor: pointer;
  padding: 0;
  border-radius: 8px;
  transition: background .15s, color .15s;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wg-close:hover {
  background: #f1f5f9;
  color: #475569;
}
.wg-close:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
}

/* Steps */
.wg-step {
  text-align: center;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wg-step__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.wg-step__icon svg {
  width: 28px;
  height: 28px;
}
.wg-step__icon--welcome { background: #eff6ff; color: var(--primary, #2563eb); }
.wg-step__icon--search  { background: #f0fdf4; color: #16a34a; }
.wg-step__icon--order   { background: #fef3c7; color: #d97706; }
.wg-step__icon--quote   { background: #fce7f3; color: #db2777; }
.wg-step__icon--account { background: #f5f3ff; color: #7c3aed; }

.wg-step__title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
  line-height: 1.3;
}
.wg-step__text {
  font-size: 13px;
  color: var(--muted, #6b7280);
  line-height: 1.5;
  margin: 0 0 8px;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.wg-step__hint {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin: 0;
  font-style: italic;
}

/* Feature chips */
.wg-step__features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}
.wg-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary, #2563eb);
  background: #eff6ff;
  border-radius: 100px;
  white-space: nowrap;
}

/* CTA link */
.wg-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--primary, #2563eb);
  border-radius: 8px;
  text-decoration: none;
  transition: background .15s;
}
.wg-cta:hover {
  background: #1d4ed8;
  color: #fff;
}
.wg-cta:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--primary, #2563eb);
}

/* Navigation */
.wg-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.wg-dots {
  display: flex;
  gap: 8px;
}
.wg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: background .2s, transform .2s;
}
.wg-dot--active {
  background: var(--primary, #2563eb);
  transform: scale(1.25);
}

.wg-nav__btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wg-nav__btn--skip {
  color: var(--muted, #6b7280);
}
.wg-nav__btn--skip:hover {
  color: var(--muted, #6b7280);
  background: #f8fafc;
}
.wg-nav__btn--next {
  color: var(--primary, #2563eb);
  background: #eff6ff;
}
.wg-nav__btn--next:hover {
  background: #dbeafe;
}
.wg-nav__btn--finish {
  color: #fff;
  background: var(--primary, #2563eb);
}
.wg-nav__btn--finish:hover {
  background: #1d4ed8;
}
.wg-nav__btn:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
}
.wg-nav__btn--finish:focus-visible {
  outline-color: #fff;
  box-shadow: 0 0 0 4px var(--primary, #2563eb);
}

/* Mobile: compact bottom sheet — must not dominate viewport */
@media (max-width: 480px) {
  .wg-overlay {
    bottom: 64px;
    right: 0;
    left: 0;
    width: 100%;
  }
  .wg-dialog {
    width: 100%;
    max-width: 100%;
    border-radius: 14px 14px 0 0;
    padding: 16px 16px 12px;
    max-height: 36vh;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .wg-step {
    min-height: auto;
  }
  .wg-step__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
  }
  .wg-step__icon svg {
    width: 20px;
    height: 20px;
  }
  .wg-step__title {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .wg-step__text {
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.4;
  }
  .wg-step__hint {
    display: none;
  }
  .wg-step__features {
    gap: 6px;
    margin-top: 2px;
  }
  .wg-nav {
    margin-top: 8px;
    padding-top: 8px;
  }
  .wg-nav__btn {
    padding: 6px 10px;
    font-size: 13px;
    min-height: 44px;
  }
  .wg-chip {
    font-size: 11px;
    padding: 3px 8px;
  }
  .wg-cta {
    margin-top: 4px;
    padding: 8px 20px;
    font-size: 13px;
  }
}

/* Tablet: panel slightly smaller */
@media (min-width: 481px) and (max-width: 768px) {
  .wg-overlay {
    bottom: 16px;
    right: 16px;
  }
  .wg-dialog {
    max-width: 340px;
    width: 340px;
  }
}

/* Windows High Contrast (WCAG 1.4.11) */
@media (forced-colors: active) {
  .wg-step__icon { forced-color-adjust: none; }
  .wg-chip { border: 1px solid; }
  .wg-dot { border: 1px solid; }
  .wg-cta, .wg-nav__btn--finish { border: 2px solid ButtonText; }
}

/* Print: hide interactive overlay */
@media print {
  .wg-overlay { display: none !important; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wg-overlay { animation: none; }
  .wg-dialog { animation: none; }
  .wg-overlay.wg-closing .wg-dialog { animation: none; }
  .wg-close { transition: none; }
  .wg-dot { transition: none; }
  .wg-dot--active { transform: none; }
  .wg-nav__btn { transition: none; }
  .wg-cta { transition: none; }
}
