/* Homepage (shop redesign slice 4). Template: page-home.php. Loaded on the front page only.
   One bold element: the shelf in the hero. Everything else stays quiet. */

.kb-home {
    --ink: #1e1e2f;
    --muted: #5d5d6b;
    --cream: #fdf6f0;
    --paper: #ffffff;
    --line: #eadfd9;
    --cta: #b8412a;
    --cta-hover: #963318;
    --blush: #f8b4b8;
    --gap: 48px;
    color: var(--ink);
    padding-bottom: var(--gap);
}
.kb-home h2 { font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.75rem); letter-spacing: -0.01em; margin: 0; }
.kb-home a { color: inherit; }
.kb-home-wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
#content.site-content { padding-top: 0; } /* GeneratePress adds 40px above every page; the hero starts under the header */
.kb-home-n { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.kb-home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: var(--gap) 0 16px; }
.kb-home-head p { margin: 0; color: var(--muted); }
.kb-home-head a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Buttons */
.kb-home-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 10px; border: 2px solid var(--ink); font-weight: 600; text-decoration: none; }
.kb-home a.kb-home-btn:hover { background: var(--ink); color: #fff; }
.kb-home a.kb-home-btn--main { background: var(--cta); border-color: var(--cta); color: #fff; }
.kb-home a.kb-home-btn--main:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: #fff; }
.kb-home a.kb-home-btn--light { border-color: #fff; color: #fff; }
.kb-home a.kb-home-btn--light:hover { background: #fff; color: var(--ink); }
.kb-home a:focus-visible, .kb-home button:focus-visible, .kb-home input:focus-visible, .kb-home select:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }

/* Hero */
.kb-home-hero { background: var(--cream); border-bottom: 1px solid var(--line); padding: 32px 0 28px; }
.kb-home-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; }
.kb-home-hero__grid > * { min-width: 0; }
.kb-home-hero h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 12px; max-width: 20ch; }
.kb-home-hero__lede { margin: 0 0 18px; color: var(--muted); max-width: 52ch; }
.kb-home-search { display: flex; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; overflow: hidden; max-width: 560px; }
.kb-home-search select, .kb-home-search input { border: 0; background: transparent; min-height: 48px; font: inherit; font-size: 16px; color: var(--ink); }
.kb-home-search select { padding: 0 8px 0 12px; border-right: 1px solid var(--line); max-width: 42%; }
.kb-home-search input { flex: 1; min-width: 0; padding: 0 12px; }
.kb-home .kb-home-search button[type="submit"] { border: 0; border-radius: 0; background: var(--ink); color: #fff; padding: 0 20px; font-weight: 600; cursor: pointer; }
.kb-home .kb-home-search button[type="submit"]:hover { background: #3a3a52; }
.kb-home-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 14px; }
.kb-home-seals { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.9rem; font-weight: 600; }
.kb-home-seals li { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.kb-home-seals svg { width: 18px; height: 18px; fill: #13803f; }

/* The shelf: brand pack shots standing on a ledge, each with a shelf-edge tag (brand, never a price) */
.kb-home-shelf { padding: 0 8px; }
.kb-home-shelf__row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 10px; align-items: end; }
.kb-home-shelf__row li { margin: 0; position: relative; padding-bottom: 12px; }
.kb-home-shelf__row li::after { content: ""; position: absolute; z-index: 0; left: -8px; right: -8px; bottom: 0; height: 30px; background: linear-gradient(#f3d6cf, #e5bfb5); box-shadow: 0 14px 16px -12px rgba(30, 30, 47, 0.45); }
.kb-home-shelf__row a { position: relative; z-index: 1; }
.kb-home-shelf__row a { display: flex; flex-direction: column; text-decoration: none; }
.kb-home-shelf__pack { display: block; background: var(--paper); border-radius: 10px 10px 0 0; padding: 10px 10px 4px; }
.kb-home-shelf__pack img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.kb-home-shelf__row a:hover .kb-home-shelf__pack img { transform: translateY(-4px); }
.kb-home-shelf__tag { display: block; margin: 0 4px; padding: 5px 6px 6px; background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--blush); font-size: 0.78rem; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.kb-home-shelf__tag small { display: block; font-weight: 400; color: var(--muted); font-size: 0.72rem; }
@media (prefers-reduced-motion: no-preference) {
    .kb-home-shelf__pack img { transition: transform 0.2s ease; }
}

/* Stock the routine: five real steps, in order */
.kb-home-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; counter-reset: kbstep; }
.kb-home-steps li { margin: 0; counter-increment: kbstep; }
.kb-home-steps a { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; height: 100%; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.kb-home-steps__img { grid-row: 1 / 3; }
.kb-home-steps a:hover { border-color: var(--ink); }
.kb-home-steps__img img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.kb-home-steps__verb { font-family: var(--font-heading, inherit); font-size: 1.05rem; font-weight: 700; align-self: end; }
.kb-home-steps__verb::before { content: counter(kbstep); display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 0.8rem; vertical-align: 2px; }
.kb-home-steps__cat { font-size: 0.85rem; align-self: start; }
.kb-home-also { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; color: var(--muted); }
.kb-home-also a, .kb-home-concerns a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); text-decoration: none; }
.kb-home-also a:hover, .kb-home-concerns a:hover { border-color: var(--ink); }

/* Departments: compact */
.kb-home-depts ul { list-style: none; margin: var(--gap) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kb-home-depts li { margin: 0; }
.kb-home-depts a { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.kb-home-depts a:hover { border-color: var(--ink); }
.kb-home-depts img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.kb-home-depts strong { display: block; font-size: 1.05rem; }

/* Product rows reuse WooCommerce's cards (slice 3); this only lays them out */
.kb-home .kb-home-grid ul.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; }
.kb-home .kb-home-grid ul.products::before, .kb-home .kb-home-grid ul.products::after { display: none; }
.kb-home .kb-home-grid ul.products li.product.product { width: auto; float: none; margin: 0; padding: 12px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.kb-home .kb-home-grid ul.products li.product .button { margin-top: auto; text-align: center; }

/* Brands and ingredients */
.kb-home-brands ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.kb-home-brands li { margin: 0; }
.kb-home-brands a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); font-family: var(--font-heading, inherit); font-weight: 700; text-decoration: none; }
.kb-home-brands a:hover { border-color: var(--ink); }
.kb-home-ing { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kb-home-ing li { margin: 0; }
.kb-home-ing a { display: flex; flex-direction: column; justify-content: space-between; min-height: 96px; padding: 14px 16px; border-radius: 14px; background: var(--ink); color: #fff; text-decoration: none; }
.kb-home-ing a span:first-child { font-family: var(--font-heading, inherit); font-size: 1.1rem; font-weight: 700; }
.kb-home-ing a .kb-home-n { color: #d8d8e2; }
.kb-home-ing a:hover { background: var(--cta); }
.kb-home-concerns { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kb-home-concerns > span { color: var(--muted); margin-right: 4px; }

/* Quoting band */
.kb-home-quote { margin-top: var(--gap); background: var(--ink); color: #fff; padding: 40px 0; }
.kb-home-quote h2, .kb-home-quote h3 { color: #fff; }
.kb-home-quote__grid { display: grid; gap: 32px; }
.kb-home-quote .kb-how-quote { margin: 16px 0 0; background: rgba(255, 255, 255, 0.06); color: #fff; }
.kb-home-quote .kb-how-quote li::before { background: var(--blush); color: var(--ink); }
.kb-home-facts { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.kb-home-facts li { margin: 0; padding-left: 26px; position: relative; color: #e6e6ee; }
.kb-home-facts li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 12px; height: 7px; border-left: 2px solid var(--blush); border-bottom: 2px solid var(--blush); transform: rotate(-45deg); }
.kb-home-facts strong { color: #fff; }
.kb-home-missing { padding: 20px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 14px; }
.kb-home-missing h3 { margin: 0 0 6px; font-size: 1.15rem; }
.kb-home-missing p { margin: 0 0 14px; color: #e6e6ee; }
.kb-home-missing .kb-home-btn { margin: 0 8px 8px 0; }

/* Guides */
.kb-home-guides ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.kb-home-guides li { margin: 0; }
.kb-home-guides a { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); font-weight: 600; text-decoration: none; }
.kb-home-guides a:hover { border-color: var(--ink); }
.kb-home-guides img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }

/* Phone: product rows scroll sideways inside their own strip; the page never does */
@media (max-width: 767px) {
    .kb-home { --gap: 36px; }
    .kb-home .kb-home-row .kb-home-grid ul.products { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
    .kb-home .kb-home-row .kb-home-grid ul.products li.product { scroll-snap-align: start; }
    .kb-home-steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
    .kb-home-steps li { scroll-snap-align: start; }
    .kb-home-search { flex-wrap: wrap; }
    .kb-home-search select { flex: 0 0 100%; max-width: none; border-right: 0; border-bottom: 1px solid var(--line); }
    .kb-home-shelf__row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
    .kb-home-shelf__pack { padding: 8px 8px 4px; }
    .kb-home-shelf__tag { font-size: 0.78rem; padding: 5px 6px; }
    .kb-home-depts a { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (min-width: 768px) {
    .kb-home-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .kb-home-shelf__row { column-gap: 14px; }
    .kb-home-depts ul { grid-template-columns: repeat(4, 1fr); }
    .kb-home .kb-home-grid ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .kb-home-brands ul { grid-template-columns: repeat(4, 1fr); }
    .kb-home-ing { grid-template-columns: repeat(3, 1fr); }
    .kb-home-quote__grid { grid-template-columns: 1fr 1fr; gap: 48px; }
    .kb-home-guides ul { grid-template-columns: repeat(3, 1fr); }
    .kb-home-guides a { grid-template-columns: 1fr; }
    .kb-home-guides img { width: 100%; height: 150px; }
}

/* Tablet: five steps only fit with the photo above the text */
@media (min-width: 768px) and (max-width: 1023px) {
    .kb-home-steps a { grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 4px; }
    .kb-home-steps__img { grid-row: auto; }
    .kb-home-steps__img img { width: 64px; }
}

@media (min-width: 1024px) {
    .kb-home-hero { padding: 36px 0 32px; }
    .kb-home-hero__grid { grid-template-columns: 1fr 1.05fr; gap: 40px; }
    .kb-home-brands ul { grid-template-columns: repeat(6, 1fr); }
    .kb-home-ing { grid-template-columns: repeat(6, 1fr); }
}
