/* ==========================================================================
   base.css — 設計 tokens、reset、共用元件（按鈕 / 徽章 / 卡片 / 標題）
   色票取自 Figma「YouCatHome」設計稿
   ========================================================================== */

:root {
  /* 色彩 */
  --c-bg: #f3f3f3; /* 頁面底色 */
  --c-surface: #ffffff; /* 卡片、白色區塊 */
  --c-dark: #171413; /* 深色按鈕、footer 文字 */
  --c-header: #2d2921; /* header 深棕 */
  --c-text: #171413;
  --c-muted: #7b7b7b;
  --c-muted-2: #8a8a8a;
  --c-border: #d8d8d8;
  --c-accent: #fe811e; /* 橘色點綴（愛心、active 標記） */
  --c-accent-2: #f19e63; /* 淺橘 icon */
  --c-cream: #ffffd9; /* hero 主按鈕 */

  /* 字體 */
  --font-sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', 'Heiti TC', sans-serif;

  /* 圓角 */
  --r-card: 16px;
  --r-box: 24px;
  --r-img: 8px;
  --r-pill: 999px;

  /* 版面 */
  --container: 1344px;
  --header-h: 80px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  font-size: 16px;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
  padding: 0;
}
ul,
ol {
  list-style: none;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}
body.no-scroll {
  overflow: hidden;
}

/* ---------- 版面容器 ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 96px);
  margin-inline: auto;
  padding-inline: 48px;
}

.section {
  padding-block: 60px;
}

/* ---------- 區塊標題（badge + 大標） ---------- */
.section-head {
  text-align: center;
  margin-bottom: 48px;
}
.badge {
  display: inline-block;
  padding: 9px 15px; /* Figma 10/16，border 內縮故各 -1px */
  border: 1px solid #d8d8d8;
  border-radius: var(--r-pill);
  background: transparent;
  font-size: 14px;
  line-height: 1.35;
  color: #000;
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.37;
  letter-spacing: 0.06em;
  color: var(--c-dark);
}

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--r-pill);
  font-size: 16px;
  line-height: 22px; /* Figma 16/22 */
  padding: 16px 24px; /* Figma 16/24 → 高 54 */
  transition:
    opacity 0.2s,
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}
.btn:hover {
  opacity: 0.85;
}

.btn--dark {
  background: var(--c-dark);
  color: #d9d9d9; /* Figma */
  font-size: 14px;
  line-height: 19px;
} /* Figma 了解更多 14/19，高 51 */
/* 預約一場相遇：白 50% 底＋毛玻璃＋橘色光暈（Figma node 223:2719） */
.btn--cream {
  color: var(--c-dark);
  padding: 16px 24px; /* 無框（Figma 桌機 hero 無 stroke） */
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(50px);
  backdrop-filter: blur(50px);
  box-shadow: 0 24px 70px 0 #ff9434;
}
.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 15px 23px;
}
.btn--outline {
  border: 1px solid rgba(123, 123, 123, 0.2);
  background: transparent; /* 透出卡底（Figma 無填色） */
  color: var(--c-text);
  padding: 15px 23px;
}

.btn .arrow {
  font-family: sans-serif;
}

/* 置中的「了解更多」 */
.section-more {
  text-align: center;
  margin-top: 48px;
}

/* ---------- <app-icon> 對齊：消除 inline baseline 空隙，與文字垂直置中 ---------- */
app-icon {
  display: inline-flex;
  align-items: center;
  flex: none;
}
app-icon svg {
  display: block;
}

/* ---------- 圓形 icon 按鈕 ---------- */
.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-dark);
  transition: transform 0.2s;
}
.icon-circle:hover {
  transform: translateY(-2px);
}
.icon-circle--light {
  width: 26px;
  height: 26px;
  background: #fff;
  color: var(--c-dark);
}

/* ---------- 貓咪卡片 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px; /* Figma 卡距 24 */
}
.cat-card {
  background: #fcfcfc;
  border-radius: var(--r-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px; /* photo↔文字區↔按鈕 */
}
/* 點名字／照片開彈窗 */
.cat-card__name,
.cat-card__photo {
  cursor: pointer;
}
.cat-card__name:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.cat-card__photo {
  width: 100%;
  aspect-ratio: 3 / 4; /* Figma 270x360 */
  object-fit: cover;
  border-radius: 12px;
}
.cat-card__name {
  font-size: 16px;
  font-weight: 700;
  line-height: 22px; /* Figma 16/22 */
}
.cat-card__meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: var(--c-muted);
  margin-top: -4px; /* name↔meta 12 */
}
.cat-card__meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px; /* Figma */
}
.cat-card__price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 18px; /* Figma 18/25/#7B7B7B 400 */
  font-weight: 400;
  line-height: 25px;
  color: var(--c-muted);
  margin-top: -4px; /* meta↔price 12 */
}
.cat-card .btn {
  width: 100%;
}

/* hover：整張卡片浮起、按鈕換成深色「聯繫我們 →」＋腳掌裝飾（對應設計稿兩態） */
.cat-card {
  transition:
    transform 0.25s,
    box-shadow 0.25s;
}
.cat-card:hover {
  box-shadow: 0 34px 30px rgba(0, 0, 0, 0.06); /* Figma：無位移 */
}

/* 兩態 CTA 切換動畫：兩組文字疊同一格，滾動翻牌＋腳掌彈入 */
.cat-card__cta {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  justify-items: center;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}
.cat-card__cta:hover {
  opacity: 1;
} /* 蓋掉 .btn:hover 的透明度，避免疊加閃爍 */

.cat-card__cta-default,
.cat-card__cta-hover {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition:
    opacity 0.22s ease,
    transform 0.34s cubic-bezier(0.34, 1.3, 0.4, 1);
}
/* 待命：聯繫我們 藏在按鈕下緣 */
.cat-card__cta-hover {
  opacity: 0;
  transform: translateY(130%);
}

.cat-card:hover .cat-card__cta {
  background: var(--c-dark);
  border-color: var(--c-dark);
  color: #fff;
}
/* hover：想要預約 往上滾出、聯繫我們 從下滾入 */
.cat-card:hover .cat-card__cta-default {
  opacity: 0;
  transform: translateY(-130%);
}
.cat-card:hover .cat-card__cta-hover {
  opacity: 1;
  transform: translateY(0);
}

/* 箭頭跟著晚一拍滑入，強化方向感 */
.cat-card__cta-hover app-icon {
  transition:
    transform 0.3s ease 0.08s,
    opacity 0.25s ease 0.08s;
  transform: translateX(-6px);
  opacity: 0;
}
.cat-card:hover .cat-card__cta-hover app-icon {
  transform: translateX(0);
  opacity: 1;
}

/* 深色按鈕右側的腳掌：hover 時放大彈入（半透明白，微轉角度） */
.cat-card__cta-paws {
  position: absolute;
  right: 18px;
  top: 60%;
  display: flex;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.15); /* Figma 白 15% */
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) scale(0.4) rotate(-14deg);
   transform-origin: 70% 50%;
  transition:
    opacity 0.28s ease 0.12s,
    transform 0.38s cubic-bezier(0.34, 1.45, 0.45, 1) 0.12s;
}
.cat-card:hover .cat-card__cta-paws {
  opacity: 1;
  transform: translateY(-50%) rotate(0deg);
}

.cat-card__cta-paws app-icon:first-child {
  transform: rotate(33deg) translateX(-2px) translateY(2px);
}
.cat-card__cta-paws app-icon:nth-child(2) {
  transform: rotate(33deg) translateX(10px) translateY(-5px);
}
.cat-card__cta-paws app-icon:nth-child(3) {
  transform: rotate(33deg) translateX(-8px) translateY(2px);
}
.cat-card__cta-paws app-icon {
  display: block;
}

/* ---------- FAQ 手風琴 ---------- */
.faq-list {
  display: grid;
  gap: 16px;
  max-width: 1104px;
  margin-inline: auto;
}
.faq-item {
  background: transparent;
  border: 1px solid #d8d8d8;
  border-radius: var(--r-card);
  transition:
    background-color 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
/* 展開：白卡浮起＋右下角腳掌（Figma FAQ 兩態） */
.faq-item.is-open {
  position: relative;
  background: var(--c-surface);
  border-color: transparent;
  box-shadow: 0 34px 30px rgba(0, 0, 0, 0.06);
}
.faq-item.is-open::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 37px;
  height: 35px;
  background: url('../images/svg/PawPrint.svg') no-repeat center / contain;
  pointer-events: none;
}
.faq-item__q {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  text-align: left;
  font-size: 20px;
  line-height: 27px; /* Figma 20/27 */
  font-weight: 400; /* 收合 400、展開 700 */
}
.faq-item.is-open .faq-item__q {
  font-weight: 700;
  padding-bottom: 6px; /* Figma 題↔答 6 */
}
.faq-item__q .num {
  font-weight: 700;
}
.faq-item__q .toggle-icon {
  margin-left: auto;
  flex: none;
  position: relative;
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}
.faq-item__q .toggle-icon::before,
.faq-item__q .toggle-icon::after {
  content: '';
  position: absolute;
  inset: 50% auto auto 0;
  width: 100%;
  height: 2px;
  background: #7b7b7b; /* Figma toggle 色 */
  transform: translateY(-50%);
}
.faq-item__q .toggle-icon::after {
  transform: translateY(-50%) rotate(90deg);
}
.faq-item.is-open .toggle-icon {
  transform: rotate(45deg);
} /* ＋ 轉 45° 變 ✕ */

.faq-item__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}
.faq-item__a > div {
  overflow: hidden;
}
.faq-item.is-open .faq-item__a {
  grid-template-rows: 1fr;
}
.faq-item__a p,
.faq-item__a ol {
  padding: 0 24px 24px;
  color: #7b7b7b;
  font-size: 16px;
  line-height: 35px; /* Figma 16/35 */
}
.faq-item__a ol {
  list-style: decimal inside; /* 標號齊左（Figma 無縮排） */
}
.faq-item__a ol li strong {
  color: var(--c-text);
}

/* ---------- 通用文字卡片（安心承諾 / 我們的責任） ---------- */
.info-card {
  position: relative;
  overflow: hidden; /* 腳掌貼角被裁（同 Figma） */
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: 24px; /* Figma */
  transition:
    background-color 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.info-card h3 {
  font-size: 20px; /* Figma 20/27 */
  font-weight: 700;
  line-height: 27px;
  margin-bottom: 6px;
}
.info-card p {
  font-size: 16px; /* Figma 16/35/#7B7B7B */
  color: #7b7b7b;
  line-height: 35px;
}

/* hover：白底浮起＋右下角腳掌浮現（對應設計稿兩態） */
.info-card::after {
  content: '';
  position: absolute;
  right: -5px; /* 貼角外溢（Figma 被卡緣裁切） */
  bottom: -5px;
  width: 37px;
  height: 35px;
  background: url('../images/svg/PawPrint.svg') no-repeat center / contain;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.info-card:hover {
  background: var(--c-surface);
  border-color: transparent;
  box-shadow: 0 34px 30px rgba(0, 0, 0, 0.06); /* Figma 系統陰影 */
}
.info-card:hover::after {
  opacity: 1;
}
