/* ============================================
   SiteCloner Shop - 复刻 relxq.com 设计
   响应式适配 + 完整组件样式
   ============================================ */

:root {
  --bg-dark: #1a1a2e;
  --bg-darker: #0f0f1e;
  --accent: #e74c3c;
  --accent-hover: #c0392b;
  --text-dark: #222;
  --text-muted: #888;
  --border: #e8e8e8;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* === 基础 === */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text-dark);
  background: #f5f5f5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* === Header === */
.top-wrap {
  background: #111;
  font-size: 13px;
  padding: 6px 0;
}
.top-wrap .btn {
  font-size: 13px;
  padding: 2px 8px;
  border: none;
}
.top-wrap .dropdown-toggle::after { font-size: 10px; }

.header-content {
  background: var(--bg-dark);
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 1040;
}
.header-content .nav-link {
  color: rgba(255,255,255,.85) !important;
  padding: 8px 14px !important;
  font-size: 14px;
  transition: .2s;
  white-space: nowrap;
}
.header-content .nav-link:hover { color: #fff !important; }
.header-content .badge {
  font-size: 10px;
  padding: 2px 5px;
  vertical-align: middle;
  margin-left: 2px;
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 3px;
}

.header-mobile {
  background: var(--bg-dark);
}
.header-mobile a { color: rgba(255,255,255,.85) !important; }

/* === 首页模块 === */
.module-item {
  margin: 30px 0;
  background: #fff;
  padding: 28px 0;
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}

.module-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}
.wave-line {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #f39c12);
  margin: 8px auto 24px;
  border-radius: 2px;
}

/* === Banner === */
.module-slideshow {
  border-radius: 0;
}
.module-slideshow .swiper-button-prev,
.module-slideshow .swiper-button-next {
  color: #fff;
  background: rgba(0,0,0,.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.module-slideshow .swiper-button-prev::after,
.module-slideshow .swiper-button-next::after {
  font-size: 16px;
}

/* === 产品卡片 === */
.product-wrap {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .3s;
  margin-bottom: 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-wrap .image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: #fafafa;
}
.product-wrap .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.product-wrap:hover .image img { transform: scale(1.05); }

/* 确保产品名的链接不是蓝色 */
.product-wrap a {
  color: inherit !important;
  text-decoration: none !important;
}
.product-wrap a:hover {
  color: var(--accent) !important;
}

.button-wrap {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: all .3s;
}
.product-wrap:hover .button-wrap { opacity: 1; bottom: 16px; }
.button-wrap .btn {
  width: 36px;
  height: 36px;
  border-radius: 50% !important;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(0,0,0,.75);
  border: none;
  color: #fff;
  white-space: nowrap;
}
.button-wrap .btn-add-cart {
  width: auto;
  padding: 0 12px;
  border-radius: 20px !important;
  font-size: 12px;
  gap: 4px;
}
.button-wrap .btn:hover { background: var(--accent); }

.product-bottom-info {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  color: var(--text-dark) !important;
}
.product-name a {
  color: var(--text-dark) !important;
  font-weight: 500 !important;
}
.product-name a:hover { color: var(--accent) !important; }

.product-price { margin-top: auto; padding-top: 8px; }
.price-new {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.price-old {
  font-size: 13px;
  color: #bbb;
  text-decoration: line-through;
  margin-left: 8px;
}

/* === 产品详情 === */
.product-gallery {
  border-radius: var(--radius);
  overflow: hidden;
}
.product-gallery img {
  width: 100%;
  border-radius: var(--radius);
}

.product-info h1 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-dark);
}
.product-info .price-wrap {
  background: #fff5f5;
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.product-info .price-wrap .price-new { font-size: 28px; }

/* 变体选择按钮 */
.variant-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ddd;
  border-radius: 20px;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  background: #fff;
  color: #555;
  user-select: none;
  margin-bottom: 6px;
}
.variant-select:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.variant-select.active {
  border-color: var(--accent);
  background: #fff5f5;
  color: var(--accent);
  font-weight: 600;
}

.quantity-input {
  width: 120px;
  display: flex;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.quantity-input button {
  width: 36px;
  border: none;
  background: #f5f5f5;
  font-size: 18px;
  cursor: pointer;
  outline: none;
}
.quantity-input button:active { background: #ddd; }
.quantity-input input {
  width: 48px;
  border: none;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}

.btn-add-to-cart {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  transition: .2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-add-to-cart:hover { background: var(--accent-hover); color: #fff; }
.btn-buy-now {
  background: #ff9800;
  color: #fff;
  border: none;
  padding: 14px 40px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  transition: .2s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-buy-now:hover { background: #f57c00; color: #fff; text-decoration: none; }

/* === 购物车 === */
.cart-table th {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  padding: 12px;
}
.cart-table td {
  padding: 16px 12px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.cart-product-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* === 分类页 === */
.category-hero {
  background: linear-gradient(135deg, var(--bg-dark), #2d2d5e);
  color: #fff;
  padding: 60px 0;
  text-align: center;
}
.category-hero h1 {
  font-size: 32px;
  font-weight: 700;
}

/* === Footer === */
footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,.7);
  margin-top: 60px;
}
footer a {
  color: rgba(255,255,255,.7);
  transition: .2s;
}
footer a:hover { color: #fff; }
footer h6 { color: #fff; letter-spacing: 1px; }
.footer-bottom {
  background: var(--bg-darker);
  color: rgba(255,255,255,.5);
}

/* === 账户页面 === */
.account-sidebar {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.account-sidebar .nav-link {
  color: var(--text-dark);
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 4px;
  transition: .2s;
}
.account-sidebar .nav-link:hover,
.account-sidebar .nav-link.active {
  background: #fff5f5;
  color: var(--accent);
}

.order-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
}
.order-tabs .nav-link {
  color: var(--text-dark);
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  white-space: nowrap;
}
.order-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.order-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

/* === 支付页面 === */
.payment-methods {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.payment-method {
  flex: 1;
  min-width: 120px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
}
.payment-method:hover, .payment-method.active {
  border-color: var(--accent);
  background: #fff5f5;
}
.payment-method .bi { font-size: 36px; }

/* === 结算表单 === */
#checkoutForm .form-control,
#checkoutForm .form-select {
  border-radius: 6px;
  border: 2px solid var(--border);
  padding: 10px 14px;
}
#checkoutForm .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(231,76,60,.1);
}

/* === Swiper === */
.swiper { width: 100%; }
.swiper-slide img { width: 100%; }

/* === 辅助 === */
.bg-soft-pink { background: #fff5f5; }
.text-accent { color: var(--accent); }

.placeholder-img {
  background: linear-gradient(135deg, #e0e0e0, #f5f5f5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 48px;
}

/* ==========================================
   响应式 — 手机端适配
   ========================================== */

/* 平板 (≤991px) */
@media (max-width: 991.98px) {
  .header-content { display: none !important; }
  .header-mobile { display: block !important; }

  .module-item {
    margin: 16px 0;
    padding: 20px 10px;
  }
  .module-title { font-size: 20px; }
  .module-slideshow { max-height: 240px; }
  .module-slideshow img { max-height: 240px; object-fit: cover; }

  .category-hero { padding: 30px 16px; }
  .category-hero h1 { font-size: 22px; }

  .product-name { font-size: 12px; min-height: 34px; }
  .price-new { font-size: 16px; }
  .price-old { font-size: 11px; }

  .product-info h1 { font-size: 16px; }
  .product-info .price-wrap .price-new { font-size: 22px; }

  footer .row > div { margin-bottom: 16px; }
  .footer-content { padding: 24px 0; }

  .cart-table { font-size: 12px; }
  .cart-table th, .cart-table td { padding: 8px 4px; }
  .cart-product-img { width: 50px; height: 50px; }

  .order-card { padding: 12px; }

  .payment-methods { flex-direction: column; }
  .payment-method { padding: 12px; }

  /* 按钮适配 */
  .btn-add-to-cart,
  .btn-buy-now {
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* 手机 (≤767px) */
@media (max-width: 767.98px) {
  .container, .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }

  .module-item {
    margin: 10px 0;
    padding: 16px 4px;
    border-radius: 6px;
  }
  .module-title { font-size: 18px; }
  .wave-line { margin: 6px auto 16px; }

  .module-slideshow { max-height: 180px; }
  .module-slideshow img { max-height: 180px; }
  .swiper-button-prev, .swiper-button-next { display: none !important; }

  .category-hero { padding: 20px 12px; }
  .category-hero h1 { font-size: 20px; }

  /* 产品网格 — 两列 */
  .product-grid, [class*="col-"] {
    padding-left: 5px;
    padding-right: 5px;
  }
  .row.g-3, .row.g-4 {
    --bs-gutter-x: 8px;
  }

  .product-name {
    font-size: 11px;
    min-height: 30px;
    -webkit-line-clamp: 2;
  }
  .price-new { font-size: 14px; }
  .price-old { font-size: 10px; }
  .product-bottom-info { padding: 8px; }

  /* 手机端按钮常显 */
  .button-wrap {
    opacity: 1;
    bottom: 4px;
    gap: 3px;
  }
  .button-wrap .btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .button-wrap .btn-add-cart {
    width: auto;
    padding: 0 8px;
    font-size: 10px;
    border-radius: 14px !important;
  }

  /* 产品详情 */
  .product-info h1 { font-size: 15px; }
  .variant-select {
    padding: 6px 14px;
    font-size: 13px;
  }
  .btn-add-to-cart, .btn-buy-now {
    padding: 12px 16px;
    font-size: 13px;
    border-radius: 24px;
  }
  .quantity-input { width: 100px; }

  /* 购物车 */
  .cart-product-img { width: 40px; height: 40px; }
  .cart-table th:first-child,
  .cart-table td:first-child { padding-left: 0; }

  /* 订单 */
  .order-card .d-flex { flex-wrap: wrap; gap: 8px; }
  .order-tabs .nav-link { padding: 8px 14px; font-size: 13px; }
  .account-sidebar { padding: 12px; }

  /* Footer */
  footer { margin-top: 30px; }
  footer h6 { margin-top: 12px; }
  .services-wrap .col-6 { margin-bottom: 12px; }

  /* 顶部栏 */
  .top-wrap .left { font-size: 11px; }
  .top-wrap .btn { font-size: 11px; padding: 2px 4px; }
  .top-wrap .right { display: none !important; }
}
