/* ========== Reset & Base ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a56db;
  --primary-dark: #1040a0;
  --primary-light: #3b82f6;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --bg: #f0f2f5;
  --card-bg: #fff;
  --text: #1a1a2e;
  --text-light: #8c8c8c;
  --text-medium: #595959;
  --price: #e63946;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 30px rgba(26,86,219,0.12);
  --radius: 14px;
  --radius-sm: 8px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

/* ========== Header / Navbar ========== */
.navbar {
  background: #0a1929;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.navbar-logo img {
  height: 40px;
  width: auto;
}

.navbar-logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.navbar-logo-text span {
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.search-box {
  flex: 1;
  display: flex;
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  height: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 20px;
  font-size: 0.9rem;
  background: transparent;
}

.search-box button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 24px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--accent-dark);
}

.navbar-icons {
  display: flex;
  gap: 20px;
  align-items: center;
}

.navbar-icons a {
  color: #fff;
  font-size: 1.3rem;
  position: relative;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.navbar-icons a:hover {
  opacity: 1;
}

.navbar-icons .badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  line-height: 1.3;
}

/* ========== Banner Carousel ========== */
.banner-section {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 20px;
}

.banner-carousel {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 2.8 / 1;
  background: #eee;
}

.banner-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.banner-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
}

.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-slide .banner-text {
  position: absolute;
  bottom: 28px;
  left: 36px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.banner-slide .banner-text h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.banner-slide .banner-text p {
  font-size: 1.05rem;
  opacity: 0.92;
}

.banner-dots {
  position: absolute;
  bottom: 14px;
  right: 24px;
  display: flex;
  gap: 8px;
}

.banner-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: all 0.3s;
}

.banner-dots span.active {
  background: #fff;
  width: 26px;
  border-radius: 4px;
}

.banner-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.8);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.banner-carousel:hover .banner-arrow {
  opacity: 1;
}

.banner-arrow:hover {
  background: rgba(255,255,255,0.95);
}

.banner-arrow.prev { left: 14px; }
.banner-arrow.next { right: 14px; }

/* ========== Category Nav ========== */
.category-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 20px;
}

.category-grid {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px 16px;
  box-shadow: var(--shadow);
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  flex: 1;
  min-width: 0;
}

.category-item:hover {
  transform: translateY(-3px);
}

.category-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

.category-item span {
  font-size: 0.78rem;
  color: var(--text-medium);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ========== Section Title ========== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.section-header .more-link {
  font-size: 0.85rem;
  color: var(--primary-light);
  cursor: pointer;
  transition: color 0.2s;
}

.section-header .more-link:hover {
  color: var(--primary-dark);
}

/* ========== Horizontal Scroll Products ========== */
.scroll-section {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

.scroll-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
  display: none;
}

.scroll-container .product-card {
  scroll-snap-align: start;
  min-width: 210px;
  max-width: 210px;
}

/* ========== Product Card ========== */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.product-card .card-img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
  position: relative;
}

.product-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .card-img img {
  transform: scale(1.06);
}

.product-card .card-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.product-card .card-tag.hot {
  background: var(--price);
}

.product-card .card-tag.new {
  background: #10b981;
}

.product-card .card-info {
  padding: 12px 14px 16px;
}

.product-card .card-title {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  font-weight: 500;
}

.product-card .card-price {
  color: var(--price);
  font-size: 1.15rem;
  font-weight: 700;
}

.product-card .card-price small {
  font-size: 0.78rem;
  font-weight: 400;
}

.product-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.product-card .card-sales {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* ========== Group Buy Section ========== */
.groupbuy-section {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

.groupbuy-banner {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  position: relative;
}

.groupbuy-banner img {
  width: 100%;
  aspect-ratio: 3.5 / 1;
  object-fit: cover;
}

.groupbuy-banner .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(26,86,219,0.85), rgba(59,130,246,0.7));
  display: flex;
  align-items: center;
  padding: 0 40px;
}

.groupbuy-banner .overlay-content {
  color: #fff;
}

.groupbuy-banner .overlay-content h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.groupbuy-banner .overlay-content p {
  font-size: 1rem;
  opacity: 0.9;
}

.groupbuy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.groupbuy-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
  cursor: pointer;
}

.groupbuy-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.groupbuy-card .gb-img {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #f5f5f5;
}

.groupbuy-card .gb-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.groupbuy-card .gb-info {
  padding: 14px 16px;
}

.groupbuy-card .gb-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.groupbuy-card .gb-prices {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.groupbuy-card .gb-price {
  color: var(--price);
  font-size: 1.2rem;
  font-weight: 700;
}

.groupbuy-card .gb-price small {
  font-size: 0.8rem;
}

.groupbuy-card .gb-original {
  color: var(--text-light);
  font-size: 0.85rem;
  text-decoration: line-through;
}

.groupbuy-card .gb-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.groupbuy-card .gb-bar {
  flex: 1;
  height: 6px;
  background: #e8e8e8;
  border-radius: 3px;
  overflow: hidden;
}

.groupbuy-card .gb-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.5s;
}

.groupbuy-card .gb-count {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}

.groupbuy-card .gb-timer {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--price);
  font-weight: 600;
}

/* ========== Service Icons ========== */
.service-section {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.service-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.service-card .service-icon {
  font-size: 2rem;
  margin-bottom: 10px;
}

.service-card .service-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.service-card .service-desc {
  font-size: 0.78rem;
  color: var(--text-light);
}

/* ========== Product Grid ========== */
.grid-section {
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: 0 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.product-grid .product-card .card-img {
  aspect-ratio: 1;
}

/* ========== Tab Filter ========== */
.tab-bar {
  display: flex;
  gap: 0;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.tab-bar .tab-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-size: 0.88rem;
  color: var(--text-medium);
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}

.tab-bar .tab-item:hover {
  color: var(--primary);
  background: rgba(26,86,219,0.04);
}

.tab-bar .tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* ========== Store Map ========== */
.map-section {
  max-width: 1280px;
  margin: 0 auto 28px;
  padding: 0 20px;
}

.map-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  height: 320px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.map-overlay {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  max-width: 260px;
}

.map-overlay h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.map-overlay p {
  font-size: 0.8rem;
  color: var(--text-medium);
  line-height: 1.5;
}

/* ========== Footer ========== */
.footer {
  background: #0a1929;
  color: #8899aa;
  padding: 48px 20px 0;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr 1.3fr;
  gap: 28px;
  padding-bottom: 36px;
}

.footer-brand img {
  height: 36px;
  width: auto;
  margin-bottom: 14px;
}

.footer-brand p {
  font-size: 0.82rem;
  line-height: 1.7;
  color: #7a8fa3;
  margin-bottom: 16px;
}

.footer-social {
  display: flex;
  gap: 10px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8899aa;
  font-size: 0.85rem;
  transition: all 0.2s;
  text-decoration: none;
}

.footer-social a:hover {
  background: var(--primary);
  color: #fff;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: #7a8fa3;
  font-size: 0.83rem;
  margin-bottom: 10px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-newsletter h4 {
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.footer-newsletter p {
  font-size: 0.83rem;
  color: #7a8fa3;
  margin-bottom: 14px;
  line-height: 1.5;
}

.newsletter-form {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  outline: none;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.newsletter-form input::placeholder {
  color: #5a7a94;
}

.newsletter-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.newsletter-form button:hover {
  background: var(--accent-dark);
}

.footer-trust {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #7a8fa3;
}

.trust-item .trust-icon {
  font-size: 1.1rem;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 18px 0;
  text-align: center;
  font-size: 0.78rem;
  color: #5a7a94;
}

/* ================================
   DETAIL PAGE
   ================================ */

.detail-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--text-light);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  margin: 0 6px;
}

/* Detail Top */
.detail-top {
  display: flex;
  gap: 28px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.detail-gallery {
  width: 440px;
  flex-shrink: 0;
}

.detail-main-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f5f5f5;
  margin-bottom: 14px;
}

.detail-main-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-thumbs {
  display: flex;
  gap: 10px;
}

.detail-thumbs .thumb {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
}

.detail-thumbs .thumb.active,
.detail-thumbs .thumb:hover {
  border-color: var(--primary);
}

.detail-thumbs .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.detail-info .detail-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
}

.detail-info .detail-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 18px;
}

.detail-price-box {
  background: linear-gradient(135deg, #fef3f2, #fff5f0);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 22px;
  border: 1px solid rgba(230,57,70,0.1);
}

.detail-price-box .price-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 4px;
}

.detail-price-box .detail-price {
  color: var(--price);
  font-size: 2.2rem;
  font-weight: 800;
}

.detail-price-box .detail-price small {
  font-size: 1.1rem;
}

.detail-price-box .original-price {
  font-size: 0.95rem;
  color: var(--text-light);
  text-decoration: line-through;
  margin-left: 14px;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.detail-meta-row {
  display: flex;
  align-items: flex-start;
  font-size: 0.9rem;
}

.detail-meta-row .label {
  color: var(--text-light);
  width: 70px;
  flex-shrink: 0;
}

.detail-meta-row .value {
  color: var(--text);
  flex: 1;
}

.detail-meta-row .value .tag {
  display: inline-block;
  background: #fff0eb;
  color: var(--price);
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 4px;
  margin-right: 6px;
}

/* Color / Storage Selector */
.detail-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-options .opt-btn {
  padding: 7px 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
  color: var(--text);
}

.detail-options .opt-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.detail-options .opt-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(26,86,219,0.06);
  font-weight: 500;
}

/* Action Buttons */
.detail-actions {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 22px;
}

.btn-cart, .btn-buy {
  flex: 1;
  padding: 15px 0;
  border: none;
  border-radius: 26px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-cart {
  background: #fff0eb;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-cart:hover {
  background: rgba(26,86,219,0.08);
}

.btn-buy {
  background: var(--primary);
  color: #fff;
}

.btn-buy:hover {
  background: var(--primary-dark);
}

/* Detail Specs */
.detail-specs {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.detail-specs h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr:nth-child(even) {
  background: #fafafa;
}

.specs-table td {
  padding: 12px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
}

.specs-table td:first-child {
  color: var(--text-light);
  width: 150px;
  font-weight: 500;
}

/* Detail Description */
.detail-desc {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.detail-desc h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-desc .desc-content {
  font-size: 0.95rem;
  color: var(--text-medium);
  line-height: 1.9;
}

.detail-desc .desc-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 18px 0;
}

/* ========== Back to Top ========== */
.back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 46px;
  height: 46px;
  background: var(--card-bg);
  border-radius: 50%;
  box-shadow: 0 2px 14px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 50;
  font-size: 1.2rem;
  border: 1px solid var(--border);
}

.back-top.show {
  opacity: 1;
}

.back-top:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== Customer Service Float ========== */
.cs-float {
  position: fixed;
  bottom: 90px;
  right: 32px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-float .cs-btn {
  width: 46px;
  height: 46px;
  background: var(--card-bg);
  border-radius: 50%;
  box-shadow: 0 2px 14px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.cs-float .cs-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.08);
}

/* ========== Chatbot Widget ========== */
.chat-toggle {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26,86,219,0.4);
  z-index: 200;
  transition: all 0.3s;
  color: #fff;
  font-size: 1.5rem;
}

.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(26,86,219,0.5);
}

.chat-toggle-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1.3;
}

.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 32px;
  width: 370px;
  max-height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chat-widget.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  font-size: 1.6rem;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-status {
  font-size: 0.75rem;
  opacity: 0.85;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
  padding: 4px;
}

.chat-close:hover {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  min-height: 120px;
  background: #f7f8fa;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.chat-msg {
  display: flex;
  max-width: 85%;
}

.chat-msg.user {
  align-self: flex-end;
  justify-content: flex-end;
}

.chat-msg.bot {
  align-self: flex-start;
}

.chat-msg .msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.chat-msg.user .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-msg.bot .msg-bubble {
  background: #fff;
  color: var(--text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chat-msg .msg-bubble p {
  margin-bottom: 4px;
}

.chat-msg .msg-bubble p:last-child {
  margin-bottom: 0;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* Quick Replies */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  background: #f7f8fa;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}

.quick-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.78rem;
  cursor: pointer;
  background: #fff;
  color: var(--primary);
  transition: all 0.2s;
  white-space: nowrap;
}

.quick-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Chat Input */
.chat-input-area {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

.chat-input-area input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-area input:focus {
  border-color: var(--primary-light);
}

.chat-input-area button {
  background: var(--primary);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin-left: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-input-area button:hover {
  background: var(--primary-dark);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .navbar-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .search-box {
    order: 3;
    width: 100%;
  }

  .banner-carousel {
    aspect-ratio: 1.8 / 1;
  }

  .banner-slide .banner-text h2 {
    font-size: 1.3rem;
  }

  .category-grid {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 16px;
  }

  .category-item {
    width: calc(20% - 16px);
    flex: none;
  }

  .detail-top {
    flex-direction: column;
    padding: 18px;
  }

  .detail-gallery {
    width: 100%;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .scroll-container .product-card {
    min-width: 170px;
    max-width: 170px;
  }

  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .groupbuy-grid {
    grid-template-columns: 1fr;
  }

  .chat-widget {
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
  }

  .chat-toggle {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 480px) {
  .category-item {
    width: calc(25% - 12px);
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab-bar {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tab-bar::-webkit-scrollbar {
    display: none;
  }

  .tab-bar .tab-item {
    min-width: 60px;
    flex: none;
    padding: 10px 12px;
    font-size: 0.82rem;
  }
}
