/* ==========================================================================
   JOYBEAN — Quote request page
   Multi-row quote form, design option cards and file upload control.
   ========================================================================== */

.quote-main-section {
  padding: clamp(44px, 5.5vw, 72px) 0 clamp(64px, 8vw, 104px);
}

/* Anchor target for header "Get a Quote" links pointing at /contact/#quote */
#quote {
  scroll-margin-top: 120px;
}

.quote-form-card {
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(26px, 3.8vw, 46px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}

.quote-form-head {
  max-width: 640px;
  margin: 0 auto clamp(28px, 3.4vw, 38px);
  text-align: center;
}

.quote-form-head h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.quote-form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Form layout
   -------------------------------------------------------------------------- */

.quote-form {
  display: grid;
  gap: 18px;
}

.quote-row {
  display: grid;
  gap: 16px;
}

.quote-row.design-row {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: start;
}

.quote-field {
  min-width: 0;
}

.quote-field input,
.quote-field select,
.quote-field textarea {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quote-field select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238d8075' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  appearance: none;
  cursor: pointer;
}

.quote-field textarea {
  height: auto;
  min-height: 150px;
  padding: 13px 16px;
  line-height: 1.65;
  resize: vertical;
}

.quote-field input::placeholder,
.quote-field textarea::placeholder {
  color: #b9ada2;
}

.quote-field input:focus,
.quote-field select:focus,
.quote-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(228, 33, 27, 0.1);
  outline: none;
}

/* --------------------------------------------------------------------------
   Design option cards
   -------------------------------------------------------------------------- */

.quote-design-options {
  display: grid;
  gap: 12px;
}

.quote-design-option {
  position: relative;
}

.quote-design-option input[type="radio"] {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.quote-design-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 16px;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease,
    background-color 0.2s ease;
}

.quote-design-option label::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 1.5px solid #c5b8ad;
  border-radius: 50%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quote-design-option input:checked + label {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary);
}

.quote-design-option input:checked + label::before {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 3px #fff;
  background: var(--primary);
}

.quote-design-option input:focus-visible + label {
  box-shadow: 0 0 0 3px rgba(228, 33, 27, 0.12);
}

/* --------------------------------------------------------------------------
   File upload
   -------------------------------------------------------------------------- */

.quote-file-upload {
  display: none;
}

.quote-file-upload.show {
  display: block;
}

.quote-file-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 8px 0 16px;
  overflow: hidden;
  background: #fdfaf7;
  border: 1px dashed #d9cec4;
  border-radius: 10px;
}

.quote-file-control input[type="file"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.quote-file-control:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(228, 33, 27, 0.1);
}

.quote-file-button {
  flex: none;
  padding: 8px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.quote-file-name {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.quote-file-hint {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Submit and privacy note
   -------------------------------------------------------------------------- */

.quote-submit {
  width: 100%;
  margin-top: 4px;
}

.quote-privacy {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Short enquiry form — shared by the homepage and contact page
   -------------------------------------------------------------------------- */

.quote-form--short {
  gap: 16px;
}

.quote-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-row--full {
  grid-template-columns: 1fr;
}

.quote-response-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: -2px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.quote-response-note svg {
  flex: none;
  color: var(--primary);
}

.quote-form-success {
  margin: 0;
  padding: 12px 16px;
  color: #1b6b3a;
  background: #edf7f0;
  border: 1px solid #cfe8d7;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.quote-form-success[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Contact Form 7 — shared quote form
   -------------------------------------------------------------------------- */

.quote-form-card .wpcf7-form {
  display: grid;
  gap: 16px;
}

/* CF7 默认样式已禁用，隐藏它自动插入的隐藏字段容器 */
.quote-form-card .hidden-fields-container {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.quote-form-card .wpcf7-form > * {
  margin: 0;
}

.quote-form-card .wpcf7-form p {
  margin: 0;
}

.quote-form-card .wpcf7-form-control-wrap {
  display: block;
}

.quote-form-card .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  color: #c0392b;
  font-size: 12px;
  line-height: 1.4;
}

/* CF7 总会输出这个空容器，没有内容时不占位 */
.quote-form-card .wpcf7-response-output:empty {
  display: none;
}

.quote-form-card .wpcf7-response-output {
  margin: 0;
  padding: 12px 16px;
  color: #1b6b3a;
  background: #edf7f0;
  border: 1px solid #cfe8d7;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.quote-form-card form.invalid .wpcf7-response-output,
.quote-form-card form.failed .wpcf7-response-output {
  color: #a3332b;
  background: #fdf0ef;
  border-color: #f0cfcc;
}

.quote-form-card .wpcf7-spinner {
  margin: 0 auto;
}

.quote-form-card .screen-reader-response {
  position: absolute;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  word-wrap: normal !important;
}

.quote-file-control .wpcf7-form-control-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.quote-file-control .wpcf7-form-control-wrap input[type="file"] {
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Product detail page — prefilled read-only product name
   -------------------------------------------------------------------------- */

/* Only shown on product pages, where the product name is auto-filled */
.quote-product-row {
  display: none;
}

body.single-product .quote-product-row {
  display: grid;
}

.quote-field input[readonly] {
  color: var(--ink-soft);
  background: #fdfaf7;
  cursor: default;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .quote-row.design-row {
    grid-template-columns: 1fr;
  }

  .quote-field textarea {
    min-height: 130px;
  }
}

@media (max-width: 520px) {
  .quote-form-card {
    padding: 24px 20px;
  }

  .quote-row--2 {
    grid-template-columns: 1fr;
  }
}
