/* ============================================
   SiteCloner Shop - v2 Desktop Enhanced
   响应式布局 + 电商桌面端优化
   ============================================ */

: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);
  --container-max: 1320px;
}

/* === 基础 === */
*, *::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); }

/* === 桌面容器约束 === */
@media (min-width: 992px) {
  .container-fluid {
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
  }
  .header-content .container-fluid,
  .header-mobile .container-fluid,
  footer .container-fluid {
    max-width: var(--container-max);
  }
  footer .services-wrap .container-fluid {
    max-width: var(--container-max);
  }
}

/* === 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-search-form {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.12);
  border-radius: 20px;
  overflow: hidden;
  transition: all .3s;
  width: 200px;
}
.header-search-form:focus-within {
  background: rgba(255,255,255,.22);
  width: 260px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
.header-search-form input {
  background: transparent;
  border: none;
  color: #fff;
  padding: 7px 14px;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.header-search-form input::placeholder {
  color: rgba(255,255,255,.5);
}
.header-search-form button {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.8);
  padding: 7px 12px;
  cursor: pointer;
  font-size: 16px;
  transition: color .2s;
}
.header-search-form button:hover {
  color: #fff;
}

/* 移动端搜索 */
@media (max-width: 991.98px) {
  .header-search-form { display: none; }
}
.mobile-search-form {
  display: none;
  margin: 12px 0;
}
.mobile-search-form input {
  border-radius: 20px 0 0 20px;
  border: 1px solid #ddd;
  padding: 8px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
}
.mobile-search-form button {
  border-radius: 0 20px 20px 0;
  border: none;
  background: var(--bg-dark);
  color: #fff;
  padding: 8px 16px;
}

.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;
  border: 1px solid #f0f0f0;
}
.product-wrap:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

.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;
}

/* === 桌面端产品网格优化 === */
@media (min-width: 992px) {
  .product-name { font-size: 14px; min-height: 40px; }
  .price-new { font-size: 17px; }
  .price-old { font-size: 12px; }
  .product-bottom-info { padding: 14px; }
}

/* === 商品详情 === */
.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;
}

/* === 售前答疑 FAQ 折叠 === */
.faq-section {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
  margin: 30px 0;
}
.faq-section .faq-header {
  text-align: center;
  padding: 40px 0 0;
}
.faq-section .faq-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.faq-section .faq-header .faq-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.faq-section .accordion {
  padding: 20px 0 40px;
  max-width: 900px;
  margin: 0 auto;
}
.faq-section .accordion-item {
  border: none;
  border-bottom: 1px solid #f0f0f0;
}
.faq-section .accordion-button {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  padding: 18px 20px;
  background: #fff;
  box-shadow: none;
  transition: color .2s;
}
.faq-section .accordion-button:not(.collapsed) {
  color: var(--accent);
  background: #fffaf5;
  box-shadow: none;
}
.faq-section .accordion-button::after {
  background-size: 16px;
}
.faq-section .accordion-button:focus {
  box-shadow: none;
  border-color: transparent;
}
.faq-section .accordion-body {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
  padding: 8px 20px 20px;
  background: #fffaf5;
}

/* === 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; }

  .container-fluid {
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .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;
  }

  /* FAQ mobile */
  .faq-section .accordion {
    padding: 12px 8px 24px;
  }
  .faq-section .faq-header h2 { font-size: 20px; }
  .faq-section .accordion-button { font-size: 14px; padding: 14px 16px; }
  .faq-section .accordion-body { font-size: 13px; padding: 6px 16px 16px; }
}

/* ==========================================
   响应式 — 手机端 (≤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; }

  /* 产品网格 */
  .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; }
}

/* ==========================================
   响应式 — 桌面大屏优化 (≥1200px)
   ========================================== */
@media (min-width: 1200px) {
  .module-item {
    padding: 36px 0;
  }
  .module-title {
    font-size: 26px;
  }
  /* 产品名稍大 */
  .product-name {
    font-size: 14px;
    min-height: 42px;
  }
  .price-new {
    font-size: 18px;
  }
  /* 产品hover效果增强 */
  .product-wrap {
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
  }
  .product-wrap:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,.14);
    transform: translateY(-3px);
  }
  /* 按钮在桌面hover显示 */
  .button-wrap {
    opacity: 0;
  }
  .product-wrap:hover .button-wrap {
    opacity: 1;
    bottom: 16px;
  }
}

/* ==========================================
   超大屏优化 (≥1400px)
   ========================================== */
@media (min-width: 1400px) {
  :root {
    --container-max: 1400px;
  }
}

/* === 隐藏搜索icon（已替换为搜索框） === */
@media (min-width: 992px) {
  .right-btn .nav-link[data-bs-toggle="offcanvas"][href="#searchPanel"] {
    display: none !important;
  }
}


/* === 分类筛选导航 === */
.category-filter-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.category-filter-nav::-webkit-scrollbar {
  display: none;
}
.category-filter-nav .nav-link {
  white-space: nowrap;
  padding: 8px 20px;
  border-radius: 24px;
  border: 2px solid #e8e8e8;
  transition: all 0.2s;
  font-size: 14px;
}
.category-filter-nav .nav-link:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}
.category-filter-nav .nav-link.active {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}

@media (max-width: 767.98px) {
  .category-filter-nav .nav-link {
    padding: 6px 14px;
    font-size: 12px;
  }
}
