/* ═══════════════════════════════════════════════
   夏悅窗飾 — 聯絡/詢價頁  ·  contact- 命名空間
═══════════════════════════════════════════════ */
:root {
  --xy-brand:        #AA7566;
  --xy-brand-light:  #FCCABC;
  --xy-brand-pale:   #FFF4F0;
  --xy-brand-paler:  #FFFAF8;
  --xy-brand-dark:   #7A4F42;
  --xy-brand-deep:   #4E2E24;
  --xy-accent:       #C4907F;
  --xy-accent2:      #E8C4B8;
  --xy-text:         #2C1A14;
  --xy-text-sec:     #7A5C54;
  --xy-text-muted:   #B89A93;
  --xy-border:       #EBCFC6;
  --xy-border-light: #F5E8E3;
  --xy-bg:           #FFFAF9;
  --xy-bg-card:      #FFFFFF;
  --xy-bg-warm:      #FEF6F3;
  --xy-shadow:       rgba(170,117,102,0.10);
  --xy-shadow-md:    rgba(170,117,102,0.18);
  --xy-radius:       14px;
  --xy-radius-sm:    8px;
  --xy-radius-lg:    20px;
}

/* ── 頁面英雄區 ── */
.contact-hero {
  background: linear-gradient(135deg, var(--xy-brand-deep) 0%, #7A4F42 50%, var(--xy-brand) 100%);
  color: #fff;
  padding: 3.5rem 2rem 3rem;
  position: relative;
  overflow: hidden;
  /* 防止 blob 等絕對定位元素造成橫向溢出 */
  max-width: 100%;
  box-sizing: border-box;
}
.contact-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.contact-hero-blob {
  position: absolute;
  width: 400px;
  height: 400px;
  right: -80px;
  top: -80px;
  background: radial-gradient(circle, rgba(252,202,188,0.18) 0%, transparent 70%);
  border-radius: 50%;
}
.contact-hero-blob2 {
  position: absolute;
  width: 220px;
  height: 220px;
  left: 10%;
  bottom: -60px;
  background: radial-gradient(circle, rgba(252,202,188,0.10) 0%, transparent 70%);
  border-radius: 50%;
}
.contact-hero-inner {
  max-width: 1100px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.contact-hero-left { flex: 1; min-width: 0; }
.contact-hero-breadcrumb {
  font-size: 12px;
  color: rgba(252,202,188,0.75);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.contact-hero-breadcrumb a { color: rgba(252,202,188,0.85); text-decoration: none; }
.contact-hero-breadcrumb span { color: rgba(255,255,255,0.4); }
.contact-hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--xy-brand-light);
  margin-bottom: 0.6rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 8px;
}
.contact-hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--xy-brand-light);
  opacity: 0.6;
}
.contact-hero h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 0.8rem;
}
.contact-hero h2 em {
  font-style: normal;
  color: var(--xy-brand-light);
  text-decoration: underline;
  text-decoration-color: rgba(252,202,188,0.4);
  text-underline-offset: 4px;
}
.contact-hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.78);
  max-width: min(520px, 100%);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.contact-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.contact-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(252,202,188,0.3);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
  padding: 5px 13px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 5px;
}
.contact-badge-dot {
  width: 6px;
  height: 6px;
  background: var(--xy-brand-light);
  border-radius: 50%;
  flex-shrink: 0;
}
.contact-hero-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}
.contact-hero-phone {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(252,202,188,0.4);
  border-radius: 14px;
  padding: 16px 22px;
  backdrop-filter: blur(8px);
  text-align: center;
  min-width: 200px;
}
.contact-hero-phone-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--xy-brand-light);
  margin-bottom: 4px;
}
.contact-hero-phone-num {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}
.contact-hero-phone-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  margin-top: 3px;
}
.contact-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.contact-hero-tag {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(252,202,188,0.2);
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── 主內容 ── */
.contact-main {
  max-width: 1100px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .contact-main { grid-template-columns: 1fr; }
}

/* ── 章節標題 ── */
.contact-section-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--xy-brand-deep);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 22px;
  background: linear-gradient(to bottom, var(--xy-brand), var(--xy-brand-light));
  border-radius: 4px;
  flex-shrink: 0;
}
.contact-section-desc {
  font-size: 13.5px;
  color: var(--xy-text-sec);
  margin-bottom: 1.4rem;
  margin-left: 14px;
}

/* ── 詢價表單外框 ── */
.contact-form-wrap {
  background: var(--xy-bg-card);
  border: 1px solid var(--xy-border);
  border-radius: var(--xy-radius-lg);
  padding: 2.2rem 2rem;
  box-shadow: 0 4px 32px var(--xy-shadow);
}
.contact-form-head {
  text-align: center;
  margin-bottom: 1.8rem;
}
.contact-form-head-icon {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--xy-brand-pale), var(--xy-brand-light));
  border-radius: 16px;
  margin: 0 auto 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.contact-form-head h2 {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--xy-brand-deep);
  margin-bottom: 0.3rem;
}
.contact-form-head p {
  font-size: 13px;
  color: var(--xy-text-sec);
}

/* ── 右欄：聯絡資訊 ── */
.contact-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.contact-card {
  background: var(--xy-bg-card);
  border: 1px solid var(--xy-border);
  border-radius: var(--xy-radius);
  overflow: hidden;
  box-shadow: 0 2px 18px var(--xy-shadow);
}
.contact-card-head {
  background: linear-gradient(135deg, var(--xy-brand-deep), var(--xy-brand-dark));
  padding: 1.2rem 1.5rem;
  color: #fff;
}
.contact-card-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
}
.contact-card-sub { font-size: 12px; color: rgba(252,202,188,0.8); }
.contact-card-body { padding: 1.4rem 1.5rem; }

.contact-item {
  display: flex;
  gap: 12px;
  margin-bottom: 1.1rem;
  align-items: flex-start;
}
.contact-item:last-child { margin-bottom: 0; }
.contact-ci-icon {
  width: 36px;
  height: 36px;
  background: var(--xy-brand-pale);
  border: 1px solid var(--xy-border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.contact-ci-body { flex: 1; }
.contact-ci-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--xy-text-muted);
  margin-bottom: 2px;
  font-weight: 500;
}
.contact-ci-val {
  font-size: 14px;
  color: var(--xy-text);
  font-weight: 500;
  line-height: 1.5;
}
.contact-ci-val a {
  color: var(--xy-brand-dark);
  text-decoration: none;
  transition: color 0.2s;
}
.contact-ci-val a:hover { color: var(--xy-brand); text-decoration: underline; }
.contact-ci-sub {
  font-size: 12px;
  color: var(--xy-text-muted);
  margin-top: 1px;
}

/* ── 門市卡片 ── */
.contact-branch-card {
  background: var(--xy-bg-card);
  border: 1px solid var(--xy-border);
  border-radius: var(--xy-radius);
  overflow: hidden;
  box-shadow: 0 2px 18px var(--xy-shadow);
}
.contact-branch-head {
  background: var(--xy-brand-pale);
  border-bottom: 1px solid var(--xy-border);
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.contact-branch-head h3 {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--xy-brand-deep);
}
.contact-branch-badge {
  background: var(--xy-brand);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}
.contact-branch-list { padding: 0.8rem 1.4rem; }
.contact-branch-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--xy-border-light);
  align-items: flex-start;
}
.contact-branch-item:last-child { border-bottom: none; padding-bottom: 0; }
.contact-branch-num {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--xy-brand), var(--xy-brand-dark));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.contact-branch-info { flex: 1; }
.contact-branch-zone {
  font-size: 13px;
  font-weight: 600;
  color: var(--xy-brand-dark);
  margin-bottom: 2px;
}
.contact-branch-addr {
  font-size: 12.5px;
  color: var(--xy-text-sec);
  line-height: 1.5;
}

/* ── 服務時間 ── */
.contact-hours-card {
  background: linear-gradient(135deg, #FEF0EB, var(--xy-brand-pale));
  border: 1.5px solid var(--xy-border);
  border-radius: var(--xy-radius);
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 14px;
}
.contact-hours-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.contact-hours-text h4 {
  font-family: 'Noto Serif TC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--xy-brand-deep);
  margin-bottom: 3px;
}
.contact-hours-text p { font-size: 13px; color: var(--xy-text-sec); }
.contact-hours-highlight {
  font-family: 'Noto Serif TC', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--xy-brand);
}

/* ── E-E-A-T 信任指標區 ── */
.contact-trust-section {
  grid-column: 1 / -1;
  margin-top: 0.5rem;
}
.contact-trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 760px) { .contact-trust-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .contact-trust-grid { grid-template-columns: 1fr; } }

.contact-trust-item {
  background: var(--xy-bg-card);
  border: 1px solid var(--xy-border);
  border-radius: var(--xy-radius);
  padding: 1.4rem 1.2rem;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.contact-trust-item:hover {
  box-shadow: 0 6px 24px var(--xy-shadow-md);
  transform: translateY(-2px);
}
.contact-trust-num {
  font-family: 'Noto Serif TC', serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--xy-brand);
  line-height: 1;
  margin-bottom: 4px;
}
.contact-trust-unit { font-size: 14px; color: var(--xy-text-muted); }
.contact-trust-label {
  font-size: 13px;
  color: var(--xy-text-sec);
  margin-top: 4px;
  line-height: 1.4;
}

/* ── 服務區域 ── */
.contact-area-section {
  grid-column: 1 / -1;
  background: var(--xy-bg-card);
  border: 1px solid var(--xy-border);
  border-radius: var(--xy-radius-lg);
  padding: 2rem;
  box-shadow: 0 2px 16px var(--xy-shadow);
}
.contact-area-intro {
  font-size: 14px;
  color: var(--xy-text-sec);
  margin-bottom: 1.2rem;
  line-height: 1.8;
}
.contact-area-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.contact-area-tag {
  background: var(--xy-brand-pale);
  border: 1px solid var(--xy-border);
  color: var(--xy-brand-dark);
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 22px;
  transition: all 0.18s;
  cursor: default;
}
.contact-area-tag:hover {
  background: var(--xy-brand-light);
  border-color: var(--xy-brand);
  color: var(--xy-brand-deep);
}
.contact-area-tag.contact-area-focus {
  background: var(--xy-brand);
  border-color: var(--xy-brand-dark);
  color: #fff;
  font-weight: 500;
}

/* ── 表單成功提示 ── */
.contact-form-success {
  display: none;
  background: #F0FAF4;
  border: 1.5px solid #6DB88C;
  border-radius: var(--xy-radius);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}
.contact-form-success.contact-show { display: block; }
.contact-form-success-icon { font-size: 36px; margin-bottom: 8px; }
.contact-form-success h4 { font-size: 16px; font-weight: 600; color: #2E7D55; margin-bottom: 4px; }
.contact-form-success p { font-size: 13px; color: #4A9B6E; }

/* ── 響應式通用 ── */
@media (max-width: 768px) {
  .contact-hero {
    padding: 2rem 1rem 1.8rem;
  }
  .contact-hero-inner {
    gap: 1.2rem;
  }
  /* hero-left 全寬，不再 flex-shrink 被壓縮 */
  .contact-hero-left {
    width: 100%;
    min-width: 0;
  }
  .contact-hero-right {
    width: 100%;
    align-items: flex-start;
  }
  .contact-hero-phone {
    min-width: unset;
    width: 100%;
    box-sizing: border-box;
  }
  .contact-hero-tags {
    justify-content: flex-start;
  }

  /* 主內容區縮邊距 */
  .contact-main {
    padding: 1.6rem 1rem 2.5rem;
  }

  /* 表單卡片縮小內距，防止手機版溢出 */
  .contact-form-wrap {
    padding: 1.4rem 1rem;
    border-radius: var(--xy-radius);
    /* 確保不超出父容器 */
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 送出按鈕全寬 */
  .xy-btn-submit {
    width: 100%;
  }

  /* input / select / textarea 全寬自適應 */
  .xy-input, .xy-select, .xy-textarea {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  /* 驗證碼列改垂直排列，避免橫向溢出 */
  .xy-form-row > div[style*="display:flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .xy-form-row > div > div[style*="align-items:center"] {
    flex-wrap: wrap;
  }

  /* 驗證碼輸入框手機版可縮 */
  #contact_code {
    width: 90px !important;
    min-width: 0 !important;
  }

  /* checkbox grid 手機版單欄 */
  .xy-checkbox-grid {
    grid-template-columns: 1fr;
  }

  /* 服務區域 section 縮邊距 */
  .contact-area-section {
    padding: 1.4rem 1rem;
  }

  /* 信任指標 section */
  .contact-trust-section {
    overflow: hidden;
  }
}

/* ══════════════════════════════════════════════════
   表單內部樣式（xy- 前綴，全站共用）
══════════════════════════════════════════════════ */

/* ── 表單列 ── */
.xy-form-row {
  margin-bottom: 1.2rem;
}
.xy-form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--xy-text);
  margin-bottom: 6px;
}
.xy-form-row label .xy-req {
  color: var(--xy-brand);
  margin-left: 3px;
}
.xy-form-row label .xy-opt {
  font-size: 11px;
  color: var(--xy-text-muted);
  font-weight: 400;
  margin-left: 4px;
}

/* ── 輸入欄位 ── */
.xy-input,
.xy-select,
.xy-textarea {
  width: 100%;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 14px;
  color: var(--xy-text);
  background: var(--xy-bg-warm);
  border: 1.5px solid var(--xy-border);
  border-radius: var(--xy-radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}
.xy-input:focus,
.xy-select:focus,
.xy-textarea:focus {
  border-color: var(--xy-brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(170,117,102,0.12);
}
.xy-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23AA7566' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.xy-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.7;
}

/* ── 兩欄 grid ── */
.xy-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 540px) {
  .xy-form-grid-2 { grid-template-columns: 1fr; }
}

/* ── 服務複選 ── */
.xy-checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
@media (max-width: 480px) {
  .xy-checkbox-grid { grid-template-columns: 1fr; }
}
.xy-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1.5px solid var(--xy-border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  background: var(--xy-bg-warm);
}
.xy-checkbox-item:hover {
  border-color: var(--xy-brand-light);
  background: var(--xy-brand-pale);
}
.xy-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--xy-brand);
  flex-shrink: 0;
  cursor: pointer;
}
.xy-checkbox-item span {
  font-size: 13px;
  color: var(--xy-text-sec);
  line-height: 1.3;
}
.xy-checkbox-item input:checked + span {
  color: var(--xy-brand-dark);
  font-weight: 500;
}
.xy-checkbox-item:has(input:checked) {
  border-color: var(--xy-brand);
  background: var(--xy-brand-pale);
}

/* ── 送出按鈕 ── */
.xy-btn-submit {
  background: linear-gradient(135deg, var(--xy-brand), var(--xy-brand-dark));
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  margin-top: 0.4rem;
  box-shadow: 0 4px 20px rgba(170,117,102,0.40);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.xy-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 28px rgba(170,117,102,0.50);
}
.xy-btn-submit:active { transform: translateY(0); }

/* ── 表單備注文字 ── */
.xy-form-note {
  text-align: center;
  font-size: 11.5px;
  color: var(--xy-text-muted);
  margin-top: 10px;
}

/* ── 入場動畫 ── */
@keyframes contact-fadein {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.contact-form-wrap,
.contact-card,
.contact-branch-card,
.contact-trust-item {
  animation: contact-fadein 0.5s ease both;
}
.contact-trust-item:nth-child(2) { animation-delay: 0.08s; }
.contact-trust-item:nth-child(3) { animation-delay: 0.16s; }
.contact-trust-item:nth-child(4) { animation-delay: 0.24s; }
