/* ============================================================
   商贸168 B2B Platform - Main Stylesheet
   Color: #1a3a6b (Deep Blue), #ff6600 (Orange Accent), #f5f7fa (Light BG)
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
  --primary:       #1a3a6b;
  --primary-dark:  #0f2a4f;
  --primary-light: #2c5290;
  --accent:        #ff6600;
  --accent-hover:  #e55c00;
  --accent-light:  #fff3e6;
  --bg-light:      #f5f7fa;
  --bg-white:      #ffffff;
  --text-primary:  #333333;
  --text-secondary:#666666;
  --text-muted:    #999999;
  --border:        #e0e3e8;
  --border-light:  #f0f0f0;
  --shadow:        0 2px 8px rgba(0,0,0,.08);
  --shadow-hover:  0 4px 16px rgba(0,0,0,.12);
  --radius:        6px;
  --radius-lg:     10px;
  --header-h:      60px;
  --max-width:     1200px;
  --font:          -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition:    .25s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; outline: none; }
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 15px; }
.clearfix::after { content: ""; display: table; clear: both; }

/* ============================================================
   HEADER / TOP BAR
   ============================================================ */
.top-bar {
  background: var(--primary-dark);
  color: #a0b5d0;
  font-size: 12px;
  height: 34px;
  line-height: 34px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}
.top-bar a {
  color: #a0b5d0;
  margin-left: 18px;
}
.top-bar a:hover { color: #fff; }
.top-bar .welcome { color: #7a94b8; }
.top-bar .welcome strong { color: #b8ccf0; }
.top-bar .top-links { display: flex; align-items: center; }
.top-bar .top-links .sep { color: #3a5a7a; margin: 0 6px; }

/* ---- Main Header ---- */
.header {
  background: var(--bg-white);
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.header .container {
  display: flex;
  align-items: center;
  height: 100%;
}
.logo {
  flex-shrink: 0;
  margin-right: 40px;
}
.logo a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary) !important;
}
.logo img { height: 36px; }
.logo .logo-text span { color: var(--accent); }

/* ---- Main Nav ---- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  flex: 1;
}
.main-nav > li { position: relative; height: 100%; }
.main-nav > li > a {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 16px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  position: relative;
  transition: color var(--transition), background var(--transition);
}
.main-nav > li > a:hover,
.main-nav > li.active > a {
  color: var(--accent);
  background: var(--accent-light);
}
.main-nav > li > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--accent);
  transition: width var(--transition);
  border-radius: 3px 3px 0 0;
}
.main-nav > li > a:hover::after,
.main-nav > li.active > a::after { width: 30px; }

/* Dropdown */
.main-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all var(--transition);
  z-index: 999;
  padding: 6px 0;
}
.main-nav li:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.main-nav .dropdown-menu a {
  display: block;
  padding: 8px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}
.main-nav .dropdown-menu a:hover { background: var(--bg-light); color: var(--accent); }

/* ---- Header Search ---- */
.header-search {
  flex-shrink: 0;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.header-search .search-form {
  position: relative;
  display: flex;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.header-search .search-form:focus-within { border-color: var(--accent); }
.header-search .search-form input {
  border: none;
  padding: 6px 12px;
  width: 200px;
  font-size: 13px;
  background: #fff;
}
.header-search .search-form button {
  border: none;
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
}
.header-search .search-form button:hover { background: var(--accent); }

/* ---- Mobile Toggle ---- */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--primary);
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
}

/* ============================================================
   HERO / BANNER
   ============================================================ */
.hero-section {
  background: linear-gradient(135deg, var(--primary) 0%, #2c5290 100%);
  padding: 40px 0;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-section .container { position: relative; z-index: 1; }

/* ---- Big Search Box ---- */
.hero-search {
  text-align: center;
  margin-bottom: 30px;
}
.hero-search h1 {
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.hero-search p {
  color: rgba(255,255,255,.75);
  font-size: 15px;
  margin-bottom: 20px;
}
.hero-search .search-box {
  display: inline-flex;
  max-width: 720px;
  width: 100%;
  border-radius: 50px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
}
.hero-search .search-box select {
  border: none;
  background: var(--bg-light);
  padding: 0 18px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  min-width: 100px;
}
.hero-search .search-box select:focus { background: #fff; }
.hero-search .search-box input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 15px;
  min-width: 0;
}
.hero-search .search-box button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.hero-search .search-box button:hover { background: var(--accent-hover); }
.hero-search .hot-words {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hero-search .hot-words span { color: rgba(255,255,255,.5); font-size: 13px; }
.hero-search .hot-words a {
  color: rgba(255,255,255,.8);
  font-size: 13px;
  padding: 3px 10px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  transition: all var(--transition);
}
.hero-search .hot-words a:hover {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

/* ---- Banner Carousel (alongside search) ---- */
.hero-banner-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}
.banner-carousel {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.banner-carousel .slide {
  display: none;
  position: relative;
}
.banner-carousel .slide.active { display: block; }
.banner-carousel .slide img { width: 100%; min-height: 280px; object-fit: cover; }
.banner-carousel .slide .slide-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  padding: 30px 20px 16px;
  color: #fff;
}
.banner-carousel .slide .slide-caption h3 { font-size: 18px; margin-bottom: 4px; }
.banner-carousel .slide .slide-caption p { font-size: 13px; opacity: .8; }
.banner-carousel .dots {
  position: absolute;
  bottom: 10px;
  right: 16px;
  display: flex;
  gap: 6px;
}
.banner-carousel .dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.45);
  cursor: pointer;
  transition: background var(--transition);
}
.banner-carousel .dots span.active { background: var(--accent); width: 22px; border-radius: 4px; }
.banner-carousel .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  background: rgba(255,255,255,.85);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  z-index: 2;
}
.banner-carousel .arrow:hover { background: var(--accent); color: #fff; }
.banner-carousel .arrow.prev { left: 10px; }
.banner-carousel .arrow.next { right: 10px; }

/* ---- Hero Sidebar ---- */
.hero-sidebar { display: flex; flex-direction: column; gap: 16px; }
.hero-sidebar .side-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}
.hero-sidebar .side-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-light);
}
.hero-sidebar .side-card .card-title i { margin-right: 6px; }
.hero-sidebar .side-card .news-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hero-sidebar .side-card .news-list li:last-child { border: none; }
.hero-sidebar .side-card .news-list a {
  color: var(--text-secondary);
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-sidebar .side-card .news-list a:hover { color: var(--accent); }
.hero-sidebar .side-card .news-list .time {
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
  margin-left: 10px;
}

/* ============================================================
   CATEGORY NAV (Grid)
   ============================================================ */
.section {
  padding: 30px 0;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  padding-left: 14px;
}
.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}
.section-title .more {
  color: var(--text-muted);
  font-size: 13px;
}
.section-title .more:hover { color: var(--accent); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}
.category-grid .cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 8px;
  transition: all var(--transition);
  cursor: pointer;
  text-align: center;
  min-height: 100px;
}
.category-grid .cat-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.category-grid .cat-item .icon {
  width: 44px; height: 44px;
  background: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 8px;
  transition: all var(--transition);
}
.category-grid .cat-item:hover .icon {
  background: var(--accent);
  color: #fff;
}
.category-grid .cat-item .name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.category-grid .cat-item .count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   SUPPLY CARDS (Product Grid)
   ============================================================ */
.supply-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.supply-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.supply-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.supply-card .card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-light);
}
.supply-card .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.supply-card:hover .card-img img { transform: scale(1.06); }
.supply-card .card-img .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
}
.supply-card .card-img .card-actions {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}
.supply-card:hover .card-img .card-actions { opacity: 1; }
.supply-card .card-img .card-actions button {
  width: 30px; height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
}
.supply-card .card-img .card-actions button:hover { background: var(--accent); color: #fff; }

.supply-card .card-body {
  padding: 14px 16px 16px;
}
.supply-card .card-body .title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 40px;
  margin-bottom: 8px;
}
.supply-card .card-body .title a { color: inherit; }
.supply-card .card-body .title a:hover { color: var(--accent); }
.supply-card .card-body .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}
.supply-card .card-body .price .unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}
.supply-card .card-body .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.supply-card .card-body .meta i { margin-right: 3px; color: var(--text-muted); }
.supply-card .card-body .company {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
}
.supply-card .card-body .company .verify {
  color: #0a0;
  font-size: 12px;
}

/* ============================================================
   LIST VIEW (Alternative)
   ============================================================ */
.supply-list-view .supply-item {
  display: flex;
  gap: 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  transition: all var(--transition);
}
.supply-list-view .supply-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.supply-list-view .supply-item .list-img {
  width: 180px;
  height: 135px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-light);
}
.supply-list-view .supply-item .list-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}
.supply-list-view .supply-item:hover .list-img img { transform: scale(1.05); }
.supply-list-view .supply-item .list-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.supply-list-view .supply-item .list-info .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.supply-list-view .supply-item .list-info .title a { color: inherit; }
.supply-list-view .supply-item .list-info .title a:hover { color: var(--accent); }
.supply-list-view .supply-item .list-info .desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.supply-list-view .supply-item .list-info .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.supply-list-view .supply-item .list-info .meta i { margin-right: 3px; }
.supply-list-view .supply-item .list-price {
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 110px;
}
.supply-list-view .supply-item .list-price .price {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.supply-list-view .supply-item .list-price .price .unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.supply-list-view .supply-item .list-price .company {
  font-size: 13px;
  color: var(--primary);
}
.supply-list-view .supply-item .list-price .company i { margin-right: 3px; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep {
  margin: 0 8px;
  color: #ccc;
}
.breadcrumb .current { color: var(--primary); font-weight: 500; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.filter-bar .filter-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
}
.filter-bar .filter-row:last-child { margin-bottom: 0; }
.filter-bar .filter-label {
  flex-shrink: 0;
  width: 56px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 30px;
}
.filter-bar .filter-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.filter-bar .filter-items a {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
  line-height: 1.6;
}
.filter-bar .filter-items a:hover,
.filter-bar .filter-items a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* ---- Sort / Toggle Bar ---- */
.sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 18px;
}
.sort-bar .sort-options {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.sort-bar .sort-options a {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.sort-bar .sort-options a:hover,
.sort-bar .sort-options a.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.sort-bar .sort-options a i { margin-right: 3px; }
.sort-bar .view-toggle {
  display: flex;
  gap: 2px;
}
.sort-bar .view-toggle button {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sort-bar .view-toggle button.active,
.sort-bar .view-toggle button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.sort-bar .result-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
  padding-right: 10px;
}
.sort-bar .result-count strong { color: var(--accent); font-weight: 600; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 30px 0;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.pagination a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.pagination .disabled {
  color: #ccc;
  cursor: not-allowed;
  background: var(--bg-light);
}
.pagination .ellipsis {
  border: none;
  background: none;
  color: var(--text-muted);
  min-width: 20px;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.product-detail { padding: 20px 0; }
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
}
.detail-main {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.detail-sidebar > div {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

/* ---- Gallery ---- */
.product-gallery {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}
.product-gallery .thumb-list {
  flex-shrink: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-gallery .thumb-list img {
  width: 100%;
  border: 2px solid var(--border-light);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition);
}
.product-gallery .thumb-list img.active,
.product-gallery .thumb-list img:hover {
  border-color: var(--accent);
}
.product-gallery .main-img {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-light);
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.product-gallery .main-img img {
  max-width: 100%;
  max-height: 420px;
  object-fit: contain;
}

/* ---- Product Info ---- */
.product-info { padding-bottom: 20px; border-bottom: 1px solid var(--border-light); }
.product-info h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  line-height: 1.35;
}
.product-info .info-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 14px;
}
.product-info .info-grid .label {
  color: var(--text-muted);
  white-space: nowrap;
}
.product-info .info-grid .value { color: var(--text-primary); }
.product-info .info-grid .price-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
}
.product-info .info-grid .price-value .unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
}
.product-info .info-grid .tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.product-info .info-grid .tags span {
  background: var(--bg-light);
  color: var(--text-secondary);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
}

/* ---- Detail Tabs ---- */
.detail-tabs { margin-top: 20px; }
.detail-tabs .tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.detail-tabs .tab-nav a {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}
.detail-tabs .tab-nav a.active,
.detail-tabs .tab-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.detail-tabs .tab-content {
  min-height: 200px;
  line-height: 1.8;
  font-size: 14px;
  color: var(--text-secondary);
}
.detail-tabs .tab-content img { max-width: 100%; margin: 10px 0; }

/* ---- Company Sidebar ---- */
.company-card { padding: 20px; }
.company-card .card-header {
  text-align: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}
.company-card .card-header .avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 2px solid var(--bg-light);
  margin: 0 auto 8px;
  overflow: hidden;
  background: var(--bg-light);
}
.company-card .card-header .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.company-card .card-header .cname {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}
.company-card .card-header .cname .verify {
  display: inline-block;
  background: #0a0;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}
.company-card .info-list { font-size: 13px; }
.company-card .info-list li {
  display: flex;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-light);
}
.company-card .info-list li:last-child { border: none; }
.company-card .info-list .lbl {
  color: var(--text-muted);
  width: 56px;
  flex-shrink: 0;
}
.company-card .info-list .val {
  flex: 1;
  color: var(--text-secondary);
  word-break: break-all;
}
.company-card .info-list .val i { margin-right: 4px; color: var(--text-muted); }

/* ---- Contact Form ---- */
.contact-card { padding: 20px; }
.contact-card .card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
}
.contact-form .form-group {
  margin-bottom: 12px;
}
.contact-form label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  transition: border-color var(--transition);
  background: #fff;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,107,.08);
}
.contact-form textarea { min-height: 80px; resize: vertical; }
.contact-form .btn-submit {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.contact-form .btn-submit:hover { background: var(--accent); }

/* ============================================================
   SIDEBAR WIDGETS (Listing / Home)
   ============================================================ */
.sidebar-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

.sidebar-widget {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.sidebar-widget .widget-title {
  padding: 14px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--bg-light);
}
.sidebar-widget .widget-body { padding: 14px 18px; }
.sidebar-widget .widget-body .widget-list li {
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-light);
}
.sidebar-widget .widget-body .widget-list li:last-child { border: none; }
.sidebar-widget .widget-body .widget-list a {
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}
.sidebar-widget .widget-body .widget-list a:hover { color: var(--accent); }
.sidebar-widget .widget-body .widget-list a .num {
  color: var(--text-muted);
  font-size: 12px;
}

/* ============================================================
   FORMS (Standalone)
   ============================================================ */
.form-container {
  max-width: 520px;
  margin: 30px auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  box-shadow: var(--shadow);
}
.form-container h2 {
  text-align: center;
  font-size: 22px;
  color: var(--primary);
  margin-bottom: 24px;
}
.form-container h2 span { color: var(--accent); }
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 5px;
}
.form-group label .required { color: #e00; margin-left: 2px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,58,107,.08);
}
.form-group textarea { min-height: 100px; resize: vertical; }
.form-group .help-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}
.form-group .error-text {
  font-size: 12px;
  color: #e00;
  margin-top: 3px;
}
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #e00;
}
.form-group .input-group {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.form-group .input-group input {
  border: none;
  flex: 1;
}
.form-group .input-group .addon {
  background: var(--bg-light);
  padding: 0 14px;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 13px;
  border-left: 1px solid var(--border);
}

/* ---- File Upload ---- */
.form-group .file-upload {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.form-group .file-upload:hover {
  border-color: var(--primary);
  background: var(--bg-light);
}
.form-group .file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.form-group .file-upload .upload-icon {
  font-size: 36px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.form-group .file-upload .upload-text {
  color: var(--text-secondary);
  font-size: 13px;
}
.form-group .file-upload .upload-text strong { color: var(--primary); }
.form-group .file-upload .upload-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
}
.form-group .file-list { margin-top: 8px; }
.form-group .file-list .file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin-bottom: 4px;
  font-size: 13px;
}
.form-group .file-list .file-item .file-name { color: var(--text-primary); }
.form-group .file-list .file-item .file-remove {
  color: #e00;
  cursor: pointer;
  font-size: 16px;
}
.form-group .file-list .file-item .file-size { color: var(--text-muted); font-size: 12px; }

/* ---- Checkbox / Radio ---- */
.form-group .checkbox-group,
.form-group .radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.form-group .checkbox-group label,
.form-group .radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  font-size: 14px;
  cursor: pointer;
}
.form-group .checkbox-group input[type="checkbox"],
.form-group .radio-group input[type="radio"] {
  width: auto;
  accent-color: var(--primary);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-hover); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}
.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline-accent:hover {
  background: var(--accent);
  color: #fff;
}
.btn-light {
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-light:hover { background: var(--border); color: var(--text-primary); }
.btn-danger {
  background: #e74c3c;
  color: #fff;
}
.btn-danger:hover { background: #c0392b; }
.btn-success {
  background: #27ae60;
  color: #fff;
}
.btn-success:hover { background: #1e8449; }
.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}
.btn-lg {
  padding: 12px 30px;
  font-size: 16px;
}
.btn-block { width: 100%; }
.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ============================================================
   HOME PAGE - CAROUSEL
   ============================================================ */
.home-carousel { margin-bottom: 20px; }
.carousel-wrap {
  position: relative; width: 100%; height: 280px;
  overflow: hidden; border-radius: var(--radius);
}
.carousel-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 0.6s;
}
.carousel-slide.active { opacity: 1; }
.carousel-slide a { display: block; width: 100%; height: 100%; }

.carousel-slide .slide-content {
  width: 100%; height: 100%; display: flex; align-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 0 60px; position: relative;
}
.carousel-slide .slide-content::after {
  content: ''; position: absolute; right: 0; top: 0;
  width: 35%; height: 100%;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.04) 100%);
}
.carousel-slide .slide-text { z-index: 2; max-width: 65%; }
.carousel-slide .slide-badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 12px; padding: 3px 14px; border-radius: 3px; margin-bottom: 12px;
}
.carousel-slide .slide-title {
  font-size: 26px; font-weight: bold; color: #fff;
  margin-bottom: 8px; line-height: 1.3;
}
.carousel-slide .slide-meta {
  font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 10px;
}
.carousel-slide .slide-price {
  font-size: 24px; font-weight: bold; color: #ffcc00;
}
.carousel-slide .slide-price .slide-price-label {
  font-size: 12px; color: rgba(255,255,255,0.6); font-weight: normal;
}

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; background: rgba(0,0,0,0.35);
  color: #fff; border: none; border-radius: 50%;
  font-size: 20px; cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; opacity: 0;
}
.carousel-arrow:hover { background: rgba(0,0,0,0.6); }
.carousel-arrow.left { left: 15px; }
.carousel-arrow.right { right: 15px; }
.carousel-wrap:hover .carousel-arrow { opacity: 1; }

.carousel-dots {
  position: absolute; bottom: 15px; left: 50%;
  transform: translateX(-50%); display: flex; gap: 8px;
}
.carousel-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.5); cursor: pointer;
  transition: background 0.3s;
}
.carousel-dots span.active { background: var(--accent); width: 24px; border-radius: 4px; }

.welcome-banner {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #1a6bb8 100%);
  text-align: center; color: #fff;
}
.welcome-banner .welcome-icon { font-size: 48px; margin-bottom: 15px; opacity: 0.5; }
.welcome-banner h2 { font-size: 32px; margin-bottom: 8px; letter-spacing: 2px; }
.welcome-banner p { font-size: 16px; opacity: 0.7; }

/* ============================================================
   HOME PAGE - CATEGORY GRID
   ============================================================ */
.cat-nav { margin-bottom: 20px; }
.cat-grid {
  display: grid; grid-template-columns: repeat(10, 1fr);
  padding: 20px 0;
}
.cat-grid-item {
  text-align: center; padding: 12px 5px;
  transition: all 0.2s; border-radius: var(--radius);
}
.cat-grid-item:hover { background: var(--bg-light); }
.cat-grid-item i {
  display: block; font-size: 28px;
  color: var(--primary); margin-bottom: 8px;
}
.cat-grid-item span { font-size: 13px; color: var(--text-secondary); }

/* ============================================================
   BOX (Section Container)
   ============================================================ */
.box {
  background: var(--bg-white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.box-hd {
  padding: 14px 20px; border-bottom: 2px solid var(--primary);
  display: flex; justify-content: space-between; align-items: center;
}
.box-hd h2 {
  font-size: 18px; color: var(--primary); font-weight: bold;
}
.box-hd h2 i { margin-right: 8px; }
.box-hd .more { font-size: 13px; color: var(--text-muted); }
.box-hd .more:hover { color: var(--accent); }
.box-bd { padding: 15px 20px; }

/* ============================================================
   MAIN WITH SIDEBAR LAYOUT
   ============================================================ */
.main-with-sidebar { display: flex; gap: 20px; }
.main-area { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }

/* ============================================================
   HOME SUPPLY CARD (Home grid 2-col, scoped)
   ============================================================ */
.home-supply-list {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px;
}
.home-supply-card {
  display: flex; gap: 15px; padding: 15px; background: var(--bg-white);
  border: 1px solid var(--border-light); border-radius: var(--radius);
  transition: all 0.2s; position: relative;
}
.home-supply-card:hover {
  box-shadow: var(--shadow-hover); border-color: var(--accent);
}
.home-supply-card .hsc-thumb {
  width: 120px; height: 90px; flex-shrink: 0;
  border-radius: var(--radius); overflow: hidden; background: var(--bg-light);
}
.home-supply-card .hsc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.home-supply-card .hsc-body { flex: 1; min-width: 0; }
.home-supply-card .hsc-title {
  font-size: 15px; font-weight: bold; margin-bottom: 6px; line-height: 1.4;
}
.home-supply-card .hsc-title a { color: var(--text-primary); }
.home-supply-card .hsc-title a:hover { color: var(--accent); }
.home-supply-card .hsc-price {
  font-size: 16px; font-weight: bold; color: #ff3300; margin-bottom: 6px;
}
.home-supply-card .hsc-price .hsc-price-unit {
  font-size: 12px; color: var(--text-muted); font-weight: normal;
}
.home-supply-card .hsc-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 12px;
}
.home-supply-card .hsc-meta .hsc-company { color: var(--primary-light); }
.home-supply-card .home-supply-badge {
  position: absolute; top: -5px; left: -5px; z-index: 2;
}
.home-supply-card .home-supply-badge span {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #ff8833);
  color: #fff; font-size: 11px; padding: 2px 10px;
  border-radius: 2px 8px 2px 8px;
}

/* ============================================================
   SUPPLY VERTICAL LIST
   ============================================================ */
.supply-list-vertical { padding: 0; }
.supply-list-vertical .supply-row {
  display: flex; align-items: center; padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
}
.supply-list-vertical .supply-row:last-child { border-bottom: none; }
.supply-list-vertical .supply-row-title { flex: 1; min-width: 0; }
.supply-list-vertical .supply-row-title a {
  font-size: 14px; color: var(--text-primary);
  display: block; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.supply-list-vertical .supply-row-title a:hover { color: var(--accent); }
.supply-list-vertical .supply-row-price {
  width: 100px; text-align: right;
  font-size: 15px; font-weight: bold; color: #ff3300;
}
.supply-list-vertical .supply-row-price .price-unit {
  font-size: 11px; color: var(--text-muted); font-weight: normal;
}
.supply-list-vertical .supply-row-meta {
  width: 140px; text-align: right;
  font-size: 12px; color: var(--text-muted); padding-left: 15px;
}
.supply-list-vertical .supply-row-meta span { margin-left: 10px; }

/* ============================================================
   COMPANY SHOWCASE (Home main area)
   ============================================================ */
.company-showcase {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px;
}
.company-showcase .company-card {
  text-align: center; padding: 20px 10px;
  border: 1px solid var(--border-light); border-radius: var(--radius);
  transition: all 0.2s;
}
.company-showcase .company-card:hover {
  box-shadow: var(--shadow-hover); border-color: var(--primary);
}
.company-showcase .company-logo {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px;
  background: var(--bg-light); display: flex; align-items: center;
  justify-content: center; overflow: hidden; border: 2px solid var(--border-light);
}
.company-showcase .company-logo img { width: 100%; height: 100%; object-fit: cover; }
.company-showcase .company-name {
  font-size: 14px; font-weight: bold; color: var(--text-primary); margin-bottom: 4px;
}
.company-showcase .company-name .fa-check-circle { color: var(--primary); margin-left: 4px; }
.company-showcase .company-meta { font-size: 12px; color: var(--text-muted); }
.company-showcase .company-meta span { margin: 0 5px; }

/* ============================================================
   SIDEBAR WIDGETS (Home)
   ============================================================ */
.widget {
  background: var(--bg-white); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 15px;
}
.widget-hd {
  padding: 14px 18px; border-bottom: 2px solid var(--primary);
  font-size: 15px; font-weight: bold; color: var(--primary);
}
.widget-hd i { margin-right: 6px; }
.widget-bd { padding: 12px 18px; }
.widget-item {
  padding: 8px 0; border-bottom: 1px dashed var(--border-light);
  font-size: 13px;
}
.widget-item:last-child { border-bottom: none; }
.widget-item a { color: var(--text-secondary); display: block; }
.widget-item a:hover { color: var(--accent); }

/* ---- Demand List in Sidebar ---- */
.widget-demand .widget-item {
  display: flex; justify-content: space-between; align-items: center;
}
.widget-demand .widget-item a { flex: 1; min-width: 0; }
.widget-demand .widget-item .demand-time {
  color: var(--text-muted); font-size: 11px; white-space: nowrap; margin-left: 8px;
}

/* ---- News List in Sidebar ---- */
.widget-news .widget-item { display: flex; justify-content: space-between; align-items: center; }
.widget-news .widget-item a { flex: 1; min-width: 0; }
.widget-news .widget-item .news-date {
  color: var(--text-muted); font-size: 11px; white-space: nowrap; margin-left: 8px;
}

/* ---- Company Mini in Sidebar ---- */
.widget-company .company-mini {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px dashed var(--border-light);
}
.widget-company .company-mini:last-child { border-bottom: none; }
.widget-company .company-mini .mini-logo {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-light); display: flex; align-items: center;
  justify-content: center; overflow: hidden;
}
.widget-company .company-mini .mini-logo img { width: 100%; height: 100%; object-fit: cover; }
.widget-company .company-mini .mini-name { font-size: 13px; flex: 1; min-width: 0; }
.widget-company .company-mini .mini-name a { color: var(--text-secondary); }
.widget-company .company-mini .mini-name a:hover { color: var(--accent); }
.widget-company .company-mini .mini-verify { color: var(--primary); font-size: 11px; }

/* ---- Tag Cloud in Sidebar ---- */
.widget-tags .tag-cloud {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.widget-tags .tag-cloud a {
  display: inline-block; padding: 4px 12px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--bg-light); border-radius: 3px;
  transition: all 0.2s;
}
.widget-tags .tag-cloud a:hover {
  color: var(--accent); background: var(--accent-light);
}

/* ============================================================
   FRIEND LINKS
   ============================================================ */
.friend-links { margin-bottom: 0; }
.friend-links .box-hd { border-bottom-color: var(--border); }
.friend-links .box-hd h2 { font-size: 14px; color: var(--text-muted); }
.friend-link-list {
  display: flex; flex-wrap: wrap; gap: 10px; padding: 5px 0;
}
.friend-link-list a {
  font-size: 12px; color: var(--text-muted);
  padding: 3px 12px; border: 1px solid var(--border);
  border-radius: 3px; transition: all 0.2s;
}
.friend-link-list a:hover {
  color: var(--accent); border-color: #ffcc99; background: var(--accent-light);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--primary-dark);
  color: #8aa4c8;
  padding: 40px 0 0;
  margin-top: 40px;
}
.footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.footer .footer-col h4 {
  color: #fff;
  font-size: 15px;
  margin-bottom: 14px;
  font-weight: 600;
}
.footer .footer-col p {
  font-size: 13px;
  line-height: 1.8;
}
.footer .footer-col a {
  color: #8aa4c8;
  display: block;
  font-size: 13px;
  padding: 3px 0;
}
.footer .footer-col a:hover { color: #fff; }
.footer .footer-bottom {
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: #5a7a9a;
}
.footer .footer-bottom a { color: #6a8aaa; }
.footer .footer-bottom a:hover { color: #fff; }

/* ============================================================
   UTILITIES
   ============================================================ */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-primary { color: var(--primary) !important; }
.text-accent  { color: var(--accent) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: #27ae60 !important; }
.text-danger  { color: #e74c3c !important; }
.bg-white     { background: #fff; }
.bg-light     { background: var(--bg-light); }
.mt-5  { margin-top: 5px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-5  { margin-bottom: 5px; }
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }
.flex    { display: flex; }
.flex-c  { display: flex; align-items: center; }
.flex-b  { display: flex; justify-content: space-between; align-items: center; }
.flex-w  { display: flex; flex-wrap: wrap; }
.gap-5   { gap: 5px; }
.gap-10  { gap: 10px; }
.gap-15  { gap: 15px; }
.gap-20  { gap: 20px; }
.hidden  { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1199px) {
  .category-grid { grid-template-columns: repeat(6, 1fr); }
  .supply-grid  { grid-template-columns: repeat(3, 1fr); }
  .hero-banner-row { grid-template-columns: 1fr 260px; }
}
@media (max-width: 991px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
  .supply-grid  { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .sidebar-layout { grid-template-columns: 1fr; }
  .hero-banner-row { grid-template-columns: 1fr; }
  .hero-sidebar { flex-direction: row; flex-wrap: wrap; }
  .hero-sidebar .side-card { flex: 1; min-width: 200px; }
  .footer .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-search .search-form input { width: 140px; }
  .product-gallery .thumb-list { width: 60px; }
  .supply-list-view .supply-item .list-img { width: 130px; height: 98px; }
}
@media (max-width: 767px) {
  .top-bar .container { flex-wrap: wrap; justify-content: center; gap: 0 10px; font-size: 11px; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 2px solid var(--primary);
    box-shadow: var(--shadow-hover);
    z-index: 999;
    height: auto;
    padding: 10px 0;
  }
  .main-nav > li { height: auto; }
  .main-nav > li > a { padding: 10px 20px; height: auto; }
  .main-nav > li > a::after { display: none; }
  .mobile-toggle { display: block; }
  .header .container { position: relative; }
  .header-search .search-form input { width: 110px; }
  .hero-search h1 { font-size: 22px; }
  .hero-search .search-box { flex-direction: column; border-radius: var(--radius); }
  .hero-search .search-box select { padding: 10px; width: 100%; border-bottom: 1px solid var(--border); }
  .hero-search .search-box input { padding: 10px; }
  .hero-search .search-box button { padding: 12px; border-radius: 0; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .category-grid .cat-item { padding: 12px 4px; min-height: 80px; }
  .category-grid .cat-item .icon { width: 36px; height: 36px; font-size: 18px; }
  .supply-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .section-title h2 { font-size: 17px; }
  .product-gallery { flex-direction: column-reverse; }
  .product-gallery .thumb-list { flex-direction: row; width: 100%; }
  .product-gallery .thumb-list img { width: 54px; }
  .product-info h1 { font-size: 18px; }
  .sort-bar { flex-wrap: wrap; gap: 8px; }
  .sort-bar .sort-options { width: 100%; }
  .sort-bar .result-count { margin-left: 0; }
  .supply-list-view .supply-item { flex-direction: column; }
  .supply-list-view .supply-item .list-img { width: 100%; height: 160px; }
  .supply-list-view .supply-item .list-price { text-align: left; flex-direction: row; align-items: center; margin-top: 8px; }
  .filter-bar .filter-row { flex-direction: column; }
  .filter-bar .filter-label { width: auto; margin-bottom: 4px; }
  .form-container { padding: 20px; }
  .footer .footer-grid { grid-template-columns: 1fr; text-align: center; }
  .detail-tabs .tab-nav { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .detail-tabs .tab-nav a { padding: 10px 14px; }
  .pagination a,
  .pagination span { min-width: 32px; height: 32px; font-size: 12px; }
}
@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .supply-grid { grid-template-columns: 1fr; }
  .hero-search h1 { font-size: 18px; }
  .top-bar { height: auto; padding: 4px 0; font-size: 10px; }
  .top-bar .top-links .sep { margin: 0 3px; }
  .header-search { display: none; }
  .pagination { gap: 2px; }
}

/* ============================================================
   BADGE (top-level, for detail page)
   ============================================================ */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  vertical-align: middle;
  margin-left: 4px;
}
.badge-top { background: #ff3300; }
.badge-recommend { background: var(--accent); }

/* ============================================================
   ALERT MESSAGES
   ============================================================ */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 12px;
}
.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.alert-danger {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}
.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}
.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .4s ease forwards; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .6; }
}
.loading { animation: pulse 1.5s ease infinite; }

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .header, .footer, .top-bar, .hero-section, .sidebar-widget,
  .contact-card, .filter-bar, .sort-bar, .pagination,
  .mobile-toggle { display: none !important; }
  .detail-layout { grid-template-columns: 1fr; }
  body { background: #fff; font-size: 12px; color: #000; }
}
/* ============================================================
   商贸168 - 首页布局修复
   覆盖/补充 style.css 中未定义或冲突的样式
   ============================================================ */

/* 1. 顶部 logo+搜索+发布 水平布局 */
.header-main {
    background: #fff;
    border-bottom: 1px solid #e0e3e8;
}
.header-main .container {
    display: flex;
    align-items: center;
    height: 70px;
    gap: 20px;
}

/* Logo 文字修正（style.css 中 .logo a 的 flex 是为图片+文字设计的，不适用） */
.logo a {
    display: block;
    text-align: center;
    line-height: 1.2;
}
.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a3a6b;
}
.logo-sub {
    font-size: 11px;
    color: #999;
    letter-spacing: 2px;
}

/* 2. 搜索框外层容器 */
.search-box {
    flex: 1;
    max-width: 520px;
}
.search-input-wrap {
    display: flex;
    height: 42px;
    border: 2px solid #ff6600;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.25s;
}

/* ✅ 搜索按钮（上次缺失！） */
.search-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 22px;
    background: #ff6600;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.search-btn:hover {
    background: #e55c00;
}

/* 3. 发布按钮 */
.pub-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 24px;
    background: #ff6600;
    color: #fff !important;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.25s;
    white-space: nowrap;
}
.pub-btn:hover {
    background: #e55c00;
    color: #fff !important;
}

/* 4. 导航栏 - 整体深蓝背景 + 重置 style.css 冲突样式 */
.main-nav {
    display: flex !important;
    align-items: center !important;
    height: 44px !important;
    flex: none !important;
    background: #1a3a6b;
}
.main-nav .container {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.nav-links a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 18px;
    height: 44px;
    font-size: 14px;
    color: #fff;
    transition: background 0.2s;
    position: relative;
}
.nav-links a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff !important;
}
/* ✅ 首页 active 橙色高亮（修复被覆盖的问题） */
.nav-links a.active {
    background: #ff6600 !important;
    color: #fff !important;
}

/* 5. 全部分类下拉 */
.nav-categories {
    position: relative;
    flex-shrink: 0;
    width: 200px;
}
.nav-cat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 44px;
    background: #0f2a4f;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.nav-cat-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 200px;
    background: #fff;
    border: 1px solid #e0e3e8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 200;
}
.nav-categories:hover .nav-cat-dropdown { display: block; }