/* Healthy Friday — responsive campaign layout.
   Loaded after category-page.css and primary.css. */
.hf-page {
    --hf-text: #20312a;
    --hf-green: #d0ed79;
    --hf-accent: #d8511a;
    --hf-tint: #e5e5dc;
    --hf-out-rad: 12px;
    --hf-nav-height: 58px;
    --hf-gutter: 10px;
    --hf-gap: 8px;
    --hf-background: #ffffffc9;
    color: var(--hf-text);
    background: url(../media/backg-2026-4.png);
}
html:has(body.hf-page) { background: #e9e8d9; }
.hf-page > .container,
.hf-page .hf-hero__inner,
.hf-page .hf-category-nav__inner {
    width: 100%;
    min-width: 0;
    max-width: 1440px;
    padding-inline: var(--hf-gutter);
    box-sizing: border-box;
}

.terms {text-align: center;
    border-radius: 5px;
    border: 1px solid #0000002b;
    width: fit-content;
    margin-left: auto;
    margin-top: 20px;
    padding: 5px 15px;
    background: #fff;
    margin-bottom: -30px;}
.terms a {text-decoration: unset;}
.hf-page .cart_backg { z-index: 20; }
.hf-page :is(.hf-hero, .hf-category-nav, .hf-layout, #cartCont) :focus-visible {
    outline: 3px solid #128064;
    outline-offset: 3px;
}
.hf-page :is(.hf-hero, .hf-category-nav, .hf-layout) a { text-decoration: none; }

/* Header: labels remain in their own grid cells, not over the title. */
.hf-hero { color: #252521; position: relative; }
.hf-hero__inner { position: relative; overflow: visible; }
.hf-hero .hf-hero__bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px 44px;
    align-items: flex-start;
    gap: 6px;
    padding: 0;
    min-height: 64px;
    max-height: none;
    box-sizing: border-box;
    overflow: visible;
}
.hf-hero .hf-logo { width: min(100%, 160px); min-width: 0; margin-top: 15px;}
.hf-logo img { display: block; width: 100%; height: auto; }
.hf-hero .hf-cart {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    justify-self: end;
    margin-top: 5px;
}
.hf-cart .cart { display: flex; }
.hf-cart .cart-badge { right: -.3rem; }
.hf-label, .hf-label-2 {
    position: relative;
    width: 100%;
    aspect-ratio: 180 / 200;
    pointer-events: none;
    overflow: visible;
}
.hf-label::before, .hf-label-2::before {
    content: '';
    position: absolute;
    inset: 0;
    background: center / contain no-repeat;
    filter: drop-shadow(2px 4px 4px #41160266);
    top: -20px;
}
.hf-label::before { background-image: url(../media/hf-lgeader-label-35.png); }
.hf-label-2::before { background-image: url(../media/hf-lgeader-label-30.png); }
.hf-hero__content {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-items: center;
    gap: 12px;
    padding: 12px 0 0;
    text-align: center;
}
.hf-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 12vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -.055em;
    font-weight: 900;
    filter: drop-shadow(1px 2px 6px #00000020);
    z-index: 5;
}
.hf-down-count { width: min(100%, 320px); min-width: 0; box-sizing: border-box; z-index: 5;}
.hf-down-count .hf-countdown__title {
    margin: 0 0 5px;
    font-size: .85rem;
    font-weight: 800;
    text-transform: uppercase;
}
.hf-countdown__face { display: flex; justify-content: center; gap: 8px; }
.hf-countdown__group { display: grid; gap: 4px; }
.hf-countdown__caption { font-size: .8rem; font-weight: 700;}
.hf-countdown__digits { display: flex; justify-content: center; gap: 2px; perspective: 240px; }
.hf-countdown__tile {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(24px, 7vw, 30px);
    height: clamp(34px, 10vw, 42px);
    border-radius: 5px;
    background: linear-gradient(#ffffffdd 0%, #e2e2e2dd 49%, #ccccccdd 50%, #f0f0f0dd 100%);
    box-shadow: 0 2px 4px #0003, inset 0 1px 0 #fff;
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.hf-countdown__tile[hidden] { display: none; }
.hf-countdown__tile::after {
    content: '';
    position: absolute;
    top: 50%;
    inset-inline: 0;
    border-top: 1px solid #0002;
    pointer-events: none;
}

/* Sticky category navigation — horizontal scrolling only inside the rail. */
.hf-category-nav { position: sticky; top: 0; z-index: 4; color: #fff; }
.hf-category-nav::before {
    content: '';
    position: absolute;
    inset: 0;
    /*background: linear-gradient(#0003, #0003), url(../media/hf-background-dark.jpg) center / cover, #483529;*/
    background: #D8511A;
    z-index: -1;
    pointer-events: none;
    inset: -124px 0 0; clip-path: polygon(0 80px, 100% 0, 100% 100%, 0 100%);
}
.hf-category-nav__inner { display: flex; align-items: center; min-height: var(--hf-nav-height); }
.hf-category-rail {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 4px;
    margin: 0;
    padding: 4px 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    list-style: none;
}
.hf-category-rail li { flex: 1 0 auto; }
.hf-category-rail a {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 5px;
    color: inherit;
    font-weight: 700;
    white-space: nowrap;
}
.hf-category-rail a[aria-current="location"] { background: #fff; color: var(--hf-text); }
@media (hover: hover) {
    .hf-category-rail a:hover { background: #ffffffe6; color: var(--hf-text); }
}
.hf-category-nav .hf-category-rail a:focus-visible { outline-offset: -3px; }
@media (prefers-reduced-motion: no-preference) {
    html:has(body.hf-page) { scroll-behavior: smooth; }
}

/* Body: retain the familiar ePharm product-card design. */
.hf-layout { padding-block: 12px 32px; }
.hf-offers { display: grid; gap: 16px; min-width: 0; }
.hf-offer-group, .hf-section { min-width: 0; }
.hf-offer-group:last-child {
    min-block-size: calc(100vh - var(--hf-nav-height));
    min-block-size: calc(100dvh - var(--hf-nav-height));
}
.hf-section {
    scroll-margin-top: calc(var(--hf-nav-height) + 16px);
    border: 1px solid var(--hf-tint);
    border-radius: var(--hf-out-rad);
    background: var(--hf-background);
}
.hf-section > h2 {
    margin: 0;
    padding: 12px 10px;
    border-radius: calc(var(--hf-out-rad) - 1px) calc(var(--hf-out-rad) - 1px) 0 0;
    background: var(--hf-accent);
    color: #fff;
    text-align: center;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.hf-page .hf-section .hf-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--hf-gap);
    padding: var(--hf-gap);
}
.hf-products__empty { grid-column: 1 / -1; padding: 10px; }
.hf-products .card {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
}
.hf-products .card__img { display: block; min-width: 0; }
.hf-products .card__img img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.hf-card-preview { aspect-ratio: 1; border-radius: 5px; background: var(--hf-tint); }
.hf-products .card__name {
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
    margin-top: 5px;
    min-height: 3.9em;
}
.hf-products .disc_label { width: 40px; height: 40px; }
.hf-products .disc_label img { width: 100%; height: auto; }
.hf-products .disc_label div { font-size: .8rem; }
.hf-products .bye_area { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.hf-products .card__price { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.hf-products .price-regular, .hf-products .price-new { font-size: clamp(1.15rem, 4.5vw, 1.6rem); white-space: nowrap; }
.hf-products .price-old { font-size: .85rem; white-space: nowrap; }
.hf-products .price-decimals { top: -.3em; }
.hf-products .card__actions { flex: 0 0 44px; width: 44px; margin-left: auto; }
.hf-page .hf-products button.btn.btn-primary {
    position: absolute;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    transition: right .2s ease-in-out;
    right: -60px;
    bottom: 10px;
}

.card:hover button.btn.btn-primary {right: 10px;transition: right .2s ease-in-out;}
.hf-products button.btn.btn-primary:disabled { background: #e9eeea; color: #526258; cursor: default; }
.hf-products button.btn.btn-primary:disabled svg { color: currentColor; cursor: inherit; }

/* Managed brand and banner blocks: override the template's inline styles. */
.hf-page .hf-section :is(.hf-campaign-brands, .hf-campaign-banners) { padding: var(--hf-gap); }
.hf-page .hf-campaign-brands .e-brand-float {
    grid-auto-columns: minmax(100px, 1fr);
    gap: var(--hf-gap);
    padding: 2px 2px 6px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}
.hf-page .hf-campaign-brands .e-brand-float-in { height: 76px; }
.hf-page .hf-campaign-brands .e-brand-picture img { max-width: 100%; height: auto; }
.hf-page .hf-campaign-banners .banner-cont-home { grid-template-columns: minmax(0, 1fr); gap: var(--hf-gap); }
.hf-page .hf-campaign-banners .banner-in img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.hf-label-2 {display: none;}

@media (min-width: 480px) {
    .hf-page { --hf-gutter: 16px; --hf-gap: 10px; }
    .hf-hero .hf-hero__bar { grid-template-columns: minmax(0, 1fr) 80px 44px; gap: 12px; }
    .hf-page .hf-campaign-banners .banner-cont-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 725px) {
    .hf-page { --hf-gutter: 24px; --hf-gap: 12px; }
    .hf-page .hf-section .hf-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .hf-hero .hf-hero__bar { grid-template-columns: minmax(0, 1fr) 105px 44px; }
    .hf-hero__content { grid-template-columns: minmax(0, 1fr) auto; justify-items: start; text-align: left; padding: 0 0 24px; }
    .hf-hero h1 { font-size: clamp(2.8rem, 6vw, 6.1rem); }
    .hf-down-count { text-align: center; justify-self: end; }
    .hf-products .card { padding: 15px; }
    .hf-page .hf-campaign-brands .e-brand-float-in { height: 90px; }
    

}
@media (min-width: 1024px) {
    .hf-page { --hf-gutter: clamp(24px, 4.2vw, 60px); --hf-gap: 15px; }
    .hf-hero .hf-hero__bar { grid-template-columns: minmax(0, 1fr) 115px 105px 300px; gap: 24px; max-height: 40px; }
    .hf-label, .hf-label-2 { align-self: start; z-index: 6; }
    .hf-hero__content { padding: 12px 0 10px; grid-template-columns: minmax(0, 1fr) 290px; }
    .hf-category-nav::before { inset: -80px 0 0; clip-path: polygon(0 60px, 100% 0, 100% 100%, 0 100%); }
    .hf-page .hf-section .hf-products { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .hf-products .card__actions { flex-basis: 50px; width: 50px; }
    .hf-page .hf-products button.btn.btn-primary { width: 50px; }
    .hf-label-2 {display: block;}
}
@media (prefers-reduced-motion: reduce) {
    .hf-page .hf-products .card, .hf-page .hf-products button.btn.btn-primary { transition: none; }
}
