/* ============================================================
   Bundle offers (product groups) — Classic storefront
   Used by: home section, products page strip, /product-groups, /product-groups/{id}
   ============================================================ */
.kb-section,
.kb-page {
    --kb-ink: #111;
    --kb-text: #1f2937;
    --kb-muted: #6b7280;
    --kb-line: #ececec;
    --kb-soft: #f6f6f6;
    --kb-sale: #dc2626;
    --kb-save: #15803d;
    --kb-save-bg: #ecfdf3;
    --kb-accent: var(--primary, #111);
}

/* ---------- grid ---------- */
.kb-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.kb-grid__cell {
    min-width: 0;
    container-type: inline-size;
}
/* a single bundle, or the odd one out, takes the full row as a wide feature card */
.kb-grid__cell:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

/* ---------- card ---------- */
.kb-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--kb-line);
    border-radius: 24px;
    background: #fff;
    color: var(--kb-text);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(17, 17, 17, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.kb-card:hover {
    transform: translateY(-4px);
    border-color: #e0e0e0;
    box-shadow: 0 28px 54px -32px rgba(17, 17, 17, 0.38);
    color: var(--kb-text);
}
.kb-card:focus-visible {
    outline: 2px solid var(--kb-ink);
    outline-offset: 3px;
}

.kb-card__media {
    position: relative;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--kb-soft);
}
.kb-card__cover {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
/* the photos fill the frame; they never decide its height */
.kb-card__media > .kb-mosaic,
.kb-card__media > .kb-card__cover {
    position: absolute;
    inset: 0;
}
/* bundle images are often banners with text: show them whole, over a soft blurred copy */
.kb-card__media > .kb-card__cover,
.kb-detail__gallery > .kb-card__cover {
    z-index: 1;
    object-fit: contain;
}
/* stacked (narrow) cards: a banner-shaped frame for bundles with their own image */
.kb-card__media--cover {
    aspect-ratio: 2 / 1;
}
.kb-cover-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.75;
    filter: blur(26px) saturate(1.25);
    transform: scale(1.2);
    pointer-events: none;
}
.kb-card:hover .kb-card__cover {
    transform: scale(1.04);
}

/* collage of the bundle's products */
.kb-mosaic {
    display: grid;
    gap: 2px;
    width: 100%;
    height: 100%;
    background: var(--kb-line);
}
.kb-mosaic--1 { grid-template-columns: minmax(0, 1fr); }
.kb-mosaic--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kb-mosaic--3 {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
.kb-mosaic--3 .kb-mosaic__cell:first-child {
    grid-row: 1 / 3;
}
.kb-mosaic--4 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}
.kb-mosaic__cell {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}
/* each photo is pinned inside its tile, so it always fits whole */
.kb-mosaic__cell img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8%;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.kb-card:hover .kb-mosaic__cell img,
.kb-detail__gallery .kb-mosaic__cell:hover img {
    transform: scale(1.07);
}
.kb-mosaic__cell img.is-store-logo-placeholder,
.kb-item__media img.is-store-logo-placeholder {
    padding: 24%;
    opacity: 0.28;
    filter: grayscale(1);
}
.kb-mosaic__more {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(17, 17, 17, 0.78);
    backdrop-filter: blur(3px);
    color: #fff;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 800;
    direction: ltr;
}

.kb-badge-save {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: var(--kb-sale);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    direction: ltr;
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.25);
}
.kb-badge-save--lg {
    top: 20px;
    left: 20px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
}
.kb-count {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--kb-ink);
    font-size: 0.8rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(17, 17, 17, 0.12);
}

.kb-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
    padding: 20px 22px 22px;
}
.kb-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    color: var(--kb-accent);
    font-size: 0.8rem;
    font-weight: 800;
}
.kb-eyebrow i {
    font-size: 0.85em;
}
.kb-eyebrow b {
    color: #c4c4c4;
    font-weight: 700;
}
.kb-card__title {
    margin: 0;
    color: var(--kb-ink);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
}
.kb-card__items {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--kb-muted);
    font-size: 0.86rem;
    line-height: 1.75;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.kb-card__items i {
    margin: 0 0.4rem;
    color: #c4c4c4;
    font-style: normal;
    font-weight: 800;
}
.kb-save-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: var(--kb-save-bg);
    color: var(--kb-save);
    font-size: 0.8rem;
    font-weight: 800;
}
.kb-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--kb-line);
}
.kb-price {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.kb-price strong {
    color: var(--kb-ink);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
}
.kb-price s {
    color: #9ca3af;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.kb-card__cta {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.72rem 1.15rem;
    border-radius: 999px;
    background: var(--kb-ink);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    transition: gap 0.25s ease;
}
.kb-card:hover .kb-card__cta {
    gap: 0.8rem;
}

/* wide cards (two per row on desktop): photos beside the details */
@container (min-width: 600px) {
    .kb-card {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        grid-template-rows: none;
    }
    .kb-card__media {
        aspect-ratio: auto;
        min-height: 290px;
        height: 100%;
    }
    .kb-card__body {
        justify-content: center;
        padding: 26px 28px;
    }
    .kb-card__title {
        font-size: 1.3rem;
    }
}
/* a full-width feature card */
@container (min-width: 960px) {
    .kb-card {
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    }
    .kb-card__media {
        min-height: 380px;
    }
    .kb-card__body {
        gap: 0.8rem;
        padding: 40px 46px;
    }
    .kb-card__title {
        font-size: clamp(1.6rem, 2.4vw, 2.15rem);
        line-height: 1.25;
    }
    .kb-card__items {
        font-size: 0.95rem;
        -webkit-line-clamp: 3;
    }
    .kb-price strong {
        font-size: 1.85rem;
    }
    .kb-card__cta {
        padding: 0.85rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* ---------- list page ---------- */
.kb-page {
    padding-bottom: 64px;
}
.kb-page-head {
    margin-bottom: 32px;
    padding: 30px 0 34px;
    border-bottom: 1px solid var(--kb-line);
    background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0));
}
.kb-page-head h1 {
    margin: 0.7rem 0 0.4rem;
    color: var(--kb-ink);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 900;
}
.kb-page-head p {
    max-width: 560px;
    margin: 0;
    color: var(--kb-muted);
    font-size: 1rem;
    line-height: 1.8;
}
.kb-page-head .kb-eyebrow {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--kb-line);
    border-radius: 999px;
    background: #fff;
    color: var(--kb-ink);
}
.kb-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 18px;
    color: var(--kb-muted);
    font-size: 0.86rem;
}
.kb-breadcrumb a {
    color: var(--kb-muted);
    text-decoration: none;
}
.kb-breadcrumb a:hover {
    color: var(--kb-ink);
}
.kb-breadcrumb i {
    font-size: 0.6rem;
    opacity: 0.6;
}
.kb-breadcrumb span {
    color: var(--kb-ink);
    font-weight: 700;
}
.kb-empty {
    display: grid;
    justify-items: center;
    gap: 14px;
    padding: 56px 20px;
    border: 1px dashed #dcdcdc;
    border-radius: 24px;
    background: #fff;
    text-align: center;
}
.kb-empty > span {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--kb-soft);
    color: var(--kb-ink);
    font-size: 1.5rem;
}
.kb-empty p {
    margin: 0;
    color: var(--kb-muted);
    font-weight: 600;
}
.kb-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* ---------- bundle page ---------- */
.kb-detail {
    padding-top: 26px;
}
.kb-alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 18px;
    padding: 14px 18px;
    border: 1px solid #fecaca;
    border-radius: 16px;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
}
/* same geometry as the Classic product page (.pd-main-row): a 5/12 image column, 7/12 details, 48px gutter */
.kb-detail__hero {
    display: grid;
    grid-template-columns: minmax(0, calc((100% + 48px) * 5 / 12 - 48px)) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}
/* same image box as the product page (.pd-img-wrap): square, capped at 440px, white, 28px corners */
.kb-detail__gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 440px;
    overflow: hidden;
    border-radius: 28px;
    background: #fff;
}
.kb-detail__gallery .kb-mosaic {
    position: absolute;
    inset: 0;
}
.kb-detail__gallery .kb-mosaic__cell img {
    padding: 10%;
}
.kb-detail__gallery > .kb-card__cover {
    position: absolute;
    inset: 0;
}
/* the bundle's own image, whatever its shape, is shown whole inside the same box */
.kb-detail__banner {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* info sits straight on the page (no card), like the Classic product page */
.kb-detail__panel {
    position: sticky;
    top: 130px;
    width: 100%;
    max-width: 560px;
}
.kb-detail__panel .kb-eyebrow {
    font-size: 0.74rem;
}
.kb-detail__panel h1 {
    margin: 0.5rem 0 0.6rem;
    color: var(--kb-ink);
    font-size: clamp(1.3rem, 1.8vw, 1.65rem);
    font-weight: 800;
    line-height: 1.3;
}
.kb-detail__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem 0.6rem;
}
.kb-detail__price strong {
    color: var(--kb-accent);
    font-size: clamp(1.45rem, 2vw, 1.8rem);
    font-weight: 800;
    line-height: 1.2;
}
.kb-detail__price span {
    color: var(--kb-muted);
    font-size: 0.82rem;
    font-weight: 600;
}
.kb-summary {
    margin: 18px 0 2px;
    border-top: 1px solid var(--kb-line);
    border-bottom: 1px solid var(--kb-line);
}
.kb-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #e4e4e4;
    font-size: 0.84rem;
}
.kb-summary__row:last-child {
    border-bottom: 0;
}
.kb-summary__row span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--kb-muted);
    font-weight: 600;
}
.kb-summary__row s {
    color: #9ca3af;
    font-weight: 600;
}
.kb-summary__row strong {
    color: var(--kb-ink);
    font-weight: 800;
}
.kb-summary__save span,
.kb-summary__save strong {
    color: var(--kb-save);
}
.kb-summary__save em {
    font-style: normal;
    font-weight: 600;
    opacity: 0.85;
}
.kb-buy {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.kb-qty {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    height: 46px;
    padding: 3px;
    border: 1px solid #e3e3e3;
    border-radius: 999px;
    background: #fff;
}
.kb-qty button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: var(--kb-soft);
    color: var(--kb-ink);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}
.kb-qty button:hover {
    background: #e9e9e9;
}
.kb-qty input {
    width: 42px;
    border: 0;
    background: transparent;
    color: var(--kb-ink);
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
    -moz-appearance: textfield;
}
.kb-qty input::-webkit-outer-spin-button,
.kb-qty input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}
.kb-qty input:focus {
    outline: none;
}
.kb-buy__btn {
    display: inline-flex;
    flex: 1 1 180px;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--kb-ink);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kb-buy__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 26px -14px rgba(17, 17, 17, 0.6);
}
.kb-detail__note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 12px 0 0;
    color: var(--kb-muted);
    font-size: 0.78rem;
    line-height: 1.7;
}
.kb-detail__note i {
    margin-top: 0.25rem;
    color: var(--kb-ink);
}

.kb-included {
    margin-top: 56px;
}
.kb-included__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.kb-included__head h2 {
    margin: 0;
    color: var(--kb-ink);
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 800;
}
.kb-included__head span {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--kb-line);
    border-radius: 999px;
    background: #fff;
    color: var(--kb-muted);
    font-size: 0.85rem;
    font-weight: 800;
}
.kb-included__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.kb-item {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--kb-line);
    border-radius: 22px;
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.kb-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 44px -30px rgba(17, 17, 17, 0.35);
}
.kb-item__num {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--kb-ink);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    direction: ltr;
}
.kb-item__media {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-bottom: 1px solid var(--kb-line);
    background: #fff;
}
.kb-item__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10%;
    transition: transform 0.5s ease;
}
.kb-item:hover .kb-item__media img {
    transform: scale(1.05);
}
.kb-item__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 14px 16px 16px;
}
.kb-item__body h3 {
    margin: 0;
    color: var(--kb-ink);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.45;
}
.kb-item__body h3 a {
    color: inherit;
    text-decoration: none;
}
.kb-item__body h3 a:hover {
    color: var(--kb-accent);
}
.kb-item__variant {
    width: fit-content;
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    background: var(--kb-soft);
    color: #374151;
    font-size: 0.78rem;
    font-weight: 700;
}
.kb-item__price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--kb-line);
}
.kb-item__price small {
    color: var(--kb-muted);
    font-size: 0.76rem;
    font-weight: 700;
}
.kb-item__price strong {
    color: var(--kb-ink);
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
}

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
    .kb-included__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 991px) {
    .kb-detail__hero {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .kb-detail__panel {
        position: static;
    }
    .kb-included__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .kb-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .kb-card__body {
        padding: 16px 18px 18px;
    }
    .kb-included {
        margin-top: 40px;
    }
}
@media (max-width: 575px) {
    .kb-included__grid {
        gap: 12px;
    }
    .kb-item__body {
        padding: 12px;
    }
    .kb-item__price {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}
@media (prefers-reduced-motion: reduce) {
    .kb-card,
    .kb-item,
    .kb-card img,
    .kb-item img,
    .kb-buy__btn {
        transition: none !important;
    }
}
