/* Category Hub — marketplace layout inspired by common hub storefronts */

body[data-landing-category-hub="1"] {
  /* Theme-aware tokens (fallbacks keep classic hub look when no theme is set) */
  --ch-page: var(--bg-section, var(--bg, #eaeded));
  --ch-ink: var(--text, #0f1111);
  --ch-muted: var(--text-muted, #565959);
  --ch-navy: color-mix(in srgb, var(--primary, #131921) 82%, #000);
  --ch-navy-2: color-mix(in srgb, var(--primary, #232f3e) 70%, #000);
  --ch-navy-3: color-mix(in srgb, var(--primary, #37475a) 55%, #111);
  --ch-footer-bot: color-mix(in srgb, var(--primary, #131a22) 88%, #000);
  --ch-search: var(--accent, var(--primary, #febd69));
  --ch-search-hover: color-mix(in srgb, var(--accent, var(--primary, #f3a847)) 85%, #000);
  --ch-sign: var(--accent, var(--primary, #ffd814));
  --ch-sign-hover: color-mix(in srgb, var(--accent, var(--primary, #f7ca00)) 88%, #000);
  --ch-link: var(--primary, #007185);
  --ch-link-hover: var(--primary-hover, var(--primary, #c7511f));
  --ch-card: var(--card-bg, #fff);
  --ch-border: var(--card-border, #d5d9d9);
  --ch-yellow: var(--accent, var(--primary, #ffd814));
  --ch-yellow-hover: color-mix(in srgb, var(--accent, var(--primary, #f7ca00)) 88%, #000);
  --ch-orange: color-mix(in srgb, var(--accent, var(--primary, #ffa41c)) 72%, #ff8c00);
  --ch-orange-hover: color-mix(in srgb, var(--accent, var(--primary, #fa8900)) 60%, #e07000);
  --ch-green: color-mix(in srgb, var(--primary, #007600) 45%, #007600);
  --ch-star: var(--accent, var(--primary, #de7921));
  background: var(--ch-page) !important;
  color: var(--ch-ink);
}

body[data-landing-category-hub="1"] .public-appbar-wrapper,
body[data-landing-category-hub="1"] #appbarSpacer {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
}

body[data-landing-category-hub="1"] #main-content {
  background: var(--ch-page);
  padding: 0;
}

.ch-page { min-height: 60vh; }

/* —— Header —— */
.ch-header {
  background: var(--ch-navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1040;
}

.ch-header-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  max-width: 1600px;
  margin: 0 auto;
}

.ch-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  padding: 0.25rem 0.4rem;
  border: 1px solid transparent;
  border-radius: 2px;
  min-height: 44px;
}

.ch-logo:hover,
.ch-logo:focus-visible {
  border-color: #fff;
  outline: none;
}

.ch-logo img {
  height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

.ch-logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.ch-logo-text span { color: var(--ch-search); }

.ch-deliver {
  flex: 0 0 auto;
  display: none;
  align-items: flex-start;
  gap: 0.25rem;
  color: #ccc;
  text-decoration: none;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 2px;
  line-height: 1.15;
  min-height: 44px;
}

.ch-deliver:hover { border-color: #fff; color: #fff; }
.ch-deliver i { margin-top: 0.85rem; font-size: 1rem; }
.ch-deliver small { display: block; font-size: 0.72rem; color: #ccc; }
.ch-deliver strong { display: block; font-size: 0.85rem; color: #fff; font-weight: 700; }

@media (min-width: 992px) {
  .ch-deliver { display: flex; }
}

.ch-search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.ch-search-dept {
  flex: 0 0 auto;
  border: 0;
  background: #e6e6e6;
  color: #555;
  font-size: 0.75rem;
  padding: 0 0.55rem;
  max-width: 7rem;
  cursor: pointer;
  border-right: 1px solid #cdcdcd;
}

.ch-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  padding: 0 0.65rem;
  font-size: 0.95rem;
  color: var(--ch-ink);
  outline: none;
}

.ch-search-btn {
  flex: 0 0 45px;
  border: 0;
  background: var(--ch-search);
  color: #111;
  cursor: pointer;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
}

.ch-search-btn:hover { background: var(--ch-search-hover); }
.ch-search-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.ch-header-tools {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  flex: 0 0 auto;
}

.ch-tool {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 2px;
  line-height: 1.1;
  min-height: 44px;
  cursor: pointer;
}

.ch-tool:hover { border-color: #fff; color: #fff; }
.ch-tool:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.ch-tool small { font-size: 0.7rem; color: #ccc; }
.ch-tool strong { font-size: 0.82rem; font-weight: 700; }

.ch-tool--cart {
  flex-direction: row;
  align-items: flex-end;
  gap: 0.2rem;
  position: relative;
  font-weight: 700;
}

.ch-tool--cart i { font-size: 1.55rem; line-height: 1; }
.ch-cart-badge {
  position: absolute;
  top: 0.15rem;
  left: 1.05rem;
  color: var(--ch-search);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

@media (max-width: 767.98px) {
  .ch-tool:not(.ch-tool--cart):not(.ch-tool--lang) { display: none; }
  .ch-search-dept { display: none; }
}

/* Secondary nav */
.ch-subnav {
  background: var(--ch-navy-2);
  color: #fff;
}

.ch-subnav-inner {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0.2rem 0.75rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.ch-subnav a,
.ch-subnav button {
  flex: 0 0 auto;
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  min-height: 36px;
}

.ch-subnav a:hover,
.ch-subnav button:hover { border-color: #fff; }
.ch-subnav a:focus-visible,
.ch-subnav button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.ch-subnav-all {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700 !important;
}

/* —— Hero carousel of tall category cards —— */
.ch-hero {
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary, #131921) 16%, var(--ch-page)) 0%, var(--ch-page) 70%);
  padding: 0.75rem 0 0;
  overflow: hidden;
}

.ch-hero-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(to bottom, transparent, var(--ch-page));
  pointer-events: none;
  z-index: 1;
}

.ch-hero-track-wrap {
  position: relative;
  z-index: 2;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.ch-hero-track {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem 0.25rem 1.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ch-hero-track::-webkit-scrollbar { display: none; }

.ch-hero-card {
  flex: 0 0 min(42vw, 220px);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ch-ink);
  min-height: 280px;
  box-shadow: 0 2px 8px rgba(15, 17, 17, 0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

@media (min-width: 768px) {
  .ch-hero-card {
    flex-basis: 200px;
    min-height: 320px;
  }
}

@media (min-width: 1200px) {
  .ch-hero-card {
    flex-basis: 210px;
    min-height: 340px;
  }
}

.ch-hero-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 17, 17, 0.16);
  color: var(--ch-ink);
}

.ch-hero-card:focus-visible {
  outline: 3px solid var(--ch-search);
  outline-offset: 2px;
}

.ch-hero-card:nth-child(6n+1) { background: color-mix(in srgb, var(--primary, #16a34a) 18%, var(--ch-card)); }
.ch-hero-card:nth-child(6n+2) { background: color-mix(in srgb, var(--accent, var(--primary)) 22%, var(--ch-card)); }
.ch-hero-card:nth-child(6n+3) { background: color-mix(in srgb, var(--secondary, var(--primary-hover, var(--primary))) 20%, var(--ch-card)); }
.ch-hero-card:nth-child(6n+4) { background: color-mix(in srgb, var(--primary, #0284c7) 14%, var(--ch-card)); }
.ch-hero-card:nth-child(6n+5) { background: color-mix(in srgb, var(--accent, var(--primary)) 16%, var(--ch-card)); }
.ch-hero-card:nth-child(6n+6) { background: color-mix(in srgb, var(--secondary, var(--primary)) 12%, var(--ch-card)); }

.ch-hero-card-title {
  margin: 0;
  padding: 0.85rem 0.9rem 0.35rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-hero-card-img {
  flex: 1;
  display: grid;
  place-items: end center;
  padding: 0.35rem 0.5rem 0;
  min-height: 160px;
}

.ch-hero-card-img img,
.ch-hero-card-img picture,
.ch-hero-card-img picture img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
}

.ch-hero-card-ph {
  width: 100%;
  height: 160px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  opacity: 0.45;
}

.ch-hero-card-cta {
  padding: 0.55rem 0.9rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ch-link);
}

.ch-hero-arrow {
  position: absolute;
  top: 40%;
  z-index: 3;
  width: 44px;
  height: 72px;
  border: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  color: #111;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
}

.ch-hero-arrow:hover { background: #fff; }
.ch-hero-arrow:focus-visible {
  outline: 2px solid var(--ch-navy);
  outline-offset: 2px;
}

.ch-hero-arrow--left { left: 0.35rem; }
.ch-hero-arrow--right { right: 0.35rem; }

@media (max-width: 575.98px) {
  .ch-hero-arrow { display: none; }
}

/* —— Deck / category grids —— */
.ch-deck {
  position: relative;
  z-index: 4;
  margin-top: -1.5rem;
  padding: 0 0.75rem 1.25rem;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

.ch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .ch-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1200px) {
  .ch-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.15rem;
  }
}

.ch-card {
  background: var(--ch-card);
  border-radius: 2px;
  padding: 1rem 1rem 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  contain: content;
}

.ch-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.ch-card-head:hover .ch-card-title { color: var(--ch-link); }
.ch-card-head:focus-visible {
  outline: 2px solid var(--ch-link);
  outline-offset: 2px;
}

.ch-card-title {
  margin: 0;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ch-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-card-chevron {
  flex-shrink: 0;
  color: var(--ch-muted);
  font-size: 1.1rem;
  margin-top: 0.15rem;
}

.ch-quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 0.75rem;
  flex: 1;
}

.ch-tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  cursor: pointer;
  border-radius: 2px;
}

.ch-tile:hover .ch-tile-label { color: var(--ch-link); text-decoration: underline; }
.ch-tile:focus-visible {
  outline: 2px solid var(--ch-link);
  outline-offset: 2px;
}

.ch-tile-img {
  aspect-ratio: 1;
  background: #f7f8f8;
  border-radius: 2px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.ch-tile-img img,
.ch-tile-img picture,
.ch-tile-img picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch-tile-img .ch-ph {
  font-size: 1.6rem;
  color: var(--ch-muted);
  opacity: 0.5;
}

.ch-tile-label {
  font-size: 0.78rem;
  line-height: 1.25;
  color: var(--ch-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-card-foot {
  margin-top: 0.85rem;
}

.ch-card-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ch-link);
  text-decoration: none;
  cursor: pointer;
}

.ch-card-link:hover { text-decoration: underline; color: var(--ch-link-hover); }
.ch-card-link:focus-visible {
  outline: 2px solid var(--ch-link);
  outline-offset: 2px;
}

/* Sign-in strip */
.ch-signin {
  max-width: 1600px;
  margin: 1rem auto 0;
  padding: 0 0.75rem;
}

.ch-signin-inner {
  background: #fff;
  border: 1px solid var(--ch-border);
  text-align: center;
  padding: 1.35rem 1rem 1.5rem;
}

.ch-signin-inner p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.ch-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 260px);
  min-height: 32px;
  padding: 0.35rem 1.5rem;
  border-radius: 20px;
  border: 1px solid #fcd200;
  background: linear-gradient(to bottom, #ffe566, var(--ch-sign));
  color: #0f1111;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(213, 217, 217, 0.5);
}

.ch-signin-btn:hover {
  background: linear-gradient(to bottom, #ffe14a, var(--ch-sign-hover));
  color: #0f1111;
}

.ch-signin-btn:focus-visible {
  outline: 2px solid var(--ch-navy);
  outline-offset: 2px;
}

.ch-signin-sub {
  margin: 0.55rem 0 0 !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  color: var(--ch-muted);
}

.ch-signin-sub a {
  color: var(--ch-link);
  text-decoration: none;
}

.ch-signin-sub a:hover { text-decoration: underline; color: var(--ch-link-hover); }

/* Deals rail */
.ch-panel {
  max-width: 1600px;
  margin: 1rem auto 0;
  padding: 0 0.75rem;
}

.ch-panel-inner {
  background: #fff;
  border: 1px solid var(--ch-border);
  padding: 1rem;
}

.ch-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ch-panel-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.ch-rail {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}

.ch-rail-card {
  flex: 0 0 140px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.ch-rail-card:hover .ch-rail-name { color: var(--ch-link); }
.ch-rail-img {
  aspect-ratio: 1;
  background: #f7f8f8;
  margin-bottom: 0.35rem;
  overflow: hidden;
}

.ch-rail-img img,
.ch-rail-img picture,
.ch-rail-img picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch-rail-name {
  margin: 0;
  font-size: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ch-rail-price {
  margin: 0.2rem 0 0;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Footer */
.ch-backtop {
  display: block;
  width: 100%;
  border: 0;
  background: var(--ch-navy-3);
  color: #fff;
  text-align: center;
  padding: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  margin-top: 1.5rem;
}

.ch-backtop:hover { background: #485769; color: #fff; }

.ch-footer {
  background: var(--ch-navy-2);
  color: #ddd;
}

.ch-footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
}

@media (min-width: 768px) {
  .ch-footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.ch-footer-cols h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.ch-footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ch-footer-cols li { margin: 0 0 0.45rem; }

.ch-footer-cols a {
  color: #ddd;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.35;
}

.ch-footer-cols a:hover { text-decoration: underline; color: #fff; }

.ch-footer-locale {
  border-top: 1px solid #3a4553;
  padding: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.ch-footer-brand {
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  margin-right: 0.5rem;
}

.ch-footer-brand span { color: var(--ch-search); }

.ch-locale-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #848688;
  border-radius: 3px;
  background: transparent;
  color: #ccc;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  text-decoration: none;
  cursor: pointer;
  min-height: 36px;
}

.ch-locale-btn:hover { color: #fff; border-color: #fff; }

.ch-footer-bottom {
  background: var(--ch-footer-bot);
  color: #999;
  text-align: center;
  padding: 1.25rem 1rem 2rem;
  font-size: 0.72rem;
}

.ch-footer-bottom a {
  color: #ddd;
  text-decoration: none;
  margin: 0 0.45rem;
}

.ch-footer-bottom a:hover { text-decoration: underline; }

.ch-mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1050;
  pointer-events: none;
}

.ch-mobile-menu.is-open { pointer-events: auto; }

.ch-mobile-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ch-mobile-menu.is-open .ch-mobile-backdrop { opacity: 1; }

.ch-mobile-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(86vw, 320px);
  background: #fff;
  color: var(--ch-ink);
  transform: translateX(-105%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  padding: 0;
}

.ch-mobile-menu.is-open .ch-mobile-drawer { transform: translateX(0); }

.ch-mobile-drawer-head {
  background: var(--ch-navy-2);
  color: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.ch-mobile-drawer-head button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  cursor: pointer;
}

.ch-mobile-drawer a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--ch-ink);
  text-decoration: none;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

.ch-mobile-drawer a:hover { background: #f5f5f5; }

@media (prefers-reduced-motion: reduce) {
  .ch-hero-card,
  .ch-mobile-drawer,
  .ch-mobile-backdrop { transition: none !important; }
}
