body.has-sidebar .main {
  margin-top: 97px; /* 60px (main header) + 32px (sub-header) + 5px (gap) */
  padding: 20px 20px 20px 190px; /* Add left padding to offset sidebar width (166px + 24px gap) */
  width: 100%; /* Remove max-width for true fluid layout */
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
  overflow-x: hidden; /* Prevent horizontal scroll */
  margin-bottom: 100px; /* Consistent margin between main content and footer */
}

/* Default main content styling for pages without sidebar */
.main {
  margin-top: 97px;
  padding: 20px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  margin-bottom: 100px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Use auto-fit for responsive columns */
  gap: 16px;
  align-items: stretch; /* Ensure all items have same height */
  justify-items: stretch; /* Ensure all items have same width */
  width: 100%;
  min-width: 0; /* Allow grid items to shrink */
}

/* When products grid contains only coming-soon message, center it */
.products-grid.showing-coming-soon {
  display: block;
  position: relative;
  min-height: 400px;
  width: 100%;
}

/* CLS-prevention: reserve the eventual product grid height until JS sets .is-loaded. */
.products-grid:not(.is-loaded):not(.showing-coming-soon) {
  min-height: min(900px, 100vh);
}

/* CLS-prevention: breadcrumb is added/removed dynamically, so reserve its row height. */
.breadcrumb-nav {
  min-height: 28px;
}

/* Fix for screen rotation */
@media screen and (orientation: portrait) {
  .main {
    padding: 20px;
    margin-top: 130px; /* Adjusted for collapsed sidebar */
  }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
  .main {
    margin-top: 80px;
    padding: 15px 15px 15px 180px;
  }
}

/* For very large screens, we can allow smaller minimum width */
@media (min-width: 1800px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

/* For medium screens, maintain optimized sizing */
@media (max-width: 1200px) and (min-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

.footer {
  position: relative;
  z-index: 10;
  left: 0;
  width: 100%;
}

@media (max-width: 899px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

/* Landscape orientation with more nuanced width controls */
@media (orientation: landscape) and (min-width: 1400px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (orientation: landscape) and (min-width: 1000px) and (max-width: 1399px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Portrait orientation - ensure containers have adequate width */
@media (orientation: portrait) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  }
}

@media (max-width: 800px) {
  body.has-sidebar .main {
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
  }
  
  body.has-sidebar .departments-sidebar {
    display: none;
  }
  
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Wider for mobile grid */
  }

  .product-container {
    min-height: 340px;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 450px) {
  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Wider minimum width for small screens */
  }

  .product-container {
    padding: 18px;
    min-height: 320px;
    width: 100%;
    box-sizing: border-box;
  }
}

.product-container {
  padding: 22px 18px 18px;
  border: 1px solid rgb(231, 231, 231);
  border-radius: 16px;
  background-color: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  row-gap: 10px;
  min-height: 360px;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  content-visibility: auto;
  contain-intrinsic-size: 360px;
}

.product-container:hover {
  box-shadow: 0 12px 24px rgba(35, 47, 62, 0.1);
  transform: translateY(-2px);
}

.product-image-container {
  display: flex;
  justify-content: center;
  align-items: center;

  height: 165px;
  margin-bottom: 16px;
}

.product-image-link {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
}

.product-image-link:hover .product-image {
  transform: scale(1.05);
  transition: transform 0.2s;
}

.product-image {
  /* Images will overflow their container by default. To
    prevent this, we set max-width and max-height to 100%
    so they stay inside their container. */
  max-width: 100%;
  max-height: 100%;
  transition: transform 0.2s;
}

.product-name {
  margin-bottom: 4px;
  min-height: 3.2em;
}

.product-link {
  text-decoration: none;
  color: inherit;
}

.product-link.limit-text-to-2-lines {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.6;
}

.product-link:hover {
  color: rgb(1, 124, 182);
  text-decoration: underline;
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background-color: rgba(35, 47, 62, 0.08);
  color: #232F3E;
}

.product-badge.badge-accent {
  background-color: rgba(255, 153, 0, 0.2);
  color: #c45500;
}

.product-meta {
  font-size: 13px;
  color: #5f6b7a;
  margin-bottom: 4px;
}

.product-meta .product-sku {
  font-weight: 600;
  letter-spacing: 0.2px;
}

.product-specs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 10px;
}

.product-specs-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.product-specs-label {
  color: #5f6b7a;
  font-weight: 600;
  white-space: nowrap;
}

.product-specs-value {
  color: #1f2933;
  text-align: right;
  white-space: nowrap; /* keep dimensions on one line */
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
  flex: 1 1 auto;
  min-width: 0;
}
.product-specs-row .product-specs-label {
  flex: 0 0 auto;
}

.product-rating {
  display: flex;
  align-items: center;
  margin: 5px 0;
}

.product-rating-stars {
  color: #FFA41C;
  font-size: 16px;
  margin-right: 6px;
  letter-spacing: 1px;
}

.product-rating-count {
  color: #007185;
  cursor: pointer;
  font-size: 14px;
}

.product-rating-count:hover {
  text-decoration: underline;
}

.product-price {
  font-weight: 700;
  margin-bottom: 10px;
}

.product-quantity-container {
  margin-bottom: 17px;
}

.product-spacer {
  flex: 1;
  min-height: 10px; /* Ensure a minimum height for the spacer */
}

/* Card cart widget */
.card-cart-widget {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-cart-qty-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-cart-qty-btn {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: #f5f5f5;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.card-cart-qty-btn:hover {
  background: #e8e8e8;
  border-color: #999;
}

.card-cart-qty-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 600;
  height: 30px;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.card-cart-qty-input::-webkit-inner-spin-button,
.card-cart-qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.card-cart-helper {
  font-size: 11px;
  color: #5f6b7a;
  text-align: center;
  line-height: 1.3;
}

.card-error-message {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #c0392b;
}

.card-cart-qty-input.invalid {
  border-color: #c0392b;
  background: #fff5f5;
}

.card-added-message {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #067d62;
}

.added-to-cart {
  color: rgb(6, 125, 98);
  font-size: 16px;

  /* Move to left and above the button */
  display: inline-block;
  position: static;
  width: auto;
  margin: 0 0 0 12px;
  text-align: left;
  vertical-align: middle;
  opacity: 0;
  z-index: auto;
}

.added-to-cart img {
  height: 20px;
  margin-right: 5px;
}

.add-to-cart-button,
.continue-shopping-button {
  width: 100%;
  padding: 8px;
  border-radius: 50px;
  background-color: #232F3E;
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 16px;
  transition: background-color 0.2s;
  text-decoration: none; /* Remove underline for anchor tags */
  text-align: center; /* Center the text */
  display: inline-block; /* Ensure proper block behavior for anchor tags */
}

.add-to-cart-button:hover,
.continue-shopping-button:hover {
  background-color: #1A252F;
}

.product-quantity-section {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
  height: 35px;
}

.product-quantity-container {
  margin-bottom: 0;
}

.added-message {
  display: none;
  color: green;
  font-weight: bold;
  padding: 3px 8px;
  margin-left: 10px;
  animation: fadeIn 0.5s;
}

.page-header {
  margin: 20px 0;
  text-align: center;
  font-size: 28px;
  font-weight: bold;
  color: #232F3E;
  border-bottom: 3px solid #FF9900;
  padding-bottom: 15px;
  background: linear-gradient(135deg, #232F3E 0%, #37475A 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
  animation: fadeInHeader 0.5s ease-out;
}

@keyframes fadeInHeader {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading animation styles */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #FF9900;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-container p {
  color: #565959;
  font-size: 16px;
  margin: 0;
}

/* Smooth transitions for submenu */
.submenu {
  transition: all 0.3s ease-in-out;
  transform-origin: top;
}

.submenu.active {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Product grid fade-in animation */
.js-prodcts-grid {
  transition: opacity 0.3s ease-in-out;
}

.products-grid-loading {
  opacity: 0.5;
}

/* Hover effects for department links */
.department-link {
  transition: background-color 0.2s ease, color 0.2s ease;
}

.department-link:hover {
  background-color: #f0f0f0;
  color: #FF9900;
}

/* Selected menu item styling */
/* .department-link.selected-brand {
  background-color: #FF9900;
  color: white;
  font-weight: bold;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(255, 153, 0, 0.3);
} */

/* Breadcrumb navigation styling */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 15px;
  font-size: 14px;
}

.breadcrumb-link {
  color: #37475A;
  text-decoration: none;
}

.breadcrumb-link:hover {
  text-decoration: underline;
  color: #c45500;
}

.breadcrumb-separator {
  margin: 0 8px;
  color: #555;
}

.breadcrumb-current {
  color: #333;
  font-weight: 500;
}

.coming-soon {
  width: 100%;
  max-width: 600px;
  padding: 40px;
  text-align: center;
  background-color: #f8f8f8;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.coming-soon h2 {
  font-size: 24px;
  color: #232F3E;
  margin-bottom: 15px;
}

.coming-soon p {
  font-size: 16px;
  color: #555;
}

/* Responsive design for coming-soon message */
@media (max-width: 768px) {
  .coming-soon {
    max-width: 90%;
    padding: 30px 20px;
  }
  
  .coming-soon h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .coming-soon p {
    font-size: 14px;
  }
}

/* Enhanced visual feedback for menu interactions */
.department-link {
  position: relative;
  overflow: hidden;
}

.department-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 153, 0, 0.2), transparent);
  transition: left 0.5s ease;
}

.department-link:hover::before {
  left: 100%;
}

/* Highlight the active sub-header link */
.sub-header-link.active, .sub-header-link.selected {
  background-color: #fff;
  color: #232F3E;
  border-bottom: 3px solid #FF9900;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  z-index: 2;
}

/* Improved mobile responsiveness */
@media (max-width: 800px) {
  .department-link.selected-brand {
    margin: 2px 0;
  }
  
  .page-header {
    font-size: 24px;
    margin: 15px 0;
    padding-bottom: 10px;
  }

  .breadcrumb-nav {
    font-size: 12px;
    padding: 10px;
    margin-bottom: 8px;
  }
  
  .breadcrumb-separator {
    margin: 0 4px;
  }
}

/* Hero Banner Section */
.hero-banner {
  width: 100%;
  margin-bottom: 40px;
  padding: 0;
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.qili-direct-catalog-route .hero-banner {
  display: none;
}

/* Carousel Container */
.hero-carousel {
  --hero-viewport-offset: 132px;
  --hero-media-min-height: 180px;
  --hero-media-max-height: 388px;
  --hero-content-height: 240px;
  --hero-media-height: clamp(
    var(--hero-media-min-height),
    calc(100vh - var(--hero-viewport-offset) - var(--hero-content-height)),
    var(--hero-media-max-height)
  );
  --hero-media-height: clamp(
    var(--hero-media-min-height),
    calc(100svh - var(--hero-viewport-offset) - var(--hero-content-height)),
    var(--hero-media-max-height)
  );
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  background: #fff;
}

.hero-container {
  position: relative;
  width: 100%;
  height: calc(var(--hero-media-height) + var(--hero-content-height));
  overflow: hidden;
}

.hero-initial-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  padding: 28px 30px 34px;
  box-sizing: border-box;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(11, 29, 51, 0.18) 0%, rgba(11, 29, 51, 0.92) 100%),
    linear-gradient(135deg, #13293d 0%, #24476c 100%);
}

.hero-initial-logo {
  align-self: center;
  margin: auto auto;
  transform: translateY(-14px);
  width: auto;
  max-width: min(560px, 70%);
  max-height: 58%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.hero-initial-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-kicker {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: rgba(255, 232, 163, 0.96);
}

.hero-initial-state h1 {
  margin: 0;
  max-width: 900px;
  font-size: 2.1rem;
  line-height: 1.15;
}

.hero-initial-state p:last-child {
  margin: 0;
  max-width: 760px;
  font-size: 1.05rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
}

.hero-slide.prev {
  transform: translateX(-100%);
}

.hero-card {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fff;
}

.hero-card:hover {
  transform: translateY(-2px);
}

.hero-card-link {
  display: grid;
  grid-template-rows: var(--hero-media-height) var(--hero-content-height);
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.hero-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
  background: #f8f9fa;
}

.hero-card:hover .hero-image {
  transform: scale(1.02);
}

.hero-card-toy .hero-image {
  object-fit: contain;
  filter: saturate(1.1) contrast(1.05);
}

.hero-card-toy .hero-image-wrapper {
  background: linear-gradient(135deg, #0b1d33 0%, #122b45 100%);
}

.hero-content {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 18px 28px;
  box-sizing: border-box;
  color: #16263b;
  background: #fff;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  transition: background-color 0.3s ease;
}

.hero-card:hover .hero-content {
  background: #fffaf0;
}

.hero-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-bottom: 2px;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.24;
  margin: 0;
  color: #16263b;
  text-shadow: none;
  overflow-wrap: anywhere;
}

.hero-meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #607080;
  overflow-wrap: anywhere;
}

.hero-price {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #b45309;
  text-shadow: none;
}

.hero-trade-summary {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 20px;
  row-gap: 4px;
  margin: 0;
  min-width: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.hero-trade-row {
  display: contents;
}

.hero-trade-price {
  align-self: baseline;
  color: #425466;
  font-weight: 700;
  white-space: nowrap;
}

.hero-trade-currency {
  color: #26384a;
}

.hero-trade-price-value {
  color: #607080;
}

.hero-trade-detail {
  align-self: baseline;
  min-width: 0;
  color: #425466;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.hero-trade-label {
  color: #26384a;
  font-weight: 700;
}

.hero-trade-value {
  color: #607080;
}

.hero-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  font-size: 0.95rem;
  margin: 0;
  color: #425466;
  line-height: 1.45;
  text-shadow: none;
  overflow-wrap: anywhere;
}

.custom-sourcing-strip {
  width: 100%;
  padding: 18px 24px;
  background: #f7fafc;
  border-top: 1px solid #d8e1ea;
  border-bottom: 1px solid #d8e1ea;
}

.custom-sourcing-strip p {
  max-width: 1180px;
  margin: 0 auto;
  color: #26384a;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.custom-sourcing-strip p.custom-sourcing-note {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
}

.custom-sourcing-note span {
  display: inline;
}

.custom-sourcing-note span + span::before {
  content: " ";
}

.custom-sourcing-strip strong {
  color: #122b45;
}

.homepage-compliance-strip {
  width: 100%;
  padding: 12px 24px;
  background: #fff8eb;
  border-bottom: 1px solid #ead8bd;
}

.homepage-compliance-strip p {
  max-width: 1180px;
  margin: 0 auto;
  color: #2d3642;
  font-size: 0.92rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.homepage-compliance-strip strong {
  color: #7a3e07;
}

.homepage-compliance-strip a {
  color: #0066c0;
  font-weight: 600;
  text-decoration: none;
}

.homepage-compliance-strip a:hover {
  text-decoration: underline;
}

.homepage-b2b-guide {
  max-width: 1180px;
  margin: 52px auto 0;
  color: #243244;
  line-height: 1.72;
}

.homepage-b2b-guide[hidden] {
  display: none !important;
}

.homepage-b2b-intro,
.homepage-b2b-section {
  padding: 34px 0;
  border-top: 1px solid #d8e1ea;
}

.homepage-b2b-section:last-child {
  border-bottom: 1px solid #d8e1ea;
}

.homepage-b2b-kicker {
  margin: 0 0 8px;
  color: #8a4b0f;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.homepage-b2b-guide h2 {
  margin: 0 0 16px;
  color: #172436;
  font-size: 1.55rem;
  line-height: 1.25;
}

.homepage-b2b-guide h3 {
  margin: 0 0 8px;
  color: #243244;
  font-size: 1.05rem;
  line-height: 1.35;
}

.homepage-b2b-guide p {
  margin: 0 0 16px;
  max-width: 980px;
  font-size: 1rem;
}

.homepage-b2b-guide p:last-child {
  margin-bottom: 0;
}

.homepage-b2b-guide a {
  color: #0f5d85;
  font-weight: 600;
  text-decoration: none;
}

.homepage-b2b-guide a:hover {
  color: #9a540f;
  text-decoration: underline;
}

/* ponytail: boring photo pair; no zig-zag layout to rebalance per browser. */
.why-qili-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 820px;
  margin: 20px auto 28px;
}
.why-qili-photo {
  margin: 0;
}
.why-qili-photo img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(13, 27, 42, 0.14);
  display: block;
}
.why-qili-photo figcaption {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #4a5b6d;
  line-height: 1.5;
  text-align: left;
}
/* ponytail: single-figure trust block; portrait crop, no grid. */
.why-qili-single-photo {
  max-width: 360px;
  margin: 24px auto 28px;
}
.why-qili-single-photo img {
  height: auto;
  aspect-ratio: 720 / 831;
}
@media (max-width: 760px) {
  .why-qili-photos {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .why-qili-photo img {
    height: min(255px, 62vw);
  }
  .why-qili-single-photo {
    max-width: min(280px, 70vw);
  }
  .why-qili-single-photo img {
    height: auto;
  }
}

.homepage-faq-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 34px;
}

.homepage-faq-list article {
  min-width: 0;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  background: #122b45;
  padding: 10px 20px;
  border-radius: 30px;
  border: 2px solid #122b45;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  width: fit-content;
}

.hero-card:hover .hero-cta {
  background: #1d4f7a;
  border-color: #1d4f7a;
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(18, 43, 69, 0.2);
}

.hero-cta-secondary {
  margin-left: 0;
  background: transparent;
  color: #122b45;
  border-color: rgba(18, 43, 69, 0.35);
  padding: 12px 22px;
}

.hero-card:hover .hero-cta-secondary {
  background: rgba(18, 43, 69, 0.08);
  border-color: rgba(18, 43, 69, 0.55);
}

.hero-image-fallback {
  background: linear-gradient(135deg, #13293d 0%, #24476c 45%, #3d6c9f 100%);
}

/* Navigation Arrows */
.hero-nav-arrow {
  position: absolute;
  top: calc(var(--hero-media-height) / 2);
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  color: #333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.hero-nav-arrow:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.hero-nav-prev {
  left: 20px;
}

.hero-nav-next {
  right: 20px;
}

.hero-nav-arrow span {
  line-height: 1;
  transform: translateY(-1px);
}

/* Carousel Indicators */
.hero-indicators {
  position: absolute;
  top: calc(var(--hero-media-height) - 30px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: center;
  max-width: 90%;
  z-index: 10;
}

.hero-indicator {
  position: relative;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.2s ease;
}

.hero-indicator::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(15, 23, 42, 0.2);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.24);
  transform: translate(-50%, -50%);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.hero-indicator.active {
  transform: none;
}

.hero-indicator.active::before {
  width: 10px;
  height: 10px;
  border-color: rgba(255, 232, 163, 0.96);
  background: rgba(255, 232, 163, 0.92);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.32);
}

.hero-indicator:hover {
  transform: translateY(-1px);
}

.hero-indicator:hover::before {
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.72);
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
  .hero-carousel {
    --hero-viewport-offset: 112px;
    --hero-media-min-height: 170px;
    --hero-media-max-height: 372px;
    --hero-content-height: 230px;
  }
  
  .hero-title {
    font-size: 1.35rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-nav-arrow {
    width: 45px;
    height: 45px;
    font-size: 20px;
  }
  
  .hero-nav-prev {
    left: 15px;
  }
  
  .hero-nav-next {
    right: 15px;
  }
}

@media screen and (min-width: 769px) and (max-width: 1100px) {
  .hero-content {
    padding-right: 112px;
  }

  .hero-meta,
  .hero-description {
    line-height: 1.35;
  }

  .hero-description {
    -webkit-line-clamp: 1;
  }
}

@media screen and (max-width: 768px) {
  .homepage-b2b-guide {
    margin-top: 38px;
  }

  .homepage-b2b-intro,
  .homepage-b2b-section {
    padding: 28px 0;
  }

  .homepage-b2b-guide h2 {
    font-size: 1.35rem;
  }

  .homepage-faq-list {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hero-carousel {
    --hero-viewport-offset: 118px;
    --hero-media-min-height: 170px;
    --hero-media-max-height: 421px;
    --hero-content-height: 260px;
  }

  .hero-initial-state {
    padding: 28px 20px 24px;
  }

  .hero-initial-state h1 {
    font-size: 1.6rem;
  }

  .hero-initial-state p:last-child {
    font-size: 0.95rem;
  }
  
  .hero-title {
    font-size: 1.3rem;
  }

  .hero-trade-summary {
    column-gap: 16px;
    font-size: 0.92rem;
  }
  
  .hero-description {
    font-size: 0.95rem;
  }
  
  .hero-content {
    gap: 6px;
    padding: 16px 20px;
  }
  
  .hero-nav-arrow {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .hero-nav-prev {
    left: 10px;
  }
  
  .hero-nav-next {
    right: 10px;
  }
  
  .hero-cta {
    font-size: 0.86rem;
    padding: 9px 18px;
  }
}

@media screen and (max-width: 480px) {
  .hero-banner {
    margin-bottom: 30px;
  }
  
  .hero-carousel {
    --hero-viewport-offset: 168px;
    --hero-media-min-height: 160px;
    --hero-media-max-height: 388px;
    --hero-content-height: 240px;
  }
  
  .hero-title {
    font-size: 1.2rem;
  }

  .hero-trade-summary {
    column-gap: 10px;
    font-size: 0.82rem;
    line-height: 1.3;
  }
  
  .hero-description {
    font-size: 0.85rem;
  }
  
  .hero-cta {
    font-size: 0.76rem;
    padding: 7px 14px;
  }
  
  .hero-content {
    padding: 14px 16px;
  }
  
  .hero-nav-arrow {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
  
  .hero-indicators {
    top: calc(var(--hero-media-height) - 22px);
    gap: 5px;
    transform: translateX(-50%) scale(1) !important;
  }
  
  .hero-indicator {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    border-radius: 50% !important;
    border: 0 !important;
    background: transparent !important;
    transform: none !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
  }

  .hero-indicator::before {
    width: 6px;
    height: 6px;
  }
  
  .hero-indicator.active {
    background: transparent !important;
    transform: none !important;
  }

  .hero-indicator.active::before {
    width: 8px;
    height: 8px;
  }
  
  .hero-indicator:hover {
    transform: none !important;
  }
}

/* Large screen optimization */
@media screen and (min-width: 1400px) {
  .hero-carousel {
    --hero-media-max-height: 440px;
    --hero-content-height: 272px;
  }
  
  .hero-title {
    font-size: 1.7rem;
    line-height: 1.26;
  }
  
  .hero-description {
    font-size: 1rem;
  }
}

/* Search Results Styles */
.search-no-results {
  width: 100%;
  max-width: 600px;
  padding: 40px;
  text-align: center;
  background-color: #f8f8f8;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin: 40px auto;
}

.search-no-results h2 {
  font-size: 24px;
  color: #232F3E;
  margin-bottom: 15px;
}

.search-no-results p {
  font-size: 16px;
  color: #555;
  margin-bottom: 25px;
}

.search-suggestions {
  margin-top: 25px;
}

.search-suggestions h3 {
  font-size: 18px;
  color: #232F3E;
  margin-bottom: 15px;
}

.suggestion-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.suggestion-links a {
  padding: 8px 16px;
  background-color: #FF9900;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.suggestion-links a:hover {
  background-color: #e68900;
}

.search-results-info {
  padding: 15px 0;
  font-size: 16px;
  color: #666;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

.search-message {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Product container styling for mixed search results */
.product-container[data-product-type="printer"] {
  border-left: 4px solid #4CAF50;
}

.product-container[data-product-type="printhead"] {
  border-left: 4px solid #2196F3;
}

.product-container[data-product-type="printsparepart"] {
  border-left: 4px solid #FF9800;
}

.product-container[data-product-type="upgradingkit"] {
  border-left: 4px solid #9C27B0;
}

/* Responsive design for search results */
@media (max-width: 768px) {
  .search-no-results {
    max-width: 90%;
    padding: 30px 20px;
  }
  
  .search-no-results h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .search-no-results p {
    font-size: 14px;
  }
  
  .suggestion-links {
    flex-direction: column;
    align-items: center;
  }
  
  .suggestion-links a {
    width: 100%;
    max-width: 200px;
    text-align: center;
  }
  
  .search-results-info {
    font-size: 14px;
    padding: 10px 0;
  }
}

/* Mobile main content adjustments for fixed header */
@media (max-width: 768px) {
  .main,
  body.has-sidebar .main {
    margin-top: 97px !important; /* 60px header + 32px sub-header + 5px gap */
    padding-top: 20px !important;
  }
}

@media (max-width: 480px) {
  .main,
  body.has-sidebar .main {
    margin-top: 97px !important;
    padding-top: 15px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 320px) {
  .main,
  body.has-sidebar .main {
    margin-top: 92px !important; /* 55px header + 32px sub-header + 5px gap */
    padding-top: 15px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* d-内链布局 §1 — homepage hero picks (manual SKU rotation outside QILI SEO AUTO).
   Visibility gate mirrors .hero-banner: hidden on category hash / ?search routes
   so the homepage-scoped buyer-favorite SKU list does not leak into category views. */
.qili-direct-catalog-route .homepage-hero-picks {
  display: none;
}
.homepage-hero-picks {
  max-width: 1100px;
  margin: 32px auto;
  padding: 20px;
  background: #fafbfc;
  border-radius: 8px;
}
.homepage-hero-picks h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #1a2330;
}
.homepage-hero-picks > p {
  margin: 0 0 12px;
  color: #4a5563;
  font-size: 14px;
  line-height: 1.5;
}
.hero-picks-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.hero-picks-list li {
  padding: 8px 0;
  border-bottom: 1px solid #e8eaef;
  font-size: 14px;
  color: #4a5563;
}
.hero-picks-list li:last-child {
  border-bottom: none;
}
.hero-picks-list li a {
  color: #0066c0;
  text-decoration: none;
  font-weight: 500;
}
.hero-picks-list li a:hover {
  text-decoration: underline;
}
