/* TWM Foods / The Wholesale Mart (pId 6792) — home page overrides.
   Auto-loaded on the widget home (view basename `home`). All selectors scoped
   under .twm-cau so nothing leaks to other pages/brands. Brand color flows via
   --brand-primary (injected at runtime); hex fallback = #d61c5c. */

.twm-cau {
    color: var(--text-primary, #201c1d);
    padding: var(--space-10, 40px) 0;
}

.twm-cau__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.twm-cau__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg, 16px);
}

.twm-cau__title {
    font-size: 24px;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 12px;
    color: var(--text-primary, #201c1d);
}

.twm-cau__text {
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 20px;
    color: var(--text-secondary, #555);
}

.twm-cau__cta {
    display: inline-block;
    align-self: flex-start; /* don't stretch when the body is a flex column */
    padding: 12px 28px;
    border-radius: var(--radius-md, 10px);
    background: var(--brand-primary, #d61c5c);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .15s ease;
}

.twm-cau__cta:hover {
    opacity: .9;
}

/* ── Gallery (multiple images) ──────────────────────────────────── */
.twm-cau__media--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3, 12px);
}

.twm-cau__media--grid img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Gallery: heading on top, image grid, then copy + CTA below */
.twm-cau--gallery {
    text-align: center;
}

.twm-cau--gallery .twm-cau__title {
    margin-bottom: var(--space-6, 24px);
}

.twm-cau__accent {
    color: var(--brand-primary, #d61c5c);
}

/* Collage (exactly 3 images): mobile = heading then stacked images. */
.twm-cau__collage {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 16px);
}

.twm-cau__c-head {
    order: -1;
    text-align: center;
}

.twm-cau__c-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg, 16px);
    object-fit: cover;
}

.twm-cau__foot {
    margin-top: var(--space-6, 24px);
}

.twm-cau__foot .twm-cau__text {
    max-width: 760px;
    margin: 0 auto 20px;
}

/* ── Plain (no image, centered strip) ───────────────────────────── */
.twm-cau--plain {
    text-align: center;
    background: var(--bg-surface, #faf5f2);
    padding: var(--space-16, 64px) 0;
}

.twm-cau--plain .twm-cau__title {
    font-size: 30px;
    line-height: 1.15;
}

.twm-cau--plain .twm-cau__text,
.twm-cau--plain .twm-cau__html {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.twm-cau__html p {
    margin: 0 0 14px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-secondary, #555);
}

.twm-cau--oncolor .twm-cau__html,
.twm-cau--oncolor .twm-cau__html p {
    color: #fff;
}

/* ── Colored bands (bg_color set) ───────────────────────────────── */
/* Dark bands: white text. */
.twm-cau--oncolor .twm-cau__title,
.twm-cau--oncolor .twm-cau__text {
    color: #fff;
}

/* Tinted bands use an outline "pill" CTA (matches the reference). Border
   colour follows the text colour so it works on both light and dark bands. */
.twm-cau--tinted .twm-cau__cta {
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 999px;
    padding: 13px 40px;
    color: var(--text-primary, #201c1d);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.twm-cau--tinted.twm-cau--oncolor .twm-cau__cta {
    color: #fff;
}

.twm-cau--tinted .twm-cau__cta:hover {
    background: var(--brand-primary, #d61c5c);
    border-color: var(--brand-primary, #d61c5c);
    color: #fff;
    opacity: 1;
}

/* ── Desktop: side-by-side image + text bands ───────────────────── */
@media (min-width: 768px) {
    .twm-cau__title {
        font-size: 28px;
    }

    .twm-cau--gallery .twm-cau__media--grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Collage: big image left (full height), two images + heading stacked right */
    .twm-cau__collage {
        display: grid;
        grid-template-columns: 1.15fr 1fr;
        grid-template-rows: 1fr auto 1fr;
        grid-template-areas:
            "a b"
            "a head"
            "a c";
        gap: var(--space-6, 24px);
        align-items: center;
    }

    .twm-cau__c-img--a {
        grid-area: a;
        height: 100%;
        max-height: 640px;
    }

    .twm-cau__c-img--b {
        grid-area: b;
    }

    .twm-cau__c-img--c {
        grid-area: c;
    }

    .twm-cau__c-head {
        grid-area: head;
        order: 0;
        padding: var(--space-4, 16px);
    }

    .twm-cau__c-head .twm-cau__title {
        font-size: 34px;
        margin-bottom: 0;
    }

    .twm-cau--plain .twm-cau__title {
        font-size: 46px;
    }

    .twm-cau--img-left .twm-cau__inner,
    .twm-cau--img-right .twm-cau__inner {
        display: flex;
        align-items: stretch;
        gap: var(--space-10, 40px);
    }

    .twm-cau--img-left .twm-cau__media,
    .twm-cau--img-right .twm-cau__media,
    .twm-cau--img-left .twm-cau__body,
    .twm-cau--img-right .twm-cau__body {
        flex: 1 1 0;
        min-width: 0;
    }

    /* Text column: vertically centred against the image */
    .twm-cau--img-left .twm-cau__body,
    .twm-cau--img-right .twm-cau__body {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Image column: crop to the band height instead of ballooning it */
    .twm-cau--img-left .twm-cau__media,
    .twm-cau--img-right .twm-cau__media {
        margin-bottom: 0;
    }

    .twm-cau--img-left .twm-cau__media img,
    .twm-cau--img-right .twm-cau__media img {
        width: 100%;
        height: 100%;
        max-height: 460px;
        object-fit: cover;
    }

    .twm-cau--img-left .twm-cau__media {
        order: 0;
    }

    .twm-cau--img-right .twm-cau__media {
        order: 1;
    }
}

/* Mobile: image sits above text with a gap */
.twm-cau--img-left .twm-cau__media,
.twm-cau--img-right .twm-cau__media {
    margin-bottom: var(--space-5, 20px);
}

/* ── web_usps override — "Shop by" showcase (3 image cards) ──────── */
.twm-usps {
    padding: var(--space-12, 48px) 0;
}

.twm-usps__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px;
}

.twm-usps__heading {
    font-size: 26px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 var(--space-10, 40px);
    color: var(--text-primary, #201c1d);
}

.twm-usps__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-10, 40px);
}

.twm-usps__card {
    text-align: center;
}

.twm-usps__media {
    width: 200px;
    aspect-ratio: 1 / 1;
    margin: 0 auto var(--space-5, 20px);
    border-radius: 50%;
    overflow: hidden;
}

.twm-usps__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twm-usps__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-primary, #201c1d);
}

.twm-usps__sub {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    color: var(--text-primary, #201c1d);
}

.twm-usps__text {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 12px;
    color: var(--text-secondary, #555);
}

.twm-usps__foot {
    text-align: center;
    margin-top: var(--space-10, 40px);
}

@media (min-width: 768px) {
    .twm-usps__heading {
        font-size: 32px;
    }

    .twm-usps__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-8, 32px);
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Global polish — consistent rhythm, display type, depth & motion.
   Scoped to the TWM home widgets; hero layout/content left intact.
   ═══════════════════════════════════════════════════════════════════ */

/* Consistent vertical rhythm across every band */
.twm-cau,
.twm-usps {
    padding-block: clamp(48px, 7vw, 88px);
}

/* Tighter, more confident display headings */
.twm-cau__title,
.twm-usps__heading {
    letter-spacing: -0.01em;
    line-height: 1.12;
}

/* Readable body copy */
.twm-cau__text,
.twm-usps__text,
.twm-cau__html p {
    font-size: 16px;
    line-height: 1.65;
}

/* Imagery depth + smooth corners */
.twm-cau__media img,
.twm-cau__c-img {
    box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}

.twm-usps__media {
    box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
    transition: transform .3s ease;
}

.twm-usps__card:hover .twm-usps__media {
    transform: translateY(-4px) scale(1.03);
}

/* Buttons — motion + depth (shape/colour unchanged) */
.twm-cau__cta {
    transition: transform .15s ease, box-shadow .15s ease,
                background .15s ease, color .15s ease, border-color .15s ease;
}

.twm-cau__cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(214, 28, 92, .28);
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
    .twm-usps__media,
    .twm-cau__cta {
        transition: none;
    }
    .twm-usps__card:hover .twm-usps__media,
    .twm-cau__cta:hover {
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   Polish for the EXISTING live widgets on this brand's home only
   (this file loads solely on TWM's home). Additive: depth, hover,
   consistent radius & brand-coloured actions. No layout overhaul.
   ═══════════════════════════════════════════════════════════════════ */

/* Featured Categories — tiles lift on hover */
.category-tile__image {
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
    transition: transform .3s ease, box-shadow .3s ease;
}

.category-tile:hover .category-tile__image {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .16);
}

.category-tile__name {
    font-weight: 700;
}

/* Trending / Best-seller product cards */
.wla-best__card {
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .10);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.wla-best__card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .16);
}

.wla-best__btn {
    background: var(--brand-primary, #d61c5c);
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
    transition: opacity .15s ease, transform .15s ease;
}

.wla-best__btn:hover {
    opacity: .92;
    transform: translateY(-1px);
}

.wla-best__price {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* Text-info blocks ("Switch to Clean Eating", "About Us") — centred + readable */
.text-info {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.text-info__body {
    line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
    .category-tile__image,
    .wla-best__card,
    .wla-best__btn {
        transition: none;
    }
    .category-tile:hover .category-tile__image,
    .wla-best__card:hover,
    .wla-best__btn:hover {
        transform: none;
    }
}

/* ── Image bands — less top space, bigger imagery + larger type ─── */
.twm-cau--img-left,
.twm-cau--img-right {
    padding-top: clamp(12px, 1.5vw, 24px);
    padding-bottom: clamp(40px, 5vw, 72px);
}

@media (min-width: 768px) {
    /* Bigger image */
    .twm-cau--img-left .twm-cau__media img,
    .twm-cau--img-right .twm-cau__media img {
        max-height: 640px;
    }

    /* Image-band heading: moderate size/weight (e.g. PROLEAN's long heading) */
    .twm-cau--img-left .twm-cau__title,
    .twm-cau--img-right .twm-cau__title {
        font-size: 30px;
        font-weight: 700;
        line-height: 1.15;
    }

    .twm-cau--img-left .twm-cau__text,
    .twm-cau--img-right .twm-cau__text {
        font-size: 18px;
        line-height: 1.7;
    }

    /* Lead band (hero) keeps the big, bold display heading */
    .twm-cau--lead .twm-cau__title {
        font-size: 48px;
        font-weight: 800;
        line-height: 1.08;
    }
}

/* ── Showcase (web_usps): trim top space + match section-heading scale ── */
.twm-usps {
    padding-top: clamp(20px, 2.5vw, 36px);
}

.twm-usps__heading {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: var(--space-8, 32px);
}

@media (min-width: 768px) {
    .twm-usps__heading {
        font-size: 38px;
    }
}
