/* ============================================================
   KnitTestShop · Shopify Dawn / "Krown" 主题复刻
   配色取自 lawsknitters 主题导出（settings_data.json）
     --bg      #e0bb88  沙色
     --text    #6c4c33  暖棕
     --accent  #c89156  金棕
     --sale    #f1485b  品红
   字体：BioRhyme（标题衬线）+ Alegreya Sans（正文）
   ============================================================ */

:root {
  --color-background: #e0bb88;
  --color-background-secondary: #d6ad77;
  --color-background-rgb: 224, 187, 136;
  --color-text: #6c4c33;
  --color-text-rgb: 108, 76, 51;
  --color-text-foreground: #ffffff;
  --color-accent: #c89156;
  --color-accent-foreground: #ffffff;
  --color-sales: #f1485b;
  --color-borders: rgba(108, 76, 51, 0.16);
  --color-borders-strong: rgba(108, 76, 51, 0.30);

  --font-headings: "BioRhyme", Georgia, "Times New Roman", serif;
  --font-body: "Alegreya Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1280px;
  --gutter: 22px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-headings);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.08;
  margin: 0 0 .4em;
  letter-spacing: .2px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- 公告条 ---------- */
.announcement-bar {
  background: #2a1c12;
  color: #f3e9da;
  font-size: 13px;
  letter-spacing: .4px;
  text-align: center;
  padding: 9px 40px 9px 12px;
  position: relative;
}
.announcement-bar a { text-decoration: underline; text-underline-offset: 3px; }
.announcement-bar__exit {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  opacity: .8;
}
.announcement-bar__exit:hover { opacity: 1; }
.announcement-bar__exit svg { width: 13px; height: 13px; fill: #f3e9da; display: block; }
body:not(.show-announcement-bar) .announcement-bar { display: none; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-borders);
}
.site-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
}
.header-left { display: flex; align-items: center; gap: 18px; }
.header-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }

.menu-opener {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 6px 0;
}
.menu-opener .lines { display: inline-flex; flex-direction: column; gap: 4px; width: 22px; }
.menu-opener .lines span { height: 2px; background: var(--color-text); display: block; }

.site-logo {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 27px;
  letter-spacing: 1px;
  text-align: center;
  color: var(--color-text);
  white-space: nowrap;
}
.site-logo span { color: var(--color-accent); }

.header-icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--color-text);
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.header-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--color-text); stroke-width: 1.6; }
.cart-count {
  background: var(--color-accent);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ---------- 侧边抽屉菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(86vw, 380px);
  background: var(--color-background);
  z-index: 90;
  transform: translateX(-100%);
  transition: transform .35s ease;
  box-shadow: 0 0 60px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gutter);
  border-bottom: 1px solid var(--color-borders);
}
.drawer__close { background: none; border: 0; cursor: pointer; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--color-text); }
.drawer__body { padding: 24px var(--gutter); overflow-y: auto; }
.drawer__body a {
  display: block;
  font-family: var(--font-headings);
  font-size: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-borders);
}
.drawer__overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 85;
}
.drawer__overlay.show { opacity: 1; pointer-events: auto; }

/* ---------- 通用区块 ---------- */
.section { padding: 64px 0; }
.section--alt { background: var(--color-background-secondary); }
.section-head {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 34px;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 46px);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.section-head .rule { flex: 1; height: 1px; background: var(--color-borders-strong); }
.section-note { font-size: 15px; opacity: .8; margin: -18px 0 28px; }

/* ---------- HERO (slider-vertical) ---------- */
.hero { position: relative; }
.hero__slide {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero__slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(42,28,18,.28), rgba(42,28,18,.46));
}
.hero__content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
  color: #fbf3e6;
  text-align: center;
}
.hero__kicker {
  font-size: 13px; letter-spacing: 3px; text-transform: uppercase;
  opacity: .92; margin-bottom: 18px;
}
.hero__title {
  color: #fbf3e6;
  font-size: clamp(54px, 11vw, 150px);
  line-height: .92;
  margin: 0;
  text-shadow: 0 4px 30px rgba(0,0,0,.35);
}
.hero__title .accent { color: #f6d9a8; display: block; }
.hero__captions {
  margin-top: 22px;
  font-size: 17px; letter-spacing: 1px;
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.hero__captions .dot { opacity: .6; }
.btn-hero {
  display: inline-block;
  margin-top: 30px;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 14px;
  padding: 15px 34px;
  border-radius: 2px;
  transition: background .2s, transform .2s;
}
.btn-hero:hover { background: #b8813f; transform: translateY(-2px); }
.btn-hero.outline { background: transparent; border: 2px solid var(--color-text); color: var(--color-text); }
.btn-hero.outline:hover { background: var(--color-text); color: #fff; }

.hero__dots { text-align: center; padding: 14px 0; display: flex; gap: 10px; justify-content: center; }
.hero__dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; background: var(--color-borders-strong); cursor: pointer; }
.hero__dots button.active { background: var(--color-accent); }

/* ---------- 富文本 ---------- */
.rich-text { text-align: center; padding: 70px 0; }
.rich-text h3 {
  font-size: clamp(22px, 3vw, 34px);
  max-width: 880px; margin: 0 auto; line-height: 1.3; font-weight: 400;
}

/* ---------- 产品滑块 ---------- */
.products-slider { position: relative; }
.products-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.products-track::-webkit-scrollbar { height: 6px; }
.products-track::-webkit-scrollbar-thumb { background: var(--color-borders-strong); border-radius: 6px; }
.product-card {
  flex: 0 0 270px;
  scroll-snap-align: start;
  background: transparent;
}
.product-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--color-background-secondary);
  overflow: hidden;
  border-radius: 3px;
}
.product-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
}
.product-card:hover .product-card__media img { transform: scale(1.06); }
.product-card__tag {
  position: absolute; top: 12px; left: 12px;
  background: #fff; color: var(--color-text);
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px;
}
.product-card__title {
  font-family: var(--font-headings);
  font-size: 19px; margin: 14px 0 4px;
}
.product-card__price { font-size: 15px; opacity: .85; }
.product-card__price .sale { color: var(--color-sales); margin-right: 8px; }

/* ---------- 图文区 (image-with-text) ---------- */
.iwt { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 50px; }
.iwt__media img { width: 100%; border-radius: 3px; }
.iwt__title { font-size: clamp(30px, 4.5vw, 56px); margin: 0 0 14px; }
.iwt__text { font-size: 17px; max-width: 460px; }
.iwt__link {
  display: inline-block; margin-top: 18px;
  font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; font-size: 14px;
  border-bottom: 2px solid var(--color-accent); padding-bottom: 4px;
}
.iwt--right .iwt__media { order: 2; }

/* ---------- 特性 (toggles-with-icons) ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.feature { text-align: center; }
.feature__icon {
  width: 56px; height: 56px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--color-accent); border-radius: 50%;
  color: var(--color-accent);
}
.feature__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.feature h4 { font-size: 19px; margin: 0 0 6px; }
.feature p { font-size: 15px; opacity: .85; margin: 0; }

/* ---------- CTA 行 ---------- */
.cta-row { text-align: center; margin-top: 40px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #2a1c12; color: #e9dcc8; padding: 60px 0 26px; }
.site-footer a { color: #e9dcc8; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 40px;
}
.footer-brand { font-family: var(--font-headings); font-size: 28px; margin-bottom: 14px; }
.footer-brand span { color: var(--color-accent); }
.footer-tag { font-size: 15px; opacity: .85; max-width: 280px; }
.footer-col h5 { color: #f3e9da; font-size: 14px; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 14px; }
.footer-col a { display: block; padding: 6px 0; font-size: 15px; opacity: .85; }
.footer-col a:hover { opacity: 1; text-decoration: underline; }
.newsletter p { font-size: 14px; opacity: .85; margin: 0 0 12px; }
.newsletter__form { display: flex; gap: 8px; }
.newsletter__form input {
  flex: 1; padding: 11px 12px; border: 1px solid #5a4733;
  background: #1f140b; color: #f3e9da; border-radius: 2px; font-family: var(--font-body); font-size: 14px;
}
.newsletter__form button {
  background: var(--color-accent); color: #fff; border: 0; border-radius: 2px;
  padding: 0 18px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; cursor: pointer;
}
.footer-social { display: flex; gap: 14px; margin-top: 18px; }
.footer-social a { width: 34px; height: 34px; border: 1px solid #5a4733; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.footer-social svg { width: 17px; height: 17px; fill: #e9dcc8; }
.footer-bottom {
  border-top: 1px solid #3a2a1c; margin-top: 44px; padding-top: 20px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 13px; opacity: .75;
}
.footer-bottom .powered { font-style: italic; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .iwt { grid-template-columns: 1fr; gap: 26px; }
  .iwt--right .iwt__media { order: 0; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
/* ==========================================================================
   手機 <640px：單欄、大觸控目標、公告條與 hero 重新配比
   ========================================================================== */
@media (max-width: 640px) {
  body { font-size: 16px; }

  /* 站頭：只留圖示，圖示放大到可單手點（≥44px） */
  .header-right .label, .menu-opener .label { display: none; }
  .menu-opener, .header-icon {
    min-width: 44px; min-height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .site-logo { font-size: 22px; letter-spacing: .5px; }
  .site-header__inner { gap: 8px; }

  /* 公告條：兩行也能讀，右側留出關閉鍵的點擊區 */
  .announcement-bar {
    font-size: 12px; line-height: 1.45;
    padding: 8px 44px 8px 14px;
    letter-spacing: .2px;
  }
  .announcement-bar__exit {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
  }

  /* HERO：標題不再撐滿，留出安全邊距 */
  .hero__slide { min-height: 62vh; }
  .hero__title { font-size: clamp(30px, 9.5vw, 44px); line-height: 1.08; }
  .hero__kicker { font-size: 12px; }
  .hero__captions { flex-wrap: wrap; row-gap: 4px; font-size: 14px; }
  .btn-hero { min-height: 48px; display: inline-flex; align-items: center; }

  /* 區塊標題與內距 */
  .section { padding: 38px 0; }
  .section-head h2 { font-size: 26px; }
  .rich-text h3 { font-size: 17px; line-height: 1.6; }

  .features { grid-template-columns: 1fr; gap: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }

  /* 商品卡片：橫向滑動加吸附，避免滑到半張卡 */
  .products-track { scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .product-card { scroll-snap-align: start; }
  .product-card__title { font-size: 14px; }

  /* 說明型文字不要在手機上過寬過小 */
  .section-note, .iwt__text p { font-size: 15px; line-height: 1.7; }
}

/* iPad 直立 641–1024px：兩欄卡片、hero 適中，觸控目標同樣放大 */
@media (min-width: 641px) and (max-width: 1024px) {
  .menu-opener, .header-icon { min-width: 44px; min-height: 44px; }
  .hero__title { font-size: clamp(40px, 6.5vw, 64px); }
  .announcement-bar { font-size: 12.5px; padding: 9px 44px 9px 16px; }
  .btn-hero { min-height: 46px; display: inline-flex; align-items: center; }
}
