/* 批發採購頁（/corporate）：左右滑的用途卡、會亮起來的服務、固定在旁邊的需求單 */
.wholesale-page {
  --wh-card-w: 330px;
  --wh-gap: 16px;
  --wh-on-maroon: #fff8ee;
  --wh-gold-soft: #f3e3c4;
  --wh-sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--text);
}

.wholesale-page h1,
.wholesale-page h2,
.wholesale-page h3,
.wholesale-page p {
  margin: 0;
}

.wholesale-page button {
  font: inherit;
  cursor: pointer;
}

.wholesale-page :focus-visible {
  outline: 3px solid var(--gold-deep);
  outline-offset: 2px;
}

.wh-container {
  width: min(1120px, calc(100vw - 80px));
  margin: 0 auto;
}

.wh-breadcrumb {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 16px;
  color: var(--text);
  font-size: 13px;
}

.wh-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 40px;
  align-items: start;
  padding-bottom: 72px;
}

.wh-main {
  min-width: 0;
}

/* 標題與流程：跟詢價單頁同一套 */
.wh-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  padding: 16px 0 36px;
}

.wh-title {
  color: var(--maroon-deep);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.wh-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wh-progress li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-family: var(--wh-sans);
}

.wh-progress li.is-active {
  color: var(--maroon);
}

.wh-progress li + li::before {
  position: absolute;
  left: -19px;
  color: #b6a38d;
  content: "›";
  font-size: 16px;
}

.wh-progress .icon {
  width: 18px;
  height: 18px;
}

.wh-progress strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.wh-section + .wh-section {
  margin-top: 36px;
}

.wh-h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.5;
}

.wh-h2 b {
  color: var(--maroon);
}

.wh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.wh-arrows {
  display: flex;
  gap: 8px;
}

.wh-arrows button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--maroon);
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.wh-arrows button:hover:not(:disabled) {
  border-color: var(--maroon);
  background: var(--maroon);
  color: var(--wh-on-maroon);
}

.wh-arrows button:disabled {
  cursor: default;
  opacity: 0.35;
}

/* 用途卡 */
.wh-track {
  position: relative;
  display: flex;
  gap: var(--wh-gap);
  margin-bottom: -14px;
  padding: 22px calc(50% - var(--wh-card-w) / 2) 36px;
  overflow-x: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.wh-track::-webkit-scrollbar {
  display: none;
}

.wh-track.is-free {
  scroll-snap-type: none;
}

.wh-track.is-dragging,
.wh-track.is-dragging .wh-card {
  cursor: grabbing;
}

.wh-card {
  position: relative;
  display: flex;
  overflow: hidden;
  width: var(--wh-card-w);
  flex: none;
  flex-direction: column;
  gap: 4px;
  aspect-ratio: 3 / 2;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  isolation: isolate;
  scroll-snap-align: center;
  will-change: transform, opacity;
  transition: box-shadow 0.3s, border-color 0.3s;
}

.wh-card__art {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: var(--wh-art, 0.5);
  mix-blend-mode: multiply;
  pointer-events: none;
  /* 左上角是字，把那一塊的圖淡掉，字才不會碰到圖 */
  -webkit-mask-image: radial-gradient(112% 124% at 0 0, transparent 46%, #000 76%);
  mask-image: radial-gradient(112% 124% at 0 0, transparent 46%, #000 76%);
  transition: opacity 0.35s;
}

.wh-card h3 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.3s;
}

.wh-card p {
  max-width: 8em;
  color: var(--text-soft);
  font-family: var(--wh-sans);
  font-size: 14px;
  text-wrap: balance;
  word-break: keep-all;
}

.wh-card:hover {
  border-color: var(--maroon);
}

.wh-card.is-on {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px var(--maroon), 0 22px 34px -18px rgba(80, 31, 42, 0.7);
}

.wh-card.is-on h3 {
  color: var(--maroon);
}

.wh-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.wh-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--line);
  transition: width 0.2s, background 0.2s;
}

.wh-dots button.is-on {
  width: 26px;
  background: var(--maroon);
}

/* 服務 */
.wh-services {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

/* 服務標籤只是說明，不是按鈕：不能點、沒有滑過效果 */
.wh-services li {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--text-soft);
  font-family: var(--wh-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: default;
  user-select: none;
  transition: background 0.35s, color 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.wh-services li.is-on {
  border-color: var(--maroon);
  background: var(--maroon);
  box-shadow: 0 0 0 4px rgba(181, 131, 63, 0.22);
  color: var(--wh-on-maroon);
  font-weight: 700;
}

/* 需求單：跟詢價單頁的「聯絡與詢價」同一套 */
.wh-form {
  position: sticky;
  top: calc(var(--header-height) + 16px);
  margin-top: 16px;
  padding: 16px 22px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--surface);
}

.wh-form h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

.wh-picked {
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  animation: wh-pop 0.3s;
}

.wh-picked span {
  color: var(--ink);
  font-family: var(--wh-sans);
  font-size: 14px;
  font-weight: 500;
}

.wh-picked strong {
  color: var(--maroon);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.wh-picked small {
  color: var(--text-soft);
  font-family: var(--wh-sans);
  font-size: 13px;
  line-height: 1.6;
}

@keyframes wh-pop {
  0% { transform: scale(0.97); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.wh-fields {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.wh-fields label {
  display: grid;
  gap: 6px;
}

.wh-fields label > span {
  color: var(--ink);
  font-family: var(--wh-sans);
  font-size: 13px;
  font-weight: 500;
}

.wh-fields input,
.wh-fields textarea {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid #d7cec3;
  border-radius: 8px;
  background: var(--surface);
  color: #000;
  font-family: var(--wh-sans);
  font-size: 16px;
  line-height: 1.5;
}

.wh-fields textarea {
  height: 96px;
  min-height: 44px;
  padding: 10px 13px;
  resize: vertical;
}

.wh-error {
  margin: 4px 0 0;
  color: #a12a2a;
  font-family: var(--wh-sans);
  font-size: 14px;
  font-weight: 700;
}

.wh-fields .btn {
  width: 100%;
  height: 44px;
  font-family: var(--wh-sans);
  font-size: 16px;
}

.wh-fields .btn .icon {
  width: 20px;
  height: 20px;
}

.wh-fields .btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.wholesale-page .wh-note {
  margin-top: 14px;
  color: var(--text-soft);
  font-family: var(--wh-sans);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.wh-done {
  padding: 16px 0 4px;
  text-align: center;
}

.wh-done__ok {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--maroon);
  color: var(--wh-on-maroon);
  font-size: 34px;
  place-items: center;
  animation: wh-pop 0.4s;
}

.wh-done h2 {
  color: var(--ink);
  font-size: 23px;
}

.wh-done > p {
  margin-top: 8px;
  font-size: 15px;
}

.wh-done dl {
  margin: 16px 0 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  text-align: left;
}

.wh-done dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.wh-done dt {
  flex: none;
  color: var(--text-subtle);
}

.wh-done dd {
  min-width: 0;
  margin: 0;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

.wh-again {
  height: 44px;
  margin-top: 16px;
  padding: 0 20px;
  border: 1px solid var(--maroon);
  border-radius: 8px;
  background: transparent;
  color: var(--maroon);
  font-weight: 700;
}

@media (max-width: 1050px) {
  .wholesale-page {
    --wh-card-w: 74vw;
  }

  .wh-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-bottom: 48px;
  }

  .wh-arrows {
    display: none;
  }

  .wh-form {
    position: static;
  }
}

@media (min-width: 560px) and (max-width: 1050px) {
  .wholesale-page {
    --wh-card-w: 380px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wholesale-page *,
  .wholesale-page *::before {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 720px) {
  .wh-container {
    width: calc(100vw - 32px);
  }

  .wh-intro {
    gap: 16px;
    padding: 12px 0 24px;
  }

  .wh-title {
    font-size: 30px;
  }

  .wh-progress {
    gap: 6px 26px;
  }

  .wh-h2 {
    font-size: 21px;
  }
}
