/* ===================================================================
   PawMart 组件样式 — 首页 / 产品 / 购物车 / 结账 / 后台
   =================================================================== */

/* ── 首页 Hero ──────────────────────────────── */
.hero {
  background:
    radial-gradient(900px 400px at 80% -10%, var(--brand-soft), transparent 60%),
    radial-gradient(700px 380px at 0% 0%, #fef3c7, transparent 55%);
  padding: 70px 0 60px;
}
.hero .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 50px; align-items: center;
}
.hero h1 {
  font-size: 46px; line-height: 1.1; letter-spacing: -1.4px; margin-bottom: 18px;
}
.hero h1 .hl { color: var(--brand-dark); }
.hero p { font-size: 17.5px; color: var(--text-soft); margin-bottom: 28px; max-width: 460px; }
.hero-actions { display: flex; gap: 12px; }
.hero-img {
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 6px solid #fff;
}
.hero-img img { width: 100%; height: 100%; object-fit: cover; }

.trust-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 36px 24px;
}
.trust-item {
  display: flex; align-items: center; gap: 12px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.trust-item .ico {
  width: 42px; height: 42px; border-radius: 11px; background: var(--brand-soft);
  display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
}
.trust-item b { display: block; font-size: 14.5px; }
.trust-item span { font-size: 12.5px; color: var(--text-faint); }

/* ── 分类条 ─────────────────────────────────── */
.cat-bar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 26px; }
.cat-chip {
  padding: 8px 16px; border-radius: 22px; border: 1px solid var(--border);
  background: var(--surface); font-size: 14px; font-weight: 500;
  color: var(--text-soft); transition: all .16s;
}
.cat-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.cat-chip.active {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}

.search-box { position: relative; max-width: 360px; margin-left: auto; }
.search-box input {
  width: 100%; padding: 9px 14px 9px 38px; border: 1px solid var(--border);
  border-radius: 22px; font-size: 14px; background: var(--surface);
}
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }

.shop-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* ── 产品网格 ───────────────────────────────── */
.product-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 22px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s; cursor: pointer; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-card .thumb { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 15px 16px 17px; display: flex; flex-direction: column; flex: 1; }
.product-card .cat { font-size: 12px; color: var(--brand-dark); font-weight: 600; margin-bottom: 5px; }
.product-card h3 { font-size: 16px; letter-spacing: -0.2px; margin-bottom: 6px; }
.product-card .desc {
  font-size: 13px; color: var(--text-soft); margin-bottom: 14px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card .foot { display: flex; align-items: center; justify-content: space-between; }
.price { font-size: 19px; font-weight: 800; letter-spacing: -0.5px; }
.price .cur { font-size: 13px; font-weight: 600; color: var(--text-soft); margin-right: 1px; }
.rating { font-size: 12.5px; color: var(--text-faint); }

/* ── 产品详情 ───────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
.detail-gallery {
  border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); position: sticky; top: 90px;
}
.detail-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.detail-info .cat { color: var(--brand-dark); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.detail-info h1 { font-size: 32px; letter-spacing: -0.8px; margin-bottom: 12px; }
.detail-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; color: var(--text-soft); font-size: 14px; }
.detail-price { font-size: 34px; font-weight: 800; letter-spacing: -1px; margin: 18px 0; }
.detail-section { margin: 26px 0; }
.detail-section h3 { font-size: 16px; margin-bottom: 10px; }
.detail-section p { color: var(--text-soft); line-height: 1.8; }
.spec-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spec-list li {
  padding: 11px 14px; background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 8px;
}
.spec-list li::before { content: "✓"; color: var(--brand); font-weight: 800; }
.qty-row { display: flex; align-items: center; gap: 14px; margin: 24px 0; }
.qty-ctrl { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qty-ctrl button { width: 40px; height: 42px; border: none; background: var(--surface); font-size: 18px; color: var(--text-soft); }
.qty-ctrl button:hover { background: var(--surface-2); }
.qty-ctrl input { width: 50px; height: 42px; border: none; text-align: center; font-size: 15px; font-weight: 600; }
.qty-ctrl input:focus { outline: none; }

/* ── 购物车 / 结账布局 ──────────────────────── */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 0.9fr; gap: 32px; align-items: start; }
.cart-line { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: none; }
.cart-line .thumb { width: 78px; height: 78px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0; background: var(--surface-2); }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info h4 { font-size: 15px; margin-bottom: 3px; }
.cart-line .info .cat { font-size: 12px; color: var(--text-faint); }
.cart-line .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.link-danger { color: var(--danger); font-size: 13px; background: none; border: none; padding: 0; }
.link-danger:hover { text-decoration: underline; }

.summary { position: sticky; top: 90px; padding: 24px; }
.summary h3 { font-size: 18px; margin-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14.5px; color: var(--text-soft); }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; font-size: 19px; font-weight: 800; color: var(--text); }

#payment-element { margin: 18px 0; }
#payment-message { font-size: 13.5px; color: var(--danger); margin-top: 10px; min-height: 18px; }

/* ── 认证页 ─────────────────────────────────── */
.auth-wrap { max-width: 420px; margin: 50px auto; }
.auth-card { padding: 34px 32px; }
.auth-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--text-soft); margin-bottom: 26px; font-size: 14.5px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-soft); }
.auth-switch a { color: var(--brand-dark); font-weight: 600; }

/* ── 账户 / 后台通用：侧栏布局 ──────────────── */
.dash { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.side-nav { position: sticky; top: 90px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm);
  color: var(--text-soft); font-size: 14.5px; font-weight: 500; margin-bottom: 3px; transition: all .14s;
}
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat {
  padding: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 13px; color: var(--text-faint); margin-bottom: 6px; }
.stat .num { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; padding: 12px 14px; color: var(--text-faint); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--border); }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:hover td { background: var(--surface-2); }
table.data .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; color: var(--text-soft); }

/* 模态框 */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); z-index: 100;
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; animation: toastIn .2s ease;
}
.modal-head { padding: 22px 26px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 24px 26px; }
.modal-foot { padding: 16px 26px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { width: 34px; height: 34px; border-radius: 9px; border: none; background: var(--surface-2); font-size: 18px; color: var(--text-soft); }
.close-x:hover { background: var(--border); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.key-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-top: 6px; }

@media (max-width: 900px) {
  .hero .inner { grid-template-columns: 1fr; gap: 32px; }
  .hero h1 { font-size: 36px; }
  .detail-grid { grid-template-columns: 1fr; gap: 28px; }
  .detail-gallery { position: static; }
  .checkout-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .dash { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; gap: 6px; overflow-x: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .trust-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .grid-2, .spec-list { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
