/* ============================================================
   HOMEPAGE V2 — Grouped Categories (scoped to body#home)
   ============================================================ */

body#home {
  background: #fff;
  font-family: var(--v5-font-body);
  color: var(--v5-text);
}

/* Reset stale layouts that the legacy theme injects on body#home */
body#home .content > .container.banner-box { display: none; }
body#home .content { padding-top: 0; padding-bottom: 0; background: #fff; }

/* ---------- HERO (V2: dark slab with kicker + headline + search) ---------- */
body#home section.home-search {
  background: var(--v5-dark-bg);
  padding: 0;
  margin: 0;
  width: 100%;
}
body#home section.home-search > .container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 48px;
}
body#home section.home-search > .container > .box {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
body#home .v2-hero-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
body#home .v2-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--v5-brand);
  font-family: var(--v5-font-body);
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  width: fit-content;
}
body#home .v2-hero-kicker::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--v5-brand);
  display: block;
}
body#home .v2-hero-title {
  font-family: var(--v5-font-button);
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  margin: 0;
  padding: 0;
}
body#home .v2-hero-sub {
  font-family: var(--v5-font-body);
  font-size: 13px;
  font-weight: 400;
  color: #999;
  margin: 0;
  padding: 0;
}
body#home .v2-hero-form {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: #fff;
  padding: 4px;
  width: 460px;
  flex: 0 0 460px;
  position: relative; /* anchor for .results dropdown — span full form width incl. submit */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
body#home .v2-hero-form .v2-hero-input {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
}
/* Loader pseudo (.picker.pattern.loading:after) would re-anchor to form and land on
   top of the submit button — kill it on the hero, the search button is right there. */
body#home .v2-hero-form .v2-hero-input.loading:after { display: none; }
body#home .v2-hero-form .v2-hero-input svg {
  width: 16px;
  height: 16px;
  color: #999;
  flex-shrink: 0;
}
body#home .v2-hero-form input[type="text"] {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--v5-font-body);
  font-size: 13px;
  color: var(--v5-text);
  width: 100%;
  min-width: 0;
  padding: 0;
  height: auto;
  border-radius: 0;
}
/* Kill global input:focus ring (style.css:1802) + underline (style.css:1215) */
body#home .v2-hero-form input[type="text"]:focus,
body#home .v2-hero-form input[name="sPattern"]:focus {
  border: none;
  outline: none;
  box-shadow: none;
  text-decoration: none;
}
body#home .v2-hero-form input[type="text"]::placeholder { color: #999; }

/* ---------- Hero suggest dropdown — square corners + brand colors ---------- */
body#home .v2-hero-form .v2-hero-input .results {
  left: 0;
  right: 0;
  margin-top: 4px;
  border-radius: 0;
  border: 1px solid var(--v5-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  padding: 4px 0;
}
body#home .v2-hero-form .v2-hero-input .results .row.minlength {
  border-radius: 0;
  color: var(--v5-brand);
  border-bottom: 1px solid var(--v5-border);
  margin: 0 0 8px 0;
}
body#home .v2-hero-form .v2-hero-input .results .row.defloc {
  margin-top: 4px;
}
body#home .v2-hero-form .v2-hero-input .results .row.defloc > a {
  border-radius: 0;
  color: var(--v5-brand);
  background: var(--v5-surface-tint);
}
body#home .v2-hero-form .v2-hero-input .results .row.defloc > a:hover {
  background: var(--v5-tint-border);
  text-decoration: none;
}
body#home .v2-hero-form .v2-hero-input .results .row.defloc > a svg {
  fill: var(--v5-brand);
  color: var(--v5-brand);
  width: auto;
  height: auto;
}
body#home .v2-hero-form .v2-hero-input .results .option {
  border-radius: 0;
  color: var(--v5-text);
}
body#home .v2-hero-form .v2-hero-input .results .option:hover,
body#home .v2-hero-form .v2-hero-input .results .option:active {
  background: var(--v5-surface-tint);
  color: var(--v5-brand);
  text-decoration: none;
}
body#home .v2-hero-form .v2-hero-submit {
  flex: 0 0 auto;
  background: var(--v5-brand);
  color: #fff;
  border: none;
  padding: 10px 20px;
  font-family: var(--v5-font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  height: auto;
  line-height: 1;
}
body#home .v2-hero-form .v2-hero-submit:hover { opacity: 0.92; }

/* Hide legacy hero leftovers we don't render anymore */
body#home section.home-search .latest-search,
body#home section.home-search h2,
body#home section.home-search #home-cat { display: none; }

/* ---------- CATEGORIES GROUPED ---------- */
body#home .v2-cats {
  width: 100%;
  padding: 72px 0;
  border-top: 3px solid var(--v5-brand);
}
body#home .v2-cats-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}
body#home .v2-cats-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 48px;
}
body#home .v2-cats-title {
  font-family: var(--v5-font-button);
  font-size: 40px;
  font-weight: 700;
  color: var(--v5-text);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0;
}
body#home .v2-cats-accent {
  width: 48px;
  height: 3px;
  background: var(--v5-brand);
}
body#home .v2-cats-sub {
  font-family: var(--v5-font-body);
  font-size: 16px;
  font-weight: 400;
  color: #666;
  line-height: 1.5;
  margin: 0;
}
body#home .v2-cats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
body#home .v2-cats-col {
  display: flex;
  flex-direction: column;
  gap: 56px;
  padding: 0 40px;
  border-right: 1px solid var(--v5-border);
}
body#home .v2-cats-col:first-child { padding-left: 0; }
body#home .v2-cats-col:last-child { padding-right: 0; border-right: none; }
body#home .v2-cats-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body#home .v2-cats-group-head {
  font-family: var(--v5-font-button);
  font-size: 18px;
  font-weight: 700;
  color: var(--v5-text);
  letter-spacing: -0.2px;
  line-height: 1.2;
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
body#home .v2-cats-group-head:hover { color: var(--v5-brand); }
body#home .v2-cats-group-empty .v2-cats-group-head,
body#home .v2-cats-group-empty .v2-cats-group-head .v2-cats-group-name { color: #aaa; }
body#home .v2-cats-group-empty .v2-cats-group-head:hover,
body#home .v2-cats-group-empty .v2-cats-group-head:hover .v2-cats-group-name { color: var(--v5-brand); }
body#home .v2-cats-count {
  font-family: var(--v5-font-body);
  font-size: 11px;
  font-weight: 600;
  color: #888;
  background: var(--v5-surface);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}
body#home .v2-cats-count-soon {
  color: #aaa;
  background: transparent;
  border: 1px solid var(--v5-border);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.3px;
}
body#home .v2-cats-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
body#home .v2-cats-list li { margin: 0; padding: 0; list-style: none; }
body#home .v2-cats-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--v5-font-body);
  font-size: 13px;
  font-weight: 400;
  color: #666;
  text-decoration: none;
  line-height: 1.4;
  padding: 4px 0;
}
body#home .v2-cats-list a::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--v5-border);
  flex-shrink: 0;
}
body#home .v2-cats-list a:hover { color: var(--v5-brand); }
body#home .v2-cats-list a:hover::before { background: var(--v5-brand); }
body#home .v2-cats-list-empty a { color: #aaa; }
body#home .v2-cats-list-empty a:hover { color: var(--v5-brand); }
body#home .v2-cats-list-count {
  font-family: var(--v5-font-body);
  font-size: 11px;
  font-weight: 500;
  color: #999;
  margin-left: auto;
  padding-left: 12px;
}

/* ---------- SHARED V2 SECTION (Nearby / Companies / Latest) ---------- */
body#home .v2-section { width: 100%; padding: 72px 0; }
body#home .v2-section-tint { background: var(--v5-surface); }
body#home .v2-section-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}
body#home .v2-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}
body#home .v2-section-head-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
body#home .v2-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--v5-font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--v5-brand);
  text-transform: uppercase;
}
body#home .v2-eyebrow svg { color: var(--v5-brand); flex-shrink: 0; }
body#home .v2-section-title {
  font-family: var(--v5-font-button);
  font-size: 32px;
  font-weight: 700;
  color: var(--v5-text);
  line-height: 1.2;
  margin: 0;
}
body#home .v2-section-sub {
  font-family: var(--v5-font-body);
  font-size: 14px;
  font-weight: 400;
  color: #666;
  line-height: 1.5;
  margin: 0;
}
body#home .v2-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--v5-font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--v5-brand);
  text-decoration: none;
  white-space: nowrap;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}
body#home .v2-all-link:hover { text-decoration: underline; }
body#home .v2-all-link svg { color: var(--v5-brand); flex-shrink: 0; }

/* Item grid (4 across) */
body#home .v2-grid { display: grid; gap: 20px; }
body#home .v2-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Reset legacy listing-card chrome on home so V2 grid lays out cleanly.
   `eps_draw_item` outputs `.simple-prod` with calc(25%-8px) width and 4px
   side margins from style.css line 977 — those break inside a grid track. */
body#home .v2-section .v2-grid > .simple-prod,
body#home .v2-section .v2-grid > .listing,
body#home .v2-section .v2-grid > .product {
  width: 100%;
  max-width: none;
  margin: 0;
  float: none;
  flex: 1 1 auto;
}
body#home .v2-section .v2-grid .simple-prod,
body#home .v2-section .v2-grid .listing {
  background: #fff;
  border: 1px solid var(--v5-border);
  border-radius: 0;
  box-shadow: none;
}

/* Companies block — keep plugin markup but clear floats so the next section
   isn't squeezed beside the floated company cards */
body#home .v2-business-box {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: stretch;
}
body#home .v2-business-box::after { content: ''; display: block; clear: both; }
body#home .v2-business-box > * { float: none !important; margin: 0 !important; }

body#home .v2-empty {
  padding: 32px;
  background: #fff;
  border: 1px solid var(--v5-border);
  font-family: var(--v5-font-body);
  font-size: 14px;
  color: #666;
  text-align: center;
}

/* ---------- WHY SECTION ---------- */
body#home .v2-why {
  background: var(--v5-dark-bg);
  padding: 72px 0;
}
body#home .v2-why .v2-section-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}
body#home .v2-why-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
body#home .v2-why-eyebrow {
  font-family: var(--v5-font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--v5-brand);
  text-transform: uppercase;
}
body#home .v2-why-title {
  font-family: var(--v5-font-button);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin: 0;
  text-align: center;
}
body#home .v2-why-sub {
  font-family: var(--v5-font-body);
  font-size: 15px;
  font-weight: 400;
  color: #999;
  line-height: 1.5;
  margin: 0;
  text-align: center;
  max-width: 640px;
}
body#home .v2-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
body#home .v2-why-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  background: #1a1a1a;
}
body#home .v2-why-icon {
  width: 48px;
  height: 48px;
  background: var(--v5-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
body#home .v2-why-icon svg { color: #fff; }
body#home .v2-why-card-title {
  font-family: var(--v5-font-button);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
  margin: 0;
}
body#home .v2-why-card-desc {
  font-family: var(--v5-font-body);
  font-size: 13px;
  font-weight: 400;
  color: #999;
  line-height: 1.6;
  margin: 0;
}

@media screen and (max-width: 1080px) {
  body#home section.home-search > .container { padding: 32px 24px; }
  body#home section.home-search > .container > .box { flex-direction: column; align-items: stretch; gap: 24px; }
  body#home .v2-hero-form { width: 100%; flex: 1 1 auto; }
  body#home .v2-cats { padding: 48px 24px; }
  body#home .v2-cats-grid { grid-template-columns: repeat(2, 1fr); }
  body#home .v2-cats-col { padding: 0 24px; }
  body#home .v2-cats-col:nth-child(2) { border-right: none; padding-right: 0; }
  body#home .v2-cats-col:nth-child(3) {
    grid-column: 1 / -1;
    padding: 56px 0 0;
    border-right: none;
    border-top: 1px solid var(--v5-border);
  }
}

@media screen and (max-width: 1080px) {
  body#home .v2-section { padding: 56px 0; }
  body#home .v2-section-inner { padding: 0 24px; }
  body#home .v2-why { padding: 56px 0; }
  body#home .v2-why .v2-section-inner { padding: 0 24px; }
  body#home .v2-grid-4 { grid-template-columns: repeat(2, 1fr); }
  body#home .v2-why-grid { grid-template-columns: repeat(2, 1fr); }
  body#home .v2-section-title { font-size: 26px; }
  body#home .v2-why-title { font-size: 28px; }
}

@media screen and (max-width: 640px) {
  body#home .v2-hero-title { font-size: 24px; }
  body#home .v2-cats-title { font-size: 28px; }
  body#home .v2-cats-grid { grid-template-columns: 1fr; gap: 56px; }
  body#home .v2-cats-col { padding: 0; border-right: none; }
  body#home .v2-grid-4 { grid-template-columns: 1fr; }
  body#home .v2-why-grid { grid-template-columns: 1fr; }
  body#home .v2-section-head { flex-direction: column; align-items: flex-start; }
  body#home .v2-section-title { font-size: 22px; }
}
