:root {
  --ali-orange: #ff6a00;
  --ali-orange-dark: #e55d00;
  --ali-blue: #5ba4d9;
  --ali-blue-dark: #4a93c8;
  --brand-navy: #1c2d4a;
  --ali-bg: #f4f4f4;
  --ali-border: #e0e0e0;
  --ali-text: #222;
  --ali-muted: #666;
  --container: 1280px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ali-text);
  background: var(--ali-bg);
  line-height: 1.5;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { width: min(100% - 24px, var(--container)); margin: 0 auto; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px;
  font-weight: 600; border: 1px solid transparent; cursor: pointer; transition: .2s;
}
.btn-primary { background: var(--ali-orange); color: #fff; }
.btn-primary:hover { background: var(--ali-orange-dark); }
.btn-cart { background: #fff; color: var(--ali-text); border-color: var(--ali-border); }
.btn-cart:hover { border-color: var(--ali-orange); color: var(--ali-orange); }
.btn-inquiry, .btn-inquiry-sm {
  background: var(--ali-orange); color: #fff; border-color: var(--ali-orange);
}
.btn-inquiry-sm { padding: 6px 12px; font-size: 12px; }
.btn-inquiry:hover, .btn-inquiry-sm:hover { background: var(--ali-orange-dark); }

/* ===== Store Header (Autoplicity style) ===== */
.store-header {
  background: #fff; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 var(--ali-border);
}
.header-info-strip {
  background: #f7f8fa; border-bottom: 1px solid var(--ali-border); font-size: 12px; color: var(--ali-muted);
}
.header-info-inner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0;
}
.header-info-item a { color: var(--ali-muted); }
.header-info-item a:hover { color: var(--brand-navy); }
.header-info-sep { color: #ccc; }
.header-info-company { margin-left: auto; color: #999; font-size: 11px; }

.header-main-row { padding: 14px 0; border-bottom: 1px solid var(--ali-border); }
.header-main-inner {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 16px; align-items: center;
}
.header-menu-toggle {
  display: none; flex-direction: column; gap: 5px; border: 0; background: none; padding: 8px; cursor: pointer;
}
.header-menu-toggle span { display: block; width: 22px; height: 2px; background: var(--brand-navy); }

.header-brand { flex-shrink: 0; }
.header-brand .custom-logo-link img { max-height: 42px; width: auto; display: block; }
.header-brand-link {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand-navy);
}
.header-brand-icon {
  width: 38px; height: 38px; border-radius: 50%; background: var(--brand-navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
}
.header-brand-name { font-size: 26px; font-weight: 700; letter-spacing: -.03em; color: var(--brand-navy); }

.header-search {
  display: flex; flex: 1; min-width: 0; max-width: 560px; margin: 0 auto;
  border: 1px solid #cfd8e3; border-radius: 6px; overflow: hidden; background: #fff;
}
.header-search-field {
  flex: 1; border: 0; outline: none; padding: 12px 16px; font-size: 14px; min-width: 0;
}
.header-search-submit {
  border: 0; background: var(--ali-blue); color: #fff; width: 52px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.header-search-submit:hover { background: var(--ali-blue-dark); }

.header-utilities { display: flex; align-items: stretch; gap: 4px; flex-shrink: 0; }
.header-utility {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px;
  color: var(--brand-navy); min-width: 0; position: relative;
}
.header-utility:hover { background: #f5f7fa; }
.header-fitment { padding-top: 18px; }
.utility-badge {
  position: absolute; top: 0; left: 10px; background: var(--brand-navy); color: #fff;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 2px;
  text-transform: uppercase; white-space: nowrap;
}
.utility-icon-wrap { color: var(--brand-navy); flex-shrink: 0; display: inline-flex; }
.utility-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.utility-text small { font-size: 11px; color: var(--ali-muted); }
.utility-text strong { font-size: 13px; font-weight: 700; color: var(--brand-navy); white-space: nowrap; }

.category-nav { background: #fff; border-bottom: 1px solid var(--ali-border); }
.category-nav-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.category-nav-menu {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 0; list-style: none;
  margin: 0; padding: 0; min-width: max-content;
}
.category-nav-menu .menu-item a {
  display: block; padding: 14px 18px; font-size: 14px; font-weight: 600;
  color: var(--ali-text); white-space: nowrap; border-bottom: 2px solid transparent;
}
.category-nav-menu .menu-item a:hover,
.category-nav-menu .current-menu-item > a {
  color: var(--brand-navy); border-bottom-color: var(--ali-blue);
}
.category-nav-menu .menu-item-quote a { color: var(--ali-orange); }

/* Hero carousel */
.store-hero-carousel { position: relative; background: #111; }
.hero-track { position: relative; height: 360px; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity .6s; display: block;
}
.hero-slide.is-active { opacity: 1; z-index: 1; }
.hero-slide-mask {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 100%);
}
.hero-slide-content { position: relative; z-index: 1; height: 100%; display: flex; align-items: center; }
.hero-slide-title {
  color: #fff; font-size: clamp(24px, 4vw, 36px); font-weight: 700;
  max-width: 600px; line-height: 1.25;
}
.hero-dots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}
.hero-dot {
  width: 10px; height: 10px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.45); cursor: pointer; padding: 0;
}
.hero-dot.is-active { background: var(--ali-orange); }

/* Category mosaic – Alibaba homepage */
.alibaba-category-showcase { padding: 16px 0; background: var(--ali-bg); }
.category-mosaic {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 8px; margin-bottom: 8px;
}
.mosaic-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 8px; }
.mosaic-card, .mosaic-banner-wide {
  position: relative; min-height: 120px; border-radius: var(--radius); overflow: hidden;
  background-size: cover; background-position: center; display: block;
}
.mosaic-main { min-height: 376px; }
.mosaic-banner-wide { min-height: 140px; margin-top: 0; }
.mosaic-card::after, .mosaic-banner-wide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.55) 100%);
}
.mosaic-label {
  position: absolute; left: 16px; bottom: 14px; z-index: 1;
  color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* Company showcase */
.company-showcase { padding: 8px 0 16px; }
.company-showcase-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.showcase-card {
  min-height: 160px; border-radius: var(--radius); background-size: cover;
  background-position: center; position: relative; overflow: hidden; display: block;
}
.showcase-card::after {
  content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.35);
}
.showcase-card span {
  position: absolute; left: 14px; bottom: 12px; z-index: 1;
  color: #fff; font-weight: 700; font-size: 15px;
}

/* Catalog layout */
.catalog-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
.catalog-layout-home .catalog-sidebar { position: sticky; top: 12px; }
.catalog-sidebar {
  background: #fff; border: 1px solid var(--ali-border); border-radius: var(--radius); padding: 16px;
}
.sidebar-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.sidebar-cats { list-style: none; margin: 0; padding: 0; }
.sidebar-cats a {
  display: block; padding: 8px 0; font-size: 13px; color: var(--ali-text);
  border-bottom: 1px solid #f2f2f2;
}
.sidebar-cats a:hover, .sidebar-cats a.is-active { color: var(--ali-orange); }
.sidebar-all {
  display: inline-block; margin-top: 12px; font-size: 13px;
  color: var(--ali-blue); font-weight: 600;
}

.catalog-filter-tabs { display: flex; gap: 0; margin-bottom: 12px; }
.filter-tab {
  padding: 10px 18px; font-size: 13px; font-weight: 600; color: var(--ali-muted);
  border-bottom: 2px solid transparent; background: #fff;
  border: 1px solid var(--ali-border); margin-right: -1px;
}
.filter-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.filter-tab:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.filter-tab.is-active { color: var(--ali-orange); border-bottom-color: var(--ali-orange); background: #fff8f3; }

.catalog-toolbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: 12px; margin-bottom: 12px;
}
.catalog-toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.catalog-sort { display: flex; gap: 6px; flex-wrap: wrap; }
.sort-link {
  font-size: 12px; padding: 4px 10px; border: 1px solid var(--ali-border);
  border-radius: 12px; color: var(--ali-muted); background: #fff;
}
.sort-link.is-active, .sort-link:hover { color: var(--ali-orange); border-color: var(--ali-orange); }
.catalog-count { margin: 0; font-size: 12px; color: var(--ali-muted); }

/* Product grid – Alibaba cards */
.alibaba-products, .alibaba-catalog { background: var(--ali-bg); }
.products-section { padding: 16px 0 24px; }
.section-header { margin-bottom: 12px; }
.section-header h2 { margin: 0 0 4px; font-size: 22px; }
.section-header p { margin: 0; color: var(--ali-muted); font-size: 13px; }
.section-more { text-align: center; margin-top: 16px; }
.section-more a { color: var(--ali-blue); font-weight: 600; font-size: 14px; }

ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; list-style: none; margin: 0; padding: 0;
}
.alibaba-product-card .product-card {
  background: #fff; border: 1px solid var(--ali-border); border-radius: var(--radius);
  overflow: hidden; height: 100%; display: flex; flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
}
.alibaba-product-card .product-card:hover {
  border-color: #ffd8bf; box-shadow: 0 4px 16px rgba(255,106,0,.12);
}
.product-thumb { aspect-ratio: 1; background: #fafafa; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-certified {
  display: inline-block; width: fit-content;
  font-size: 10px; font-weight: 700; text-transform: lowercase;
  color: var(--ali-blue); background: #eef8ff; padding: 2px 6px; border-radius: 2px;
}
.product-name {
  font-size: 13px; line-height: 1.45; font-weight: 400; color: var(--ali-text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-name:hover { color: var(--ali-orange); }
.product-price-main { font-size: 18px; font-weight: 700; color: var(--ali-orange); }
.product-price-was { font-size: 12px; color: var(--ali-muted); }
.product-min-order { margin: 0; font-size: 12px; color: var(--ali-muted); }
.product-sold { margin: 0; font-size: 12px; color: #999; }
.product-card-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }

/* Catalog page */
.catalog-page { padding: 16px 0 32px; }
.catalog-header { margin-bottom: 12px; }
.catalog-breadcrumb { font-size: 12px; color: var(--ali-muted); margin-bottom: 6px; }
.catalog-breadcrumb a { color: var(--ali-muted); }
.catalog-title { margin: 0; font-size: 24px; }
.empty-notice { padding: 40px; text-align: center; color: var(--ali-muted); background: #fff; border: 1px solid var(--ali-border); }

/* Product advantage */
.product-advantage { background: #fff; padding: 32px 0; border-top: 1px solid var(--ali-border); }
.advantage-inner h2 { margin: 0 0 20px; font-size: 22px; text-align: center; }
.advantage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.advantage-item {
  text-align: center; padding: 20px; border: 1px solid var(--ali-border); border-radius: var(--radius);
}
.advantage-item strong { display: block; margin-bottom: 8px; font-size: 15px; }
.advantage-item p { margin: 0; font-size: 13px; color: var(--ali-muted); }

/* Single product */
.product-dual-commerce { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.commerce-panel {
  border: 1px solid var(--ali-border); border-radius: var(--radius); padding: 16px; background: #fff;
}
.commerce-b2b { border-color: #ffd8bf; background: #fffaf6; }
.commerce-panel-title { margin: 0 0 6px; font-size: 15px; }
.commerce-panel-desc { margin: 0 0 10px; font-size: 12px; color: var(--ali-muted); }
.single-product .product {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  padding: 24px 0; max-width: var(--container); margin: 0 auto;
  width: min(100% - 24px, var(--container));
}
.single-product .summary { margin: 0; }

/* Pages */
.page-shell { padding: 24px 0 40px; max-width: var(--container); margin: 0 auto; width: min(100% - 24px, var(--container)); }
.contact-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; }
.inquiry-form { background: #fff; border: 1px solid var(--ali-border); padding: 20px; border-radius: var(--radius); }
.inquiry-form .form-row { margin-bottom: 12px; }
.inquiry-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.inquiry-form input, .inquiry-form select, .inquiry-form textarea {
  width: 100%; border: 1px solid var(--ali-border); border-radius: var(--radius); padding: 8px 10px; font: inherit;
}
.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* Footer */
.site-footer { background: #222; color: rgba(255,255,255,.75); margin-top: 0; }
.footer-main { padding: 32px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 20px; }
.footer-wordmark { font-size: 20px; font-weight: 700; color: #fff; }
.footer-wordmark span { color: var(--ali-orange); }
.footer-brand p { margin: 8px 0 0; font-size: 13px; line-height: 1.6; }
.footer-address { color: rgba(255,255,255,.6); font-size: 12px; }
.footer-col h3 { color: #fff; font-size: 13px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 6px 0; font-size: 13px; }
.footer-col a { color: rgba(255,255,255,.7); }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 14px 0; font-size: 12px; }
.footer-bottom-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.back-to-top {
  position: fixed; right: 16px; bottom: 16px; width: 40px; height: 40px; border: 0;
  border-radius: 50%; background: var(--ali-orange); color: #fff; cursor: pointer;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 90;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

.woocommerce nav.woocommerce-pagination { margin-top: 20px; text-align: center; }
.woocommerce nav.woocommerce-pagination ul { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  border: 1px solid var(--ali-border); border-radius: var(--radius); padding: 6px 12px;
}

@media (max-width: 1024px) {
  ul.products { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .header-main-inner { grid-template-columns: auto 1fr; grid-template-rows: auto auto; }
  .header-search { grid-column: 1 / -1; max-width: none; order: 3; }
  .header-utilities { grid-column: 1 / -1; justify-content: space-between; flex-wrap: wrap; order: 4; }
  .header-info-company { width: 100%; margin-left: 0; margin-top: 4px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-sidebar { position: static; }
  .category-mosaic { grid-template-columns: 1fr; }
  .mosaic-main { min-height: 220px; }
  .company-showcase-grid { grid-template-columns: 1fr; }
  .advantage-grid { grid-template-columns: 1fr; }
  .single-product .product, .product-dual-commerce { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  ul.products { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
  .header-menu-toggle { display: flex; }
  .header-brand-name { font-size: 20px; }
  .header-utilities { gap: 0; }
  .header-utility { padding: 6px 8px; }
  .utility-text { display: none; }
  .utility-badge { display: none; }
  .header-fitment { padding-top: 6px; }
  .header-info-company { display: none; }
  .category-nav { display: none; }
  .category-nav.is-open {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--ali-border);
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
  }
  .category-nav.is-open .category-nav-menu { flex-direction: column; min-width: 0; }
  .category-nav.is-open .category-nav-menu a { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; }
  .hero-track { height: 220px; }
  .footer-grid { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}
