/* My Home — carousel shell matches customer login slider (.kf-slider) for visual parity. */

.mh-week,
.mh-wallet-low,
.mh-how {
    border-radius: var(--kf-radius-lg, 16px);
    border: 1px solid rgba(15, 23, 42, 0.07);
    background: var(--bh-card, #fff);
    box-shadow: var(--kf-elev-card, 0 2px 10px rgba(15, 23, 42, 0.06));
}

.mh-carousel {
    position: relative;
    user-select: none;
    margin: 0 auto var(--kf-space-4, 16px);
    width: 100%;
    max-width: var(--bh-layout-max, 420px);
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: var(--kf-radius-xl, 20px);
    background: #fff;
    box-shadow: var(--kf-elev-card, 0 2px 10px rgba(15, 23, 42, 0.06));
}

.mh-carousel__mask {
    overflow: hidden;
}

.mh-carousel__viewport {
    container-type: inline-size;
    container-name: mhc;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
    touch-action: pan-y pinch-zoom;
}

.mh-carousel__viewport::-webkit-scrollbar {
    display: none;
}

.mh-carousel__viewport:focus {
    outline: 2px solid var(--kf-teal, #0f766e);
    outline-offset: 2px;
}

.mh-carousel__viewport:focus:not(:focus-visible) {
    outline: none;
}

.mh-carousel__track {
    display: flex;
    gap: 0;
    padding: 0;
    box-sizing: border-box;
}

.mh-carousel__slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    box-sizing: border-box;
}

@supports (width: 1cqi) {
    .mh-carousel__slide {
        flex: 0 0 100cqi;
        width: 100cqi;
    }
}

/* Card column: match .kf-slide-inner rhythm */
.mh-carousel__link {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    width: 100%;
    min-height: min(48vh, 420px);
    max-height: 460px;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    border-radius: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.mh-carousel__link:focus-visible {
    outline: 2px solid var(--kf-teal, #0f766e);
    outline-offset: 3px;
}

.mh-carousel__link:active {
    opacity: 0.97;
}

/* Warm panel + vignettes — same language as .kf-slide-art (login) */
.mh-carousel__art {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-height: 200px;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    background:
        rgba(255, 255, 255, 0.5),
        #f5ebe4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    isolation: isolate;
}

.mh-carousel__art::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: rgba(245, 235, 228, 0.92);
}

.mh-carousel__art::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.14;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200'%3E%3Cpath fill='%23fff' d='M0 180c80-100 200-120 400-80v100H0z'/%3E%3C/svg%3E") center bottom / 110% no-repeat;
}

.mh-carousel__art img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.mh-carousel__art img.mh-carousel__img--cover {
    object-fit: cover;
}

/* My Home full-image: height follows image — no 48vh letterbox / beige bars above & below art. */
.mh-carousel.mh-carousel--full-image .mh-carousel__link {
    min-height: 0;
    max-height: none;
    justify-content: flex-start;
}

.mh-carousel.mh-carousel--full-image .mh-carousel__art {
    flex: 0 0 auto;
    min-height: 0;
    padding: 0;
    box-sizing: border-box;
}

.mh-carousel.mh-carousel--full-image .mh-carousel__art::before,
.mh-carousel.mh-carousel--full-image .mh-carousel__art::after {
    display: none;
}

.mh-carousel.mh-carousel--full-image .mh-carousel__art img,
.mh-carousel.mh-carousel--full-image .mh-carousel__art img.mh-carousel__img--cover {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: min(44vh, 300px);
    object-fit: contain;
    object-position: center;
    vertical-align: top;
}

.mh-carousel__caption {
    position: relative;
    z-index: 3;
    margin: 16px 20px 0;
    font-size: clamp(1.02rem, 3.6vw, 1.14rem);
    font-weight: 800;
    color: #3f2d22;
    letter-spacing: -0.04em;
    text-align: center;
    line-height: 1.28;
    flex-shrink: 0;
}

.mh-carousel__caption:empty {
    display: none;
}

/* Dots — match .kf-slider-dot / .kf-slider-dots (login) */
.mh-carousel__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 16px 16px 6px;
}

.mh-carousel__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #cbd5e1;
    cursor: pointer;
    transition: background 0.3s ease, width 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.mh-carousel__dot--active {
    width: 24px;
    background: #2dd4bf;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.35);
}

.mh-carousel__dot:focus-visible {
    outline: 2px solid var(--kf-teal, #0f766e);
    outline-offset: 3px;
}

/* Next-week basket summary (below carousel) */
.mh-week {
    margin: 0 0 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bh-card, #faf6f1);
}

.mh-week__text {
    margin: 0;
    font-size: var(--kf-app-fs-body);
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.02em;
    color: var(--bh-ink, #0f172a);
    text-align: center;
    width: 100%;
}

.mh-week__text strong {
    font-weight: 800;
}

.mh-week__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 14px;
    padding: 12px 16px;
    font-size: var(--kf-app-fs-body);
    font-weight: 800;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    color: var(--kf-cta-ink, #3f2d22);
    background: #f2d8c4;
    border: 0;
    border-radius: 0;
    box-shadow: 0 6px 16px var(--kf-cta-shadow, rgba(170, 95, 55, 0.22));
}

.mh-week__btn:active {
    transform: scale(0.99);
}

.mh-week--with-bg {
    min-height: 220px;
    justify-content: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-color: rgba(148, 163, 184, 0.32);
}

.mh-week--with-bg .mh-week__text {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.mh-week--with-bg .mh-week__text strong {
    color: #fef3c7;
}

.mh-week--pending {
    justify-content: flex-end;
    padding-bottom: 18px;
}

.mh-week--pending .mh-week__btn {
    width: auto;
    min-width: 130px;
    margin-top: 10px;
    padding: 8px 12px;
    font-size: var(--kf-app-fs-body);
}

.mh-week--confirmed {
    padding: 10px 12px;
    min-height: 0;
}

.mh-week--confirmed .mh-week__text {
    font-size: var(--kf-app-fs-body);
    line-height: 1.3;
}

.mh-week-strip {
    margin: 0;
    padding: 9px 12px;
    font-size: var(--kf-app-fs-body);
    font-weight: 700;
    line-height: 1.35;
    color: #14532d;
    text-align: center;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.mh-week-strip strong {
    font-weight: 800;
}

.mh-home-basket-module {
    margin-top: 10px;
    padding-top: 0;
}

.mh-home-basket-module > [data-kf-nav="veggies"] {
    margin-top: 0;
    padding-top: 0;
}

.mh-home-basket-module > [data-kf-nav="veggies"] .bh-trust-pills {
    margin-top: 0 !important;
}

/* Low wallet — prompt recharge (home) */
.mh-wallet-low {
    margin: 0 0 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    background: #fff7ed;
    border-color: rgba(251, 146, 60, 0.38);
    box-shadow: 0 8px 20px rgba(234, 88, 12, 0.08);
}

.mh-wallet-low__text {
    margin: 0;
    font-size: var(--kf-app-fs-body);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #7c2d12;
    text-align: left;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.mh-wallet-low__text strong {
    font-weight: 800;
}

.mh-wallet-low__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin-top: 0;
    padding: 6px 10px;
    font-size: var(--kf-app-fs-body);
    font-weight: 800;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    color: var(--kf-cta-ink, #3f2d22);
    background: #f2d8c4;
    border: 0;
    border-radius: 0;
    box-shadow: 0 6px 16px var(--kf-cta-shadow, rgba(170, 95, 55, 0.22));
    flex: 0 0 auto;
    white-space: nowrap;
}

.mh-wallet-low__btn:active {
    transform: scale(0.99);
}

.mh-basket-embed {
    margin: 0 0 16px;
    border-radius: 14px;
    border: 1px solid rgba(220, 196, 178, 0.62);
    background: var(--bh-card, #fff);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    padding: 0;
}

/* How it works — farmers tagline + delivery steps (home) */
.mh-how {
    margin: 0 0 16px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 12px 4px;
}

.mh-how .mh-how__farmers-heading {
    margin: 10px 0 8px;
    font-size: var(--kf-app-fs-heading);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.35;
    text-align: center;
    color: var(--bh-ink, #0f172a);
}

.mh-how .mh-how__farmers-detail {
    margin: 0 0 18px;
    font-size: var(--kf-app-fs-body);
    font-style: italic;
    font-weight: 500;
    line-height: 1.55;
    text-align: center;
    color: var(--kf-shell-muted, #64748b);
}

.mh-how .mh-how__works-title {
    margin: 4px 0 12px;
    font-size: var(--kf-app-fs-heading);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--bh-ink, #0f172a);
    line-height: 1.3;
    text-align: center;
}

.mh-how .mh-how__fresh-list {
    margin-bottom: 12px;
}

.mh-how .mh-how__together {
    margin: 0 0 16px;
    font-size: var(--kf-app-fs-body);
    line-height: 1.55;
    font-weight: 600;
    color: var(--bh-ink, #0f172a);
}

.mh-sunny-banner {
    margin-top: 12px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(220, 196, 178, 0.55);
    background: var(--bh-card, #faf6f1);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.mh-sunny-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.mh-sunny-banner a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Amazon-style peeking promo card rail (home hero) ── */
.mh-carousel.mh-carousel--cards {
    margin: 0 auto 6px;
    max-width: none;
    width: 100%;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.mh-carousel.mh-carousel--cards .mh-carousel__mask {
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.mh-carousel.mh-carousel--cards .mh-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 14px;
    padding: 4px 0 2px;
    -webkit-overflow-scrolling: touch;
    /* pan-x alone blocks vertical page scroll on the tall 9:16 cards (common on mobile). */
    touch-action: pan-x pan-y pinch-zoom;
}

.mh-carousel.mh-carousel--cards .mh-carousel__track {
    display: flex;
    gap: 12px;
    padding: 2px 14px 0;
    width: max-content;
    box-sizing: border-box;
}

.mh-carousel.mh-carousel--cards .mh-carousel__slide {
    flex: 0 0 min(58vw, 240px);
    width: min(58vw, 240px);
    max-width: 240px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

@supports (width: 1cqi) {
    .mh-carousel.mh-carousel--cards .mh-carousel__slide {
        flex: 0 0 min(58cqi, 240px);
        width: min(58cqi, 240px);
    }
}

.mh-carousel.mh-carousel--cards .mh-carousel__link {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    max-height: none;
    border-radius: 18px;
    border: 1px solid #166534;
    background: #0b1710;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 32px -14px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.mh-carousel.mh-carousel--cards .mh-carousel__link:active {
    transform: scale(0.985);
}

.mh-carousel.mh-carousel--cards .mh-carousel__art {
    position: relative;
    flex: 0 0 auto;
    width: 100%;
    min-height: 0;
    aspect-ratio: 9 / 16;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    background: #0b1710;
    box-shadow: none;
}

.mh-carousel.mh-carousel--cards .mh-carousel__art::before,
.mh-carousel.mh-carousel--cards .mh-carousel__art::after {
    display: none;
}

.mh-carousel.mh-carousel--cards .mh-carousel__art img,
.mh-carousel.mh-carousel--cards .mh-carousel__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.mh-carousel.mh-carousel--cards .mh-carousel__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
    padding: 28px 12px 14px;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    text-align: left;
    color: #fff;
    background: linear-gradient(180deg, rgba(4, 12, 8, 0) 0%, rgba(4, 12, 8, 0.78) 55%, rgba(4, 12, 8, 0.92) 100%);
}

.mh-carousel.mh-carousel--cards .mh-carousel__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 8px 12px 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.mh-carousel.mh-carousel--cards .mh-carousel__dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.28);
    transition: width 0.25s ease, background 0.25s ease;
}

.mh-carousel.mh-carousel--cards .mh-carousel__dot--active {
    width: 16px;
    background: #166534;
    box-shadow: none;
}

@media (min-width: 768px) {
    .mh-carousel.mh-carousel--cards {
        max-width: var(--bh-layout-max, 430px);
        margin-left: auto;
        margin-right: auto;
    }

    .mh-carousel.mh-carousel--cards .mh-carousel__slide {
        flex-basis: 220px;
        width: 220px;
        max-width: 220px;
    }
}
