
.ce-products {
    --ce-red: #102D3B;
    --ce-navy: #000037;
    --ce-text: #000;
    --ce-surface: #f5f5f5;
    --ce-white: #fff;
    --ce-radius: 6px;


    background: var(--ce-white);
    color: var(--ce-text);
    font-family: var(--ce-font-body);
    padding-block: clamp(64px, 8vw, 112px);
    padding-inline: clamp(20px, 4vw, 40px);
}

.ce-products *,
.ce-products *::before,
.ce-products *::after {
    box-sizing: border-box;
}

.ce-products__inner {
    max-width: 1280px;
    margin-inline: auto;
}

/* ---- Section header: title + drawing-style dimension line ---- */
.ce-products__header {
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: clamp(36px, 5vw, 64px);
}

.ce-products__title {
    margin: 0;
    font-family: var(--ce-font-display);
    font-weight: 600;
    font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.005em;
    color: var(--ce-navy);
    text-wrap: balance;
}

.ce-products__rule {
    position: relative;
    flex: 1 1 80px;
    min-width: 80px;
    height: 1px;
    background: var(--ce-red);
}

.ce-products__rule::before,
.ce-products__rule::after {
    content: "";
    position: absolute;
    top: -5px;
    width: 1px;
    height: 11px;
    background: var(--ce-red);
}

.ce-products__rule::before {
    left: 0;
}

.ce-products__rule::after {
    right: 0;
}

/* ---- Grid ---- */
.ce-products__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 4vw, 56px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---- Card ---- */
.ce-products .ce-card {
    position: relative; /* anchor for the stretched CTA link */
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--ce-surface);
    border-radius: var(--ce-radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 55, .06),
    0 14px 32px -18px rgba(0, 0, 55, .22);
    transition: transform .35s var(--ce-ease), box-shadow .35s var(--ce-ease);
}

.ce-products .ce-card__media {
    position: relative;
    margin: 0;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #ebebeb;
}

.ce-products .ce-card__media img,
.ce-products .ce-card__placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ce-products .ce-card__media img {
    display: block;
    object-fit: cover;
    transition: transform .7s var(--ce-ease);
}

/* Accent bar on the image/content seam. Short at rest, full width on hover. */
.ce-products .ce-card__media::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--ce-red);
    transform: scaleX(.14);
    transform-origin: left center;
    transition: transform .5s var(--ce-ease);
}

.ce-products .ce-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    padding: clamp(24px, 3vw, 40px);
}

.ce-products .ce-card__title {
    margin: 0 0 12px;
    font-family: var(--ce-font-display);
    font-weight: 500;
    font-size: clamp(1.375rem, 1.1rem + .9vw, 1.75rem);
    line-height: 1.2;
    color: var(--ce-navy);
    transition: color .3s ease;
}

.ce-products .ce-card__text {
    margin: 0 0 28px;
    max-width: 54ch;
    font-size: 1rem;
    line-height: 1.65;
}

.ce-products .ce-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: auto;
    padding: 0 28px;
    border: 1.5px solid var(--ce-red);
    border-radius: 4px;
    background: var(--ce-white);
    color: var(--ce-red);
    font-weight: 600;
    font-size: .9375rem;
    line-height: 1;
    text-decoration: none;
    transition: box-shadow .25s ease;
}

/* Whole card is clickable through the one real link */
.ce-products .ce-card__cta::after {
    content: "";
    position: absolute;
    inset: 0;
}

.ce-products .ce-card__cta:focus-visible {
    outline: 2px solid var(--ce-navy);
    outline-offset: 3px;
}

/* ---- Interaction ---- */
@media (hover: hover) {
    .ce-products .ce-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 2px 4px rgba(0, 0, 55, .06),
        0 26px 44px -20px rgba(0, 0, 55, .30);
    }

    .ce-products .ce-card:hover .ce-card__media img {
        transform: scale(1.04);
    }

    .ce-products .ce-card:hover .ce-card__media::after {
        transform: scaleX(1);
    }

    .ce-products .ce-card:hover .ce-card__title {
        color: var(--ce-red);
    }

    .ce-products .ce-card:hover .ce-card__cta {
        box-shadow: inset 0 0 0 1.5px var(--ce-red);
    }
}

.ce-products .ce-card:focus-within .ce-card__media::after {
    transform: scaleX(1);
}

.ce-products .ce-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---- Breakpoints ---- */

/* Below desktop: dimension line drops under the title */
@media (max-width: 991.98px) {
    .ce-products__header {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
    }

    .ce-products__rule {
        flex: none;
    }
}

/* Phones: CTA goes full width */
@media (max-width: 639.98px) {
    .ce-products .ce-card__cta {
        width: 100%;
    }
}

/* Tablets: cards stay stacked, image sits beside the content */
@media (min-width: 640px) and (max-width: 991.98px) {
    .ce-products .ce-card {
        display: grid;
        grid-template-columns: minmax(0, 52fr) minmax(0, 48fr);
    }

    .ce-products .ce-card__media {
        aspect-ratio: auto;
        min-height: 300px;
    }

    .ce-products .ce-card__body {
        justify-content: center;
    }

    .ce-products .ce-card__cta {
        margin-top: 0;
    }
}

/* Desktop: two equal columns */
@media (min-width: 992px) {
    .ce-products__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .ce-products .ce-card,
    .ce-products .ce-card__media img,
    .ce-products .ce-card__media::after,
    .ce-products .ce-card__title,
    .ce-products .ce-card__cta {
        transition: none;
    }

    .ce-products .ce-card:hover {
        transform: none;
    }

    .ce-products .ce-card:hover .ce-card__media img {
        transform: none;
    }
}
