/* =========================================================
   义乌市牌礼餐饮管理有限公司 · 高端手机商城
   共享样式表
   ========================================================= */

:root {
  --color-primary: #5a0f1f;        /* 深酒红 */
  --color-primary-dark: #3d0814;
  --color-accent: #c9a24a;         /* 香槟金 */
  --color-accent-light: #e8d39a;
  --color-bg: #faf7f2;             /* 米白底色 */
  --color-surface: #ffffff;
  --color-text: #2a1810;
  --color-text-soft: #6b5a4a;
  --color-border: #ede4d3;
  --color-success: #2e7d32;
  --shadow-sm: 0 2px 8px rgba(90, 15, 31, 0.06);
  --shadow-md: 0 6px 20px rgba(90, 15, 31, 0.10);
  --shadow-lg: 0 12px 40px rgba(90, 15, 31, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-main: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--color-bg);
  font-family: var(--font-main);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  max-width: 480px;
  margin: 0 auto;
  background: var(--color-bg);
  position: relative;
  padding-bottom: 90px;
}

a {
  text-decoration: none;
  color: inherit;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- 顶部品牌栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 14px 18px 12px;
  box-shadow: var(--shadow-md);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--color-primary-dark);
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 11px;
  color: var(--color-accent-light);
  letter-spacing: 1px;
  margin-top: 1px;
}

.contact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(201, 162, 74, 0.4);
  color: var(--color-accent-light);
}

.contact-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------- 联系方式条 ---------- */
.contact-bar {
  margin-top: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(201, 162, 74, 0.25);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.contact-bar .item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f3ece0;
  min-width: 0;
}

.contact-bar .item svg {
  width: 14px;
  height: 14px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.contact-bar .item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 18px 16px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary-dark);
  position: relative;
  padding-left: 12px;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-primary));
}

.section-title .more {
  font-size: 12px;
  color: var(--color-text-soft);
}

/* ---------- 类目导航 ---------- */
.categories {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  box-shadow: var(--shadow-sm);
}

.category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.category:active {
  transform: scale(0.92);
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, #fff6e6 0%, #fbe9c4 100%);
  border: 1px solid var(--color-border);
}

.category-name {
  font-size: 12px;
  color: var(--color-text);
  font-weight: 500;
}

/* ---------- 精选横幅 ---------- */
.hero-banner {
  margin: 18px 16px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 150px;
  background: linear-gradient(120deg, var(--color-primary) 0%, #7a1530 60%, var(--color-accent) 130%);
  box-shadow: var(--shadow-md);
}

.hero-banner .hero-text {
  position: absolute;
  inset: 0;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  z-index: 2;
}

.hero-banner .hero-tag {
  display: inline-block;
  font-size: 11px;
  background: rgba(201, 162, 74, 0.9);
  color: var(--color-primary-dark);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.hero-banner .hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.hero-banner .hero-desc {
  font-size: 12px;
  color: var(--color-accent-light);
  letter-spacing: 0.5px;
}

.hero-banner .hero-deco {
  position: absolute;
  right: -30px;
  top: -30px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,74,0.5) 0%, transparent 70%);
  z-index: 1;
}

/* ---------- 产品列表 ---------- */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.product-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.product-card:active {
  transform: scale(0.97);
}

.product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f0ebe0;
}

.product-info {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 39px;
}

.product-tag {
  font-size: 10px;
  color: var(--color-accent);
  background: rgba(201, 162, 74, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  width: fit-content;
  border: 1px solid rgba(201, 162, 74, 0.3);
}

.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  color: var(--color-primary);
  font-weight: 800;
}

.product-price .currency {
  font-size: 13px;
}

.product-price .amount {
  font-size: 19px;
}

.product-sales {
  font-size: 11px;
  color: var(--color-text-soft);
}

/* ---------- 底部 Tab ---------- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  padding: 8px 0 10px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--color-text-soft);
  cursor: pointer;
}

.tab-item.active {
  color: var(--color-primary);
}

.tab-item svg {
  width: 22px;
  height: 22px;
}

/* =========================================================
   详情页 / 下单页 样式
   ========================================================= */

.back-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.back-btn svg {
  width: 18px;
  height: 18px;
}

.back-title {
  font-size: 16px;
  font-weight: 600;
}

.detail-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f0ebe0;
}

.detail-main {
  background: var(--color-surface);
  margin: -20px 0 0;
  border-radius: 20px 20px 0 0;
  position: relative;
  padding: 18px 16px 16px;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-price {
  color: var(--color-primary);
  font-weight: 800;
}

.detail-price .currency {
  font-size: 16px;
}

.detail-price .amount {
  font-size: 30px;
}

.detail-origin {
  font-size: 14px;
  color: var(--color-text-soft);
  text-decoration: line-through;
}

.detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 8px;
}

.detail-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--color-text-soft);
  margin-bottom: 14px;
}

.detail-meta .meta-sales {
  color: var(--color-accent);
  font-weight: 600;
}

.detail-desc {
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.7;
  padding: 12px 0;
  border-top: 1px dashed var(--color-border);
  border-bottom: 1px dashed var(--color-border);
}

/* ---------- 数量选择 ---------- */
.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.qty-label {
  font-size: 14px;
  font-weight: 600;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--color-bg);
  border-radius: 8px;
  overflow: hidden;
}

.qty-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--color-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.qty-btn:active {
  background: var(--color-bg);
}

.qty-value {
  width: 44px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

/* ---------- 地址表单 ---------- */
.form-card {
  background: var(--color-surface);
  margin: 14px 16px;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.form-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-card-title::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--color-accent), var(--color-primary));
}

.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--color-text-soft);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.15);
  background: var(--color-surface);
}

textarea.form-input {
  height: 72px;
  padding: 10px 12px;
  resize: none;
  line-height: 1.5;
}

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

/* ---------- 订单汇总 ---------- */
.summary-card {
  background: var(--color-surface);
  margin: 14px 16px;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--color-text-soft);
}

.summary-row.total {
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 14px;
  color: var(--color-text);
}

.summary-row.total .total-price {
  color: var(--color-primary);
  font-size: 22px;
  font-weight: 800;
}

.summary-row.total .total-price .currency {
  font-size: 14px;
}

/* ---------- 底部结算栏 ---------- */
.checkout-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 10px 16px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}

.checkout-price {
  display: flex;
  flex-direction: column;
}

.checkout-price .label {
  font-size: 11px;
  color: var(--color-text-soft);
}

.checkout-price .value {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-primary);
}

.checkout-price .value .currency {
  font-size: 13px;
}

.checkout-btn {
  flex: 1;
  max-width: 200px;
  height: 46px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #7a1530 100%);
  color: #fff;
  border-radius: 23px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  box-shadow: 0 6px 16px rgba(90, 15, 31, 0.3);
  transition: transform 0.15s;
}

.checkout-btn:active {
  transform: scale(0.97);
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 360px;
  padding: 28px 22px 22px;
  text-align: center;
  animation: pop 0.25s ease;
}

@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.modal-icon svg {
  width: 34px;
  height: 34px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.modal-text {
  font-size: 13px;
  color: var(--color-text-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #7a1530 100%);
  color: #fff;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 2000;
  display: none;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  display: block;
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-soft);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}
