/* ===================================================================
   产品详情页补充样式 product-detail-extra.css
   覆盖：立即询价按钮 / 微信咨询按钮 / 微信二维码浮层 / 询价弹窗
   引用：product-detail.html
   =================================================================== */

/* ---------------- 底部操作按钮（询价 / 微信） ---------------- */
.pdetail-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.pdetail-btns a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.btn-inquiry {
  background: var(--primary-color);
  color: #fff !important;
  border: 1px solid var(--primary-color);
}

.btn-inquiry:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, .28);
}

.btn-wechat {
  background: #07c160;
  color: #fff !important;
  border: 1px solid #07c160;
}

.btn-wechat:hover {
  background: #06ad56;
  border-color: #06ad56;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(7, 193, 96, .28);
}

/* ---------------- 微信二维码浮层 ---------------- */
.pdetail-btns {
  position: relative;
}

.wechat-qrcode-popup {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  transform: translate(-50%, 6px);
  width: 190px;
  padding: 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  border: 1px solid var(--border-color, #e2e8f0);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all .25s ease;
  z-index: 30;
}

.wechat-qrcode-popup.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.wechat-qrcode-popup img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.wechat-qrcode-popup p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-light, #64748b);
  line-height: 1.5;
}

.wechat-qrcode-arrow {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #fff;
  border-right: 1px solid var(--border-color, #e2e8f0);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  transform: rotate(45deg);
}

/* ---------------- 询价弹窗 ---------------- */
.inquiry-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 9999;
  overflow-y: auto;
  box-sizing: border-box;
}

.inquiry-overlay.active {
  opacity: 1;
  visibility: visible;
}

.inquiry-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  overflow: hidden;
  transform: translateY(12px) scale(.98);
  transition: transform .28s ease;
  box-sizing: border-box;
}

.inquiry-overlay.active .inquiry-modal {
  transform: translateY(0) scale(1);
}

.inquiry-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  line-height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: all .2s ease;
  padding: 0;
  z-index: 2;
}

.inquiry-close:hover {
  background: rgba(255, 255, 255, .32);
  transform: rotate(90deg);
}

.inquiry-header {
  position: relative;
  padding: 24px 24px 20px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--secondary-color, #0f172a), var(--primary-color, #2563eb));
}

.inquiry-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.inquiry-header h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
}

.inquiry-header p {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, .82);
  line-height: 1.6;
}

.inquiry-form {
  padding: 22px 24px 24px;
}

.inquiry-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.inquiry-field {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.inquiry-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary-color, #0f172a);
}

.inquiry-field label span {
  color: #ef4444;
  margin-left: 2px;
}

.inquiry-field input[type="text"],
.inquiry-field input[type="tel"],
.inquiry-field input[type="email"],
.inquiry-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-light, #f8fafc);
  font-size: 14px;
  color: var(--text-color, #334155);
  outline: none;
  transition: all .2s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.inquiry-field input:focus,
.inquiry-field textarea:focus {
  border-color: var(--primary-color, #2563eb);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.inquiry-field input[readonly] {
  background: var(--bg-gray, #f1f5f9);
  color: var(--text-light, #64748b);
  cursor: not-allowed;
}

.inquiry-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

/* 验证码行 */
.inquiry-captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inquiry-captcha-input {
  flex: 1;
}

.inquiry-captcha-img {
  width: 140px;
  height: 40px;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  cursor: pointer;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

/* 提交按钮 */
.inquiry-submit {
  width: 100%;
  margin-top: 6px;
  padding: 12px 20px;
  border: 0;
  border-radius: 9px;
  background: var(--primary-color, #2563eb);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.inquiry-submit:hover:not(:disabled) {
  background: var(--primary-dark, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .28);
}

.inquiry-submit:disabled {
  opacity: .7;
  cursor: not-allowed;
}

/* ---------------- 移动端适配 ---------------- */
@media (max-width: 768px) {
  .pdetail-btns {
    flex-direction: column;
    gap: 10px;
  }

  .pdetail-btns a {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
  }

  .wechat-qrcode-popup {
    left: 50%;
    width: 200px;
  }

  .inquiry-overlay {
    padding: 12px;
    align-items: flex-start;
  }

  .inquiry-modal {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 4vh;
  }

  .inquiry-header {
    padding: 20px 18px 16px;
  }

  .inquiry-header h3 {
    font-size: 17px;
  }

  .inquiry-form {
    padding: 18px 16px 20px;
  }

  .inquiry-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .inquiry-field {
    margin-bottom: 12px;
  }

  .inquiry-field input,
  .inquiry-field textarea {
    font-size: 16px; /* 防止 iOS 自动放大 */
  }

  .inquiry-captcha-img {
    width: 120px;
    height: 38px;
  }
}
