/* ========================================
   聯絡我們頁面 — Contact Page Styles
   色彩設計來自 Figma 設計稿
   ======================================== */

/* ── Banner 區塊 ── */
.contact-banner {
  margin-top: var(--header-height);
  position: relative;
  width: 100%;
  height: 200px;
  background:
    linear-gradient(180deg, rgba(51,51,51,0.3) 0%, rgba(51,51,51,0.1) 100%),
    var(--contact-banner-bg, url('../images/contact-banner-mcp.png')) center/cover no-repeat;
  background-color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.contact-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(183,169,131,0.15) 0%,
    transparent 50%,
    rgba(183,169,131,0.08) 100%
  );
  pointer-events: none;
}

.contact-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contact-banner-title {
  font-family: var(--font-primary);
  font-size: 24px;
  font-weight: 400;
  color: var(--color-white);
  text-align: center;
  animation: contactFadeDown 0.6s ease forwards;
}

.contact-banner-underline {
  width: 200px;
  height: 1px;
  background: var(--color-white);
  animation: contactLineExpand 0.6s ease 0.2s forwards;
  transform: scaleX(0);
}

.contact-banner-subtitle {
  font-size: 14px;
  color: var(--color-white);
  text-align: center;
  opacity: 0;
  animation: contactFadeUp 0.5s ease 0.4s forwards;
}

/* ── 聯絡方式列 ── */
.contact-methods {
  padding: 50px 0;
  background: var(--color-white);
}

.contact-methods-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 50px;
}

.contact-method-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  text-align: center;
  opacity: 0;
  animation: contactFadeUp 0.5s ease forwards;
}

.contact-method-card:nth-child(1) { animation-delay: 0.1s; }
.contact-method-card:nth-child(3) { animation-delay: 0.2s; }
.contact-method-card:nth-child(5) { animation-delay: 0.3s; }
.contact-method-card:nth-child(7) { animation-delay: 0.4s; }

.contact-method-icon {
  font-size: 20px;
  margin-bottom: 6px;
  display: none; /* 隱藏 emoji，改用 label 色彩區別 */
}

.contact-method-label {
  font-size: 14px;
  font-weight: 700;
  color: #E25B2A;
  font-family: var(--font-primary);
}

.contact-method-value {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-dark);
  font-family: var(--font-primary);
  margin-top: 4px;
}

.contact-method-value.is-link {
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-method-value.is-link:hover {
  color: #E25B2A;
}

.contact-method-note {
  font-size: 12px;
  color: var(--color-dark);
  margin-top: 10px;
}

.contact-method-note.is-link {
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.3s ease;
}

.contact-method-note.is-link:hover {
  color: var(--color-gold);
}

.contact-method-divider {
  width: 1px;
  height: 65px;
  background: #ddd;
  flex-shrink: 0;
}

/* ── 主內容容器 ── */
.contact-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 50px 60px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

/* ── Section Header（聯絡表單 / 門市據點標題） ── */
.contact-section-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.contact-section-title {
  font-family: var(--font-primary);
  font-size: 18px;
  font-weight: 700;
  color: #000;
}

.contact-section-underline {
  width: 70px;
  height: 2px;
  background: var(--color-gold);
}

.contact-form-section .contact-section-underline {
  width: 70px;
  height: 3px;
  background: #E25B2A;
}

.contact-stores-section .contact-section-underline {
  width: 76px;
  height: 3px;
  background: #E25B2A;
}

/* ── 聯絡表單 ── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contact-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-form-label {
  font-size: 14px;
  font-weight: 400;
  color: #333333;
  font-family: var(--font-primary);
}

.contact-form-input,
.contact-form-select,
.contact-form-textarea {
  width: 100%;
  border: none;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--font-primary);
  color: #333333;
  background: #FFF9E5;
  outline: none;
  transition: background-color 0.2s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;
}

.contact-form-input:focus,
.contact-form-select:focus,
.contact-form-textarea:focus {
  box-shadow: none;
}

.contact-form-input::placeholder {
  color: transparent;
}

.contact-form-textarea::placeholder {
  color: #AAAAAA;
  font-size: 14px;
}

.contact-form-select {
  color: #888888;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7.5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.contact-form-select option {
  color: #333333;
}

.contact-form-select-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.contact-form-select-arrow {
  display: none;
}

.contact-form-textarea {
  resize: vertical;
  min-height: 180px;
  line-height: 1.5;
}

.contact-form-error {
  font-size: 12px;
  color: #d9534f;
  min-height: 16px;
  display: none;
}

.contact-form-error.show {
  display: block;
}

/* 表單底部 */
.contact-form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 0;
}

.contact-form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  height: 44px;
  padding: 0 24px;
  background: #E25B2A;
  color: var(--color-white);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-primary);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.contact-form-submit:hover {
  background: #D04E22;
}

.contact-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-submit-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.contact-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: contactSpin 0.6s linear infinite;
}

.contact-form-required-note {
  font-size: 12px;
  color: #888;
}

/* 送出成功訊息 */
.contact-success-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 50px 20px;
  text-align: center;
  animation: contactFadeUp 0.5s ease forwards;
}

.contact-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-white);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: contactSuccessPop 0.4s ease;
}

.contact-success-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
}

.contact-success-text {
  font-size: 14px;
  color: #666;
}

/* 表單驗證錯誤狀態 */
.contact-form-input.has-error,
.contact-form-select.has-error,
.contact-form-textarea.has-error {
  border-color: #d9534f;
}

/* ── 門市據點 ── */
.contact-map-wrap {
  width: 100%;
  height: 220px;
  background: #f0f0f0;
  overflow: hidden;
  margin-bottom: 42px;
  border: none;
}

.contact-map-wrap iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.contact-store-list {
  width: 100%;
  overflow: hidden;
}

.contact-store-track {
  display: flex;
  width: 100%;
  transition: transform 0.35s ease;
}

.contact-store-page {
  flex: 0 0 100%;
  min-width: 0;
}

.contact-store-card {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0 0 22px;
  transition: background 0.2s ease;
}

.contact-store-card:hover {
  background: none;
}

.contact-store-num {
  display: none;
}

.contact-store-num span {
  display: none;
}

.contact-store-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.contact-store-name {
  font-size: 18px;
  font-weight: 700;
  color: #E25B2A;
  font-family: var(--font-primary);
  line-height: 1.35;
  margin-bottom: 2px;
}

.contact-store-address {
  font-size: 14px;
  color: #777777;
  line-height: 1.4;
}

.contact-store-detail {
  font-size: 13px;
  color: #888888;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  line-height: 1.4;
}

.contact-store-phone-icon {
  width: 18px;
  height: 18px;
  color: #333333;
  fill: currentColor;
  flex-shrink: 0;
}

.contact-store-divider {
  width: 100%;
  height: 1px;
  background: transparent;
}

.contact-store-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
}

.contact-store-carousel-arrow {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #E25B2A;
  font-size: 24px;
  line-height: 1;
}

.contact-store-carousel-arrow:disabled {
  color: #CCCCCC;
  cursor: default;
}

.contact-store-carousel-dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.contact-store-carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 50%;
  background: #D9D9D9;
}

.contact-store-carousel-dot.active {
  background: #E25B2A;
}

/* 查看所有門市按鈕 */
.contact-stores-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 270px;
  height: 64px;
  border: 2px solid #E25B2A;
  color: #E25B2A;
  background: #FFFFFF;
  font-size: 20px;
  font-family: var(--font-primary);
  margin-top: 24px;
  transition: all 0.3s ease;
}

@media screen and (min-width: 993px) {
  .contact-stores-section {
    position: relative;
  }

  .contact-map-wrap {
    margin-bottom: 16px;
  }

  .contact-store-card {
    padding-bottom: 10px;
  }

  .contact-stores-btn {
    position: absolute;
    left: 0;
    margin-top: 0;
  }
}

.contact-stores-btn:hover {
  background: #FFFFFF;
  color: #E25B2A;
  opacity: 1;
}

/* ========================================
   動畫效果
   ======================================== */
@keyframes contactFadeDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes contactLineExpand {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes contactSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes contactSuccessPop {
  0% {
    transform: scale(0);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

/* 滾動淡入效果 */
.contact-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.contact-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   響應式 RWD
   ======================================== */
@media screen and (max-width: 992px) {
  .contact-container {
    grid-template-columns: 1fr;
    gap: 50px;
    padding: 20px 30px 50px;
  }

  .contact-methods-inner {
    padding: 0 30px;
    flex-wrap: wrap;
    gap: 20px;
  }

  .contact-method-divider {
    display: none;
  }

  .contact-method-card {
    flex: 0 0 calc(50% - 10px);
    padding: 15px 10px;
    border: 1px solid #f0f0f0;
  }

  .contact-store-track {
    display: block;
    transform: none !important;
  }

  .contact-store-page {
    width: 100%;
  }

  .contact-store-carousel-controls {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  body.page-template-page-contact {
    overflow-x: hidden;
  }

  .page-template-page-contact .contact-banner,
  .page-template-page-contact .contact-methods,
  .page-template-page-contact .contact-container,
  .page-template-page-contact .contact-form-section,
  .page-template-page-contact .contact-stores-section,
  .page-template-page-contact .contact-map-wrap,
  .page-template-page-contact .contact-store-list,
  .page-template-page-contact .about-subscribe,
  .page-template-page-contact .subscribe-content,
  .page-template-page-contact .subscribe-form {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .contact-banner {
    height: 130px;
    background:
      linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
      var(--contact-banner-mobile-bg, url('../images/contact-banner-mobile.png')) center/cover no-repeat;
  }

  .contact-banner-overlay {
    display: none;
  }

  .contact-banner-content {
    gap: 6px;
    padding: 0 20px;
  }

  .contact-banner-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
  }

  .contact-banner-underline {
    width: 80px;
    height: 2px;
    background: #E25B2A;
  }

  .contact-banner-subtitle {
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    max-width: 260px;
  }

  .contact-container {
    padding: 20px 16px 40px;
    gap: 40px;
  }

  .contact-form-row {
    grid-template-columns: 1fr;
  }

  .contact-methods {
    padding: 20px 0;
  }

  .contact-methods-inner {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    padding: 0 clamp(16px, 8.5vw, 44px);
    align-items: stretch;
  }

  .contact-method-divider {
    display: none;
  }

  .contact-method-card {
    flex: none;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 14px 0;
    text-align: left;
    border: none;
    border-bottom: 1px solid #999999;
    animation: none;
    opacity: 1;
  }

  .contact-method-card:last-child {
    border-bottom: none;
  }

  .contact-method-label {
    display: inline-flex;
    flex: 0 0 auto;
    font-size: clamp(12px, 3.55vw, 14px);
    font-weight: 700;
    color: #E25B2A;
    margin-right: 0;
    line-height: 1.5;
    white-space: nowrap;
  }

  .contact-method-value {
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    font-size: clamp(12px, 3.55vw, 14px);
    font-weight: 400;
    color: #333333;
    margin-top: 0;
    margin-right: 0;
    line-height: 1.5;
    white-space: nowrap;
  }

  .contact-method-note {
    display: inline-flex;
    flex: 0 1 auto;
    min-width: 0;
    font-size: clamp(12px, 3.55vw, 14px);
    font-weight: 400;
    color: #333333;
    margin-top: 0;
    line-height: 1.5;
    white-space: nowrap;
  }

  .contact-method-note.is-link {
    text-decoration: none;
    color: #333333;
  }

  /* ── 聯絡表單（行動版） ── */
  .contact-form-section .contact-section-header {
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
  }

  .contact-form-section .contact-section-title {
    font-size: 18px;
    font-weight: 700;
  }

  .contact-form-section .contact-section-underline {
    width: 140px;
    height: 2px;
    background: #E25B2A;
  }

  .contact-form {
    gap: 16px;
  }

  .contact-form-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .contact-form-group {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
  }

  .contact-form-group:has(.contact-form-textarea) {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .contact-form-label {
    flex: 0 0 84px;
    width: 84px;
    font-size: 14px;
    color: #333333;
    white-space: nowrap;
  }

  .contact-form-group:has(.contact-form-textarea) .contact-form-label {
    flex: none;
    width: auto;
    white-space: normal;
  }

  .contact-form-input,
  .contact-form-textarea {
    background-color: #FFF9E8;
    border-radius: 4px;
  }

  .contact-form-input,
  .contact-form-select-wrap {
    flex: 1;
    min-width: 0;
    max-width: 100%;
  }

  .contact-form-input,
  .contact-form-select {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
  }

  .contact-form-select-wrap .contact-form-select {
    width: 100%;
  }

  .contact-form-select {
    background-color: #FFF9E8;
    border-radius: 4px;
    background-image: none;
    padding-right: 12px;
  }

  .contact-form-select-arrow {
    display: block;
    position: absolute;
    top: 50%;
    left: 0;
    width: 12px;
    height: 7.5px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7.5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888888'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
  }

  .contact-form-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
  }

  .contact-form-input:focus,
  .contact-form-select:focus,
  .contact-form-textarea:focus {
    box-shadow: none;
  }

  .contact-form-input::placeholder {
    color: transparent;
  }

  .contact-form-error {
    flex: 0 0 100%;
    padding-left: 96px;
  }

  .contact-form-group:has(.contact-form-textarea) .contact-form-error {
    padding-left: 0;
  }

  .contact-form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
  }

  .contact-form-submit {
    width: 100%;
    min-width: unset;
    height: 48px;
    background: #E25B2A;
    border-radius: 4px;
  }

  .contact-form-submit:hover {
    background: #D04E22;
  }

  .contact-form-required-note {
    align-self: flex-start;
    font-size: 12px;
    color: #888888;
  }

  /* ── 門市據點（行動版） ── */
  .contact-stores-section .contact-section-header {
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
  }

  .contact-stores-section .contact-section-title {
    font-size: 18px;
    font-weight: 700;
  }

  .contact-stores-section .contact-section-underline {
    width: 88px;
    height: 2px;
    background: #E25B2A;
  }

  .contact-map-wrap {
    height: 180px;
    margin-bottom: 16px;
    border: none;
  }

  .contact-store-divider {
    display: none;
  }

  .contact-store-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0 0 20px;
  }

  .contact-store-card:not(:first-child) {
    padding-top: 20px;
    border-top: 1px solid #EEEEEE;
  }

  .contact-store-card:hover {
    background: none;
  }

  .contact-store-num {
    display: none;
  }

  .contact-store-info {
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .contact-store-name {
    font-size: 16px;
    font-weight: 700;
    color: #E25B2A;
  }

  .contact-store-address {
    font-size: 13px;
    color: #555555;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .contact-store-detail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888888;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .contact-store-phone,
  .contact-store-hours {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .contact-store-phone-icon {
    flex-shrink: 0;
  }

  .contact-store-detail-sep {
    color: #CCCCCC;
  }

  .contact-stores-btn {
    display: flex;
    width: 100%;
    max-width: 280px;
    height: 40px;
    margin: 4px auto 0;
    border: 1px solid #E25B2A;
    color: #E25B2A;
    background: #FFFFFF;
    font-size: 14px;
    font-weight: 400;
  }

  .contact-stores-btn:hover {
    background: #FFFFFF;
    color: #E25B2A;
    opacity: 0.85;
  }
}

@media screen and (max-width: 480px) {
  .contact-banner {
    height: 120px;
  }

  .contact-banner-title {
    font-size: 20px;
  }

  .contact-banner-underline {
    width: 72px;
  }

  .contact-banner-subtitle {
    font-size: 11px;
    max-width: 240px;
  }

  .contact-methods {
    padding: 16px 0;
  }

  .contact-stores-btn {
    width: 100%;
  }

  .contact-map-wrap {
    height: 180px;
  }
}
