/**
 * SHPACK 询价向导样式
 */

/* 让向导突破父级容器宽度限制，实现全宽 */
.shpack-wizard-outer {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 0 24px;
  box-sizing: border-box;
}

.shpack-wizard {
  max-width: 1232px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(7, 89, 133, 0.10);
  padding: 18px 48px 32px;
  border-top: 5px solid #0ea5e9;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
}

@media (max-width: 768px) {
  .shpack-wizard { padding: 20px 16px 28px; }
  .shpack-wizard-outer { padding: 0 12px; }
}

/* === 标题 === */
.shpack-wizard-header {
  text-align: center;
  margin-bottom: 12px;
}

.shpack-wizard-title {
  font-family: 'Barlow', 'Noto Sans SC', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0c4a6e;
  margin: 0 0 4px;
  line-height: 1.2;
}

.shpack-wizard-subtitle {
  color: #64748b;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

/* 顶部 "步骤 X / 7" 胶囊（合并到标题旁） */
.shpack-step-counter-top {
  display: inline-block;
  padding: 2px 10px;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-right: 6px;
  vertical-align: 1px;
}

/* === 进度条 === */
.shpack-wizard-progress {
  margin-bottom: 14px;
}

.shpack-progress-bar {
  height: 6px;
  background: #075985;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shpack-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #7dd3fc);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.6);
}

/* 完成度百分比 */
.shpack-completion {
  display: inline-block;
  margin-left: 6px;
  color: #0369a1;
  font-weight: 500;
}

.shpack-completion strong {
  color: #0c4a6e;
  font-family: 'Barlow', sans-serif;
  font-weight: 800;
  font-size: 1.05em;
}

.shpack-progress-steps {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .shpack-progress-steps {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
}

.shpack-progress-step {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
  transition: all 0.3s;
}

/* 已访问的步骤鼠标变手指，hover 高亮 */
.shpack-progress-step.active,
.shpack-progress-step.done {
  cursor: pointer;
}
.shpack-progress-step.done:hover .shpack-progress-num {
  background: #0ea5e9;
  transform: scale(1.08);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18);
}

.shpack-progress-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  transition: all 0.3s;
  flex-shrink: 0;
}

.shpack-progress-step.active .shpack-progress-num {
  background: #0ea5e9;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.shpack-progress-step.done .shpack-progress-num {
  background: #10b981;
  color: #fff;
}

.shpack-progress-step.done .shpack-progress-num::before {
  content: "✓";
}
.shpack-progress-step.done .shpack-progress-num span { display: none; }

.shpack-progress-label {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 768px) {
  .shpack-progress-label { display: none; }
}

.shpack-progress-step.active .shpack-progress-label,
.shpack-progress-step.done .shpack-progress-label {
  color: #0c4a6e;
  font-weight: 600;
}

/* === 单步 === */
.shpack-step {
  animation: shpackFadeIn 0.4s ease-out;
}

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

.shpack-step-meta {
  text-align: center;
  margin: 14px 0 14px;
}

.shpack-step-title {
  font-family: 'Barlow', 'Noto Sans SC', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #0c4a6e;
  margin: 0 0 2px;
  line-height: 1.2;
}

.shpack-step-subtitle {
  color: #64748b;
  font-size: 0.82rem;
  margin: 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

/* === 卡片网格（紧凑样式，一排 6 个）=== */
.shpack-cards {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .shpack-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 700px) {
  .shpack-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .shpack-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shpack-card {
  position: relative;
  background: #fff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shpack-card:hover {
  border-color: #7dd3fc;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.12);
}

.shpack-card input { display: none; }

.shpack-card.selected {
  border-color: #0ea5e9;
  background: linear-gradient(180deg, #f0f9ff, #fff);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.18);
}

.shpack-card-image {
  aspect-ratio: 1 / 1;
  background: #f8fafc;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shpack-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shpack-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #bae6fd, #38bdf8);
  color: #0c4a6e;
  font-family: 'Barlow', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.shpack-card-body {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.shpack-card-label {
  font-weight: 600;
  font-size: 0.78rem;
  color: #1e293b;
  line-height: 1.3;
  margin-bottom: 0;
  /* 一行省略，超出显示... */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 紧凑模式下隐藏描述（hover 时显示 tooltip） */
.shpack-card-desc {
  display: none;
}

.shpack-card-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  background: #0ea5e9;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 8px rgba(14, 165, 233, 0.4);
  z-index: 2;
}

.shpack-card.selected .shpack-card-check {
  opacity: 1;
  transform: scale(1);
}

/* hover 时显示描述 tooltip */
.shpack-card[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}

/* === 字段表单（第6/7步）=== */
.shpack-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}

@media (max-width: 600px) {
  .shpack-fields { grid-template-columns: 1fr; }
}

.shpack-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shpack-field-full {
  grid-column: 1 / -1;
}

.shpack-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.shpack-field label small {
  font-weight: 400;
  color: #94a3b8;
  margin-left: 4px;
}

.shpack-field .req { color: #ef4444; }

.shpack-field input[type="text"],
.shpack-field input[type="email"],
.shpack-field input[type="tel"],
.shpack-field select,
.shpack-field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  transition: all 0.2s;
}

.shpack-field input:focus,
.shpack-field select:focus,
.shpack-field textarea:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.shpack-field input.error,
.shpack-field select.error,
.shpack-field textarea.error {
  border-color: #ef4444;
  background: #fef2f2;
}

.shpack-field textarea { resize: vertical; min-height: 100px; }

.shpack-field input[type="file"] {
  padding: 10px;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  cursor: pointer;
}

.shpack-checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #475569;
  font-weight: 500;
}

.shpack-checkbox-line input { margin-top: 4px; accent-color: #0ea5e9; }

/* === 摘要 === */
.shpack-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 24px 0;
}

.shpack-summary h4 {
  margin: 0 0 12px;
  color: #0c4a6e;
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
}

.shpack-summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.shpack-summary-item {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
}

.shpack-summary-item-label {
  color: #94a3b8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.shpack-summary-item-value {
  color: #1e293b;
  font-weight: 600;
}

/* === 按钮 === */
.shpack-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.shpack-btn {
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.25s;
  background: transparent;
}

.shpack-btn-prev {
  color: #64748b;
  background: #f1f5f9;
}

.shpack-btn-prev:hover {
  background: #e2e8f0;
  color: #334155;
}

.shpack-btn-next,
.shpack-btn-submit {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: #fff;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.shpack-btn-next:hover,
.shpack-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4);
}

.shpack-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* === 提交后消息 === */
.shpack-form-message {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  display: none;
  text-align: center;
}

.shpack-form-message.success {
  display: block;
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #86efac;
}

.shpack-form-message.error {
  display: block;
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fca5a5;
}

/* 加载图标 */
.shpack-btn.loading {
  position: relative;
  color: transparent;
}
.shpack-btn.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: shpackSpin 0.7s linear infinite;
}
@keyframes shpackSpin { to { transform: rotate(360deg); } }
