/* ============================================================
   Xuejing Pets — Stylesheet
   Warm minimal / German market
   ============================================================ */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1a1a18;
  --muted: #6b6660;
  --line: #e5dfd6;
  --accent: #2e4a3d;
  --accent-ink: #ffffff;
  --accent-soft: #e9eee9;
  --warm: #b5643c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(26, 26, 24, .04), 0 8px 24px rgba(26, 26, 24, .06);
  --wrap: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.14; letter-spacing: -.022em; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 2.7vw, 2.15rem); }
h3 { font-size: 1.16rem; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; padding-left: 1.15em; }
li { margin-bottom: .4em; }
small { font-size: .83rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.section { padding: 84px 0; }
.section--tight { padding: 52px 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); font-weight: 650;
  margin-bottom: 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 247, 242, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; gap: 30px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.03em; font-size: 1.1rem; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: .78rem; font-weight: 700;
}
.nav { display: flex; gap: 26px; margin-left: auto; font-size: .93rem; }
.nav a { color: var(--muted); font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.cart-link {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line); background: var(--surface);
  padding: 8px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600;
}
.cart-count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .72rem;
  display: inline-grid; place-items: center;
}
.cart-count[data-empty="true"] { display: none; }

@media (max-width: 780px) {
  .nav { display: none; }
  .site-header__inner { height: 60px; gap: 12px; }
  .cart-link { margin-left: auto; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 620; font-size: .95rem; cursor: pointer;
  transition: transform .14s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #24392f; color: #fff; }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: #fff; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { padding: 76px 0 60px; }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.hero__media { border-radius: 22px; overflow: hidden; background: var(--accent-soft); box-shadow: var(--shadow); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1/1; }
.hero__lead { font-size: 1.12rem; color: var(--muted); max-width: 46ch; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 34px; }
  .hero { padding: 46px 0 36px; }
}

/* ---------- Trust bar ---------- */
.trust {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.trust div { background: var(--surface); padding: 20px 18px; font-size: .88rem; }
.trust strong { display: block; font-size: .95rem; margin-bottom: 3px; }
.trust span { color: var(--muted); }

@media (max-width: 860px) { .trust { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 18px; } }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 4/3; background: var(--accent-soft); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card__title { font-size: 1.06rem; font-weight: 640; margin: 0 0 6px; }
.card__desc { color: var(--muted); font-size: .9rem; margin: 0 0 16px; flex: 1; }
.price { font-weight: 700; font-size: 1.12rem; letter-spacing: -.01em; }
.price small { display: block; font-weight: 400; color: var(--muted); font-size: .74rem; letter-spacing: 0; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: .9rem; }
.badge {
  display: inline-block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
  padding: 4px 9px; border-radius: 6px; margin-bottom: 12px;
}

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: start; padding-top: 44px; }
@media (max-width: 900px) { .pdp { grid-template-columns: 1fr; gap: 30px; } }

.gallery__main { border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); border: 1px solid var(--line); }
.gallery__main img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.gallery__thumbs button {
  padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: none; cursor: pointer; aspect-ratio: 1/1;
}
.gallery__thumbs button[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pdp__price { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }
.pdp__price small { font-size: .78rem; font-weight: 400; color: var(--muted); display: block; margin-top: 4px; letter-spacing: 0; }

.spec-table { width: 100%; border-collapse: collapse; font-size: .91rem; margin: 22px 0 26px; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { color: var(--muted); font-weight: 500; width: 42%; }

.buybox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }

.usp { list-style: none; padding: 0; margin: 22px 0 0; }
.usp li { display: flex; gap: 10px; font-size: .9rem; color: var(--muted); margin-bottom: 10px; }
.usp li::before { content: "✓"; color: var(--accent); font-weight: 700; flex: none; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1.4fr .85fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }

.cart-item {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 16px; align-items: center;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.cart-item__img { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.cart-item__img img { aspect-ratio: 1/1; object-fit: cover; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 32px; height: 32px; border: 0; background: #fff; font-size: 1rem; cursor: pointer; color: var(--ink); }
.qty span { min-width: 30px; text-align: center; font-size: .9rem; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .82rem; cursor: pointer; text-decoration: underline; }

.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 88px; }
.summary__row { display: flex; justify-content: space-between; padding: 9px 0; font-size: .93rem; }
.summary__row--total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; font-weight: 700; font-size: 1.08rem; }

.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 14px 16px; font-size: .86rem; color: #2c443a; }
.notice--warn { background: #fdf3e7; color: #7a4a1e; }

.empty { padding: 70px 0; text-align: center; color: var(--muted); }

/* ---------- Legal pages ---------- */
.legal { max-width: 78ch; margin: 0 auto; padding: 54px 0 90px; }
.legal h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.legal h2 { font-size: 1.16rem; margin-top: 2.1em; }
.legal h3 { font-size: 1rem; margin-top: 1.5em; }
.legal p, .legal li { font-size: .95rem; }
.legal address { font-style: normal; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px 20px; margin: 18px 0; }
.todo { background: #fff3cd; padding: 1px 5px; border-radius: 4px; font-weight: 600; }
.legal__updated { color: var(--muted); font-size: .82rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 54px 0 40px; background: #f4f0e9; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
.site-footer h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 14px; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: .89rem; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 90px);
  background: var(--ink); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-size: .9rem; font-weight: 550; z-index: 200; opacity: 0;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
