/*
 * The top of the home page on the computer, from the fronts (module/computer/layout/homeHero.phtml; P5 of
 * docs/HOME-FRONTS-AND-RECENTLY-VIEWED-PLAN.md). Same footprint as the old slider (1320 wide, ~340 tall), so the
 * page below does not move when the backoffice switches between the three positions. Colours from tokens.
 */

.homeHero{
    margin: 0 auto 28px;
    padding-top: 24px; /* a margin would collapse into the spacer's above it */
    color: var(--lb-text);
    text-align: left; /* the page around it centres its text */
}

/* ── fronts: finder, then the fronts side by side ───────────────────────── */
.homeHeroIntro{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    gap: 28px;
    align-items: center;
    margin-bottom: 18px;
}

.homeHeroSlogan{
    font-size: 30px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--lb-brand);
}

/* The slogan's second sentence: its own line, in the accent text colour. */
.homeHeroSlogan span{
    display: block;
    margin-top: 4px;
    font-size: 24px;
    color: var(--lb-accent-text);
}

.homeHeroFinder{
    background: var(--lb-surface);
    border: 1px solid var(--lb-border);
    border-radius: 10px;
    padding: 14px 16px;
}

.homeHeroFinder label{
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--lb-brand);
}

.homeHeroFinderRow{
    display: flex;
    gap: 8px;
}

.homeHeroFinderRow input{
    flex: 1 1 auto;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--lb-border);
    border-radius: 6px;
    background: var(--lb-bg);
    color: var(--lb-text);
    font-size: 15px;
}

.homeHeroFinderRow input:focus{
    outline: 2px solid var(--lb-brand);
    outline-offset: 0;
}

.homeHeroFinderRow button{
    flex: 0 0 auto;
    height: 42px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: var(--lb-accent);
    color: var(--lb-on-accent);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.homeHeroFinderRow button:hover{
    background: var(--lb-accent-hover);
}

.homeHeroBrands{
    margin-top: 8px;
    font-size: 13px;
    color: var(--lb-text-muted);
}

.homeHeroBrands a{
    margin-left: 8px;
    color: var(--lb-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.homeFronts{
    display: grid;
    grid-template-columns: repeat(var(--fronts, 4), minmax(0, 1fr)); /* 1 to 4: fewer fronts share the row */
    gap: 14px;
}

.homeFront{
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--lb-border);
    border-radius: 10px;
    background: var(--lb-bg);
    color: var(--lb-text);
    text-decoration: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.homeFront:hover,
.homeFront:focus-visible{
    border-color: var(--lb-brand);
    box-shadow: var(--lb-shadow);
    color: var(--lb-text);
    text-decoration: none;
}

.homeFront:focus-visible{
    outline: 2px solid var(--lb-brand);
    outline-offset: 2px;
}

.homeFrontHead{
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.homeFrontHead b{
    font-size: 18px;
    line-height: 1.2;
    color: var(--lb-brand);
    min-width: 0;
    /* up to two lines: a title cut to "Jacto de Tinta/Tinte…" reads worse than one that wraps */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.homeFrontHead small{
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--lb-text-muted);
}

.homeFrontSub{
    font-size: 13px;
    color: var(--lb-text-muted);
}

.homeFrontPhotos{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.homeFrontProduct{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.homeFrontProduct img{
    width: 100%;
    max-width: 120px;
    height: 100px;
    object-fit: contain;
}

.homeFrontPrice{
    font-size: 13px;
    font-weight: 700;
    color: var(--lb-accent-text);
    font-variant-numeric: tabular-nums;
}

.homeFrontGo{
    margin-top: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--lb-brand);
}

.homeFrontGo i,
.homeSlideCta i{
    margin-left: 6px;
    font-size: 11px;
}

/* ── carousel: one front at a time ──────────────────────────────────────── */
.homeCarousel{
    position: relative;
    border: 1px solid var(--lb-border);
    border-radius: 12px;
    background: var(--lb-surface);
    padding: 24px 64px 44px;
}

.homeSlide{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 28px;
    align-items: center;
    min-height: 240px;
}

.homeSlide[hidden]{
    display: none;
}

.homeSlideTitle{
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--lb-brand);
}

.homeSlideSub{
    margin-top: 8px;
    font-size: 16px;
    color: var(--lb-text-muted);
}

.homeSlideCount{
    margin-top: 10px;
    font-size: 14px;
    color: var(--lb-text-muted);
}

.homeSlideCta{
    display: inline-block;
    margin-top: 18px;
    padding: 11px 20px;
    border-radius: 6px;
    background: var(--lb-brand);
    color: #FFFFFF; /* white on every theme's brand (>= 4.9:1); the navbar text is grey on Safeway */
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.homeSlideCta:hover,
.homeSlideCta:focus-visible{
    background: var(--lb-brand-hover);
    color: #FFFFFF;
    text-decoration: none;
}

.homeSlidePhotos{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.homeSlideProduct{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.homeSlideProduct img{
    width: 100%;
    max-width: 180px;
    height: 170px;
    object-fit: contain;
    background: var(--lb-bg);
    border-radius: 8px;
}

.homeCarouselArrow{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 1px solid var(--lb-border);
    border-radius: 50%;
    background: var(--lb-bg);
    color: var(--lb-brand);
    font-size: 14px;
    cursor: pointer;
}

.homeCarouselPrev{ left: 12px; }
.homeCarouselNext{ right: 12px; }

.homeCarouselControls{
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.homeCarouselDot{
    width: 10px;
    height: 10px;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: var(--lb-border);
    cursor: pointer;
    transition: width 150ms ease;
}

.homeCarouselDot[aria-current="true"]{
    width: 28px;
    background: var(--lb-brand);
}

.homeCarouselPause{
    margin-left: 10px;
    padding: 2px 10px;
    border: 1px solid var(--lb-border);
    border-radius: 999px;
    background: var(--lb-bg);
    color: var(--lb-text);
    font-size: 12px;
    cursor: pointer;
}

.homeCarouselPause i{
    margin-right: 6px;
    font-size: 11px;
}

.homeHero button:focus-visible,
.homeHero a:focus-visible{
    outline: 2px solid var(--lb-brand);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce){
    .homeFront,
    .homeCarouselDot{
        transition: none;
    }
}
