/* Composições da home; cards e imagens continuam usando a biblioteca existente. */
.home-product-feed__sentinel[hidden] { display: none; }
.home-product-grid > [data-layout],
.home-product-grid > .home-feed-editorial-carousel {
    grid-column: 1 / -1;
    min-width: 0;
    margin-bottom: 24px;
}
.home-feed-grid, .home-feed-horizontal, .home-feed-promos {
    display: grid;
    gap: 18px;
}
.home-feed-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.home-feed-horizontal, .home-feed-promos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-page .home-feed-grid > .carousel__item,
.home-page .home-feed-horizontal > .carousel__item,
.home-page .home-feed-deal__lead > .carousel__item {
    width: 100%;
    min-width: 0;
    margin: 0;
    height: auto;
}
.home-page .home-feed-horizontal > .carousel__item { min-height: 172px; }
.home-page .home-feed-horizontal .carousel__link {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    height: 100%;
}
.home-page .home-feed-horizontal .carousel__image-wrapper {
    width: 100%;
    height: 100%;
    min-height: 172px;
    padding-bottom: 0;
    border: 0;
}
.home-page .home-feed-horizontal .carousel__content-details {
    min-width: 0;
    padding: 16px;
    justify-content: center;
}
.home-page .home-feed-horizontal .carousel__name { font-size: 15px; line-height: 1.4; }
.home-feed-deal {
    display: grid;
    grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2.2fr);
    gap: 24px;
    align-items: start;
}
.home-feed-deal__lead { min-width: 0; }
.home-feed-deal__lead h4 { margin: 0 0 14px; font-size: 20px; }
.home-page .home-feed-deal__lead .carousel__image-wrapper { height: 220px; }
.home-feed-rail.carousel-section { --carousel-nav-offset: 4px; min-width: 0; width: 100%; margin: 0; }
.home-feed-rail__controls { display: contents; }
.home-feed-rail .carousel__container { width: 100%; }
.home-feed-editorial-carousel { min-width: 0; }
.home-feed-editorial-carousel .carousel-section { margin: 0 0 28px; }
.home-feed-promo {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-radius: 14px;
    background: #eaf2fc;
    text-decoration: none;
    color: #222d32;
    overflow: hidden;
}
.home-feed-promo > div:first-child { padding: 24px; align-self: center; min-width: 0; }
.home-feed-promo:nth-child(even) { background: #edf5f1; }
.home-feed-promo small { text-transform: uppercase; font-weight: 600; font-size: 11px; letter-spacing: .05em; }
.home-feed-promo h4 { margin: 12px 0 20px; font-size: 22px; line-height: 1.25; overflow-wrap: anywhere; }
.home-feed-promo__cta { display: inline-block; padding: 12px 20px; border-radius: 6px; background: var(--azul-selecao, #3483fa); color: white; font-weight: 600; }
.home-page .home-feed-promo .carousel__image-wrapper { height: 100%; min-height: 200px; padding: 0; border: 0; border-radius: 0; background: white; }
.home-feed-promo:focus-visible, .home-feed-rail button:focus-visible { outline: 3px solid var(--azul-selecao, #3483fa); outline-offset: 3px; }
.home-page .carousel__item--featured::before {
    background: #e9f7ed !important;
    color: #19733c !important;
    border-color: #b7dfc3 !important;
}
/* Remove o separador entre o cabeçalho e os produtos da vitrine aprovada. */
.home-page #section-carrossel-categorias-populares .carousel__items {
    width: 100%;
    gap: 16px;
    padding: 8px 0 16px !important;
}
.home-page #section-carrossel-categorias-populares .carousel__item--category {
    flex: 0 0 calc((100% - 80px) / 6);
    width: calc((100% - 80px) / 6);
    min-height: 190px;
    border-radius: 12px;
}
.home-page #section-carrossel-categorias-populares .carousel__image-wrapper { height: 116px !important; }
.home-page #section-carrossel-categorias-populares .carousel__name { white-space: normal; line-height: 1.35; }
@media (max-width: 1024px) {
    .home-feed-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .home-feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .home-feed-horizontal, .home-feed-promos, .home-feed-deal { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .home-page .home-feed-horizontal .carousel__content-details { padding: 12px; }
    .home-page .home-feed-horizontal .carousel__name { font-size: 14px; }
    .home-page .home-feed-deal__lead > .carousel__item { min-height: 0; }
    .home-feed-deal__lead .carousel__link { display: grid; grid-template-columns: 42% 58%; }
    .home-page .home-feed-deal__lead .carousel__image-wrapper { height: 100%; min-height: 170px; }
    .home-feed-promo > div:first-child { padding: 18px; }
    .home-feed-promo h4 { font-size: 19px; }
    .home-page .home-feed-promo .carousel__image-wrapper { height: 100%; min-height: 170px; }
    .home-page #section-carrossel-categorias-populares .carousel__item--category { flex-basis: 140px; width: 140px; }
}

/* Blocos com o mesmo alinhamento externo e respiro interno. */
.home-page { --home-panel-pad: 22px; --home-section-gap: 26px; }
.home-page .div-conteudo-home,
.home-page .home-product-feed { max-width: 1180px; padding-inline: 20px; }
.home-page .home-product-grid {
    display: flex;
    flex-direction: column;
    gap: var(--home-section-gap);
}
.home-page .home-product-grid > *,
.home-page .home-feed-editorial-carousel .carousel-section { margin: 0; }
.home-page .home-product-category { margin-bottom: var(--home-section-gap); }
.home-feed-panel,
.home-page .carousel-section {
    padding: var(--home-panel-pad);
    background: #fff;
    border-radius: 12px;
    min-width: 0;
}
.home-feed-panel__title,
.home-page .carousel__title {
    margin: 0 0 18px;
    padding: 0;
    color: var(--azul-padrao);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}
/* Flex distribui a última linha inteira, sem buracos nem duplicação de produtos. */
.home-feed-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.home-page .home-feed-grid > .carousel__item {
    flex: 1 1 calc((100% - 70px) / 6);
    width: auto;
}
.home-feed-horizontal { gap: 16px; }
.home-feed-horizontal--compact { display: flex; flex-wrap: wrap; }
.home-page .home-feed-horizontal--compact > .carousel__item { flex: 1 1 calc((100% - 16px) / 2); }
/* Fallback para uma categoria que realmente só tem um produto: dimensões contidas. */
.home-page .home-feed-panel:has(> .home-feed-horizontal--compact > .carousel__item:only-child) {
    width: 100%;
    max-width: 560px;
    align-self: center;
}
.home-page .home-feed-horizontal--compact .carousel__image-wrapper {
    height: 172px;
    min-height: 172px;
    aspect-ratio: auto;
}
.home-page .home-feed-grid .carousel__image-wrapper,
.home-page .home-feed-horizontal .carousel__image-wrapper,
.home-page .home-feed-deal .carousel__image-wrapper { padding: 10px; }
.home-page .home-feed-deal {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: 18px;
    align-items: start;
}
.home-feed-deal__products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}
.home-page .home-feed-deal__products > .carousel__item {
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0;
}
.home-page .home-feed-deal .carousel__image-wrapper { height: 190px; }
.home-page .home-feed-rail.carousel-section { margin: 0; background: transparent; border: 0; box-shadow: none; }
.home-page .home-feed-rail .carousel__container,
.home-page .home-feed-rail .carousel__items { border: 0; box-shadow: none; }
.home-page .home-feed-promos:has(> :only-child) { grid-template-columns: 1fr; }
@media (min-width: 769px) and (max-width: 1024px) {
    .home-page .home-feed-grid > .carousel__item { flex-basis: calc((100% - 42px) / 4); }
    .home-page .home-feed-deal { grid-template-columns: 1fr; }
    .home-page .home-feed-deal__lead .carousel__link { display: grid; grid-template-columns: 35% 65%; }
}
@media (max-width: 768px) {
    .home-page { --home-panel-pad: 16px; --home-section-gap: 20px; }
    .home-page .div-conteudo-home,
    .home-page .home-product-feed { padding-inline: 12px; }
    .home-feed-panel__title,
    .home-page .carousel__title,
    .home-feed-grid { gap: 10px; }
    .home-page .home-feed-grid > .carousel__item { flex-basis: calc((100% - 10px) / 2); }
    .home-page .home-feed-horizontal--compact > .carousel__item { flex-basis: 100%; }
    .home-page .home-feed-deal { grid-template-columns: 1fr; gap: 16px; }
    .home-feed-deal__products { grid-template-columns: 1fr; gap: 12px; }
    .home-page .home-feed-deal__products .carousel__item { min-height: 150px; }
    .home-feed-deal__products .carousel__link { display: grid; grid-template-columns: 42% 58%; }
    .home-page .home-feed-deal .carousel__image-wrapper { height: 100%; min-height: 150px; }
    .home-page .home-feed-deal .carousel__image-wrapper { border-bottom: 0; }
    .home-page .home-feed-deal .carousel__content-details { justify-content: center; padding: 12px; min-width: 0; }
}

/* Vitrine de três produtos do feed contínuo.
   Desktop/tablet mantém o destaque horizontal. No celular, os cards ficam verticais
   para preservar imagens centralizadas e evitar vazios laterais em produtos com foto estreita. */
.home-page .home-product-feed__showcase {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    align-items: stretch;
    gap: 14px;
    min-width: 0;
}

.home-page .home-product-feed__showcase-lead-column,
.home-page .home-product-feed__showcase-side {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: var(--home-panel-pad);
    border: 1px solid #e5e9ee;
    border-radius: 10px;
    background: #ffffff;
}

.home-page .home-product-feed__showcase-heading {
    min-height: 0;
    margin: 0 0 18px;
    padding: 0;
    color: var(--azul-padrao);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

.home-page .home-product-feed__showcase-lead,
.home-page .home-product-feed__showcase-grid {
    min-width: 0;
    min-height: 0;
    padding: 0;
}

.home-page .home-product-feed__showcase-lead .home-product-card--lead,
.home-page .home-product-feed__showcase-grid > .carousel__item {
    width: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
}

.home-page .home-product-feed__showcase .carousel__image-wrapper {
    min-height: 0;
    background: #ffffff;
}

.home-page .home-product-feed__showcase .carousel__image {
    object-fit: contain;
    object-position: center center;
}

.home-page .home-product-feed__showcase-lead .carousel__content-details {
    min-width: 0;
    padding: 14px;
}

.home-page .home-product-feed__showcase-lead .carousel__name {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.home-page .home-product-feed__showcase-lead .carousel__current-price {
    font-size: 22px;
}

@media (min-width: 769px) {
    .home-page .home-product-feed__showcase-lead-column,
    .home-page .home-product-feed__showcase-side {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .home-page .home-product-feed__showcase-lead,
    .home-page .home-product-feed__showcase-grid {
        height: 280px;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead,
    .home-page .home-product-feed__showcase-grid > .carousel__item {
        height: 100%;
    }

    .home-page .home-product-feed__showcase-grid {
        display: grid;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-page .home-product-feed__showcase .carousel__image-wrapper {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .home-page .home-product-feed__showcase {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 0;
    }

    .home-page .home-product-feed__showcase-heading {
        padding: 12px 12px 8px;
        font-size: 16px;
    }

    .home-page .home-product-feed__showcase-lead,
    .home-page .home-product-feed__showcase-grid {
        height: auto;
        padding: 0;
    }

    .home-page .home-product-feed__showcase-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead,
    .home-page .home-product-feed__showcase-grid > .carousel__item {
        height: auto;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead .carousel__link,
    .home-page .home-product-feed__showcase-grid > .carousel__item .carousel__link {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        height: auto;
        min-height: 0;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead .carousel__image-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        min-height: 150px;
        max-height: 176px;
        aspect-ratio: 16 / 10;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid #eef1f4;
        box-sizing: border-box;
    }

    .home-page .home-product-feed__showcase-grid > .carousel__item .carousel__image-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1;
        padding: 8px;
        border-right: 0;
        border-bottom: 1px solid #eef1f4;
        box-sizing: border-box;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead .carousel__image {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 148px;
        padding: 0;
        margin: 0 auto;
    }

    .home-page .home-product-feed__showcase-grid > .carousel__item .carousel__image {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: 0 auto;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead .carousel__content-details,
    .home-page .home-product-feed__showcase-grid > .carousel__item .carousel__content-details {
        min-height: 0;
        padding: 11px 12px 12px;
        justify-content: flex-start;
    }
}




@media (min-width: 769px) {
    .home-page .home-product-feed__showcase-lead .home-product-card--lead .carousel__link,
    .home-page .home-product-feed__showcase-grid > .carousel__item .carousel__link {
        display: grid;
        height: 100%;
        min-height: 0;
    }

    .home-page .home-product-feed__showcase-lead .home-product-card--lead .carousel__link {
        grid-template-columns: minmax(0, 52%) minmax(0, 48%);
    }

    .home-page .home-product-feed__showcase-grid > .carousel__item .carousel__link {
        grid-template-columns: minmax(0, 42%) minmax(0, 58%);
    }

    .home-page .home-product-feed__showcase .carousel__image-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 10px;
        border-right: 1px solid #eef1f4;
        border-bottom: 0;
        box-sizing: border-box;
    }

    .home-page .home-product-feed__showcase .carousel__image {
        position: relative;
        inset: auto;
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        margin: auto;
        object-fit: contain;
        object-position: center center;
    }

    .home-page .home-product-feed__showcase .carousel__content-details {
        justify-content: center;
        min-width: 0;
    }
}

