/* Homepage. Shared tokens, cards, rails and footer live in storefront.css. */

:root {
    --hm-cat-w: 260px;
}

/* ---------- Menu bar ---------- */

.hm-nav {
    background: var(--pd-green-deep);
    font-family: var(--pd-font);
}

.hm-nav__inner {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.hm-nav__cats {
    display: flex;
    flex: none;
    align-items: center;
    gap: 10px;
    width: var(--hm-cat-w);
    padding: 0 18px;
    background: var(--pd-green-dark);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 600;
}

.hm-nav__links {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hm-nav__links a {
    display: block;
    padding: 12px 16px;
    color: rgba(255, 255, 255, .88);
    font-size: 1.02rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: inset 0 -3px 0 transparent;
    transition: box-shadow .15s, color .15s;
}

.hm-nav__links a:hover,
.hm-nav__links a[aria-current="page"] {
    color: #fff;
    box-shadow: inset 0 -3px 0 var(--pd-leaf);
}

.hm-nav__links a:focus-visible {
    outline: 2px solid var(--pd-leaf);
    outline-offset: -2px;
}

/* ---------- Page stack ---------- */

.hm > * + * {
    margin-top: 20px;
}

/* ---------- Hero: category list + slider ---------- */

.hm-hero {
    position: relative;
    display: grid;
    grid-template-columns: var(--hm-cat-w) minmax(0, 1fr);
    gap: 16px;
}

/* Takes the slider's height instead of setting it; the list scrolls if it runs longer */
.hm-cat {
    contain: size;
    padding: 6px 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.hm-cat > ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hm-cat__item > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    color: var(--pd-ink);
    font-size: .95rem;
    line-height: 1.3;
    text-decoration: none;
}

.hm-cat__item > a img {
    flex: none;
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.hm-cat__item > a span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hm-cat__chev {
    flex: none;
    font-size: .7rem;
    color: var(--pd-muted);
}

.hm-cat__item:hover > a,
.hm-cat__item:focus-within > a {
    background: var(--pd-mint);
    color: var(--pd-green-dark);
}

.hm-cat__item > a:focus-visible {
    outline: none;
    box-shadow: inset 3px 0 0 var(--pd-green-deep);
}

/* Positioned against .hm-hero so it escapes the list's scroll clipping */
.hm-cat__flyout {
    position: absolute;
    top: 0;
    left: var(--hm-cat-w);
    z-index: 30;
    display: none;
    width: 260px;
    min-height: 100%;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--pd-line);
    border-radius: 0 14px 14px 0;
    box-shadow: 0 12px 32px rgba(22, 36, 29, .14);
}

.hm-cat__item:hover > .hm-cat__flyout,
.hm-cat__item:focus-within > .hm-cat__flyout {
    display: block;
}

.hm-cat__flyout a {
    display: block;
    padding: 8px 18px;
    color: var(--pd-ink);
    text-decoration: none;
}

.hm-cat__flyout a:hover,
.hm-cat__flyout a:focus-visible {
    outline: none;
    background: var(--pd-mint);
    color: var(--pd-green-dark);
}

.hm-slider {
    position: relative;
    min-width: 0;
    border-radius: 14px;
    overflow: hidden;
    background: var(--pd-sunk);
}

.hm-slider .owl-carousel,
.hm-slider .owl-stage-outer,
.hm-slider .owl-stage,
.hm-slider .owl-item,
.hm-slide {
    height: 100%;
}

.hm-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-slider .owl-dots {
    position: absolute;
    right: 0;
    bottom: 12px;
    left: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.hm-slider .owl-dots.disabled {
    display: none;
}

.hm-slider .owl-dot span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: rgba(255, 255, 255, .6);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
    transition: width .25s, background-color .25s;
}

.hm-slider .owl-dot.active span {
    width: 22px;
    background: #fff;
}

/* ---------- Shopping perks ---------- */

.hm-perks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    padding: 4px;
}

.hm-perk {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--pd-ink);
    text-decoration: none;
}

.hm-perk + .hm-perk {
    border-left: 1px solid var(--pd-line);
}

a.hm-perk:hover {
    color: var(--pd-green-dark);
}

.hm-perk__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--pd-mint);
    color: var(--pd-green-deep);
}

.hm-perk strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.hm-perk small {
    display: block;
    font-size: .85rem;
    color: var(--pd-muted);
}

/* ---------- Category row ---------- */

.hm-catcard {
    display: block;
    width: 100%;
    padding: 4px 2px;
    color: var(--pd-ink);
    text-align: center;
    text-decoration: none;
}

.hm-catcard__img {
    display: block;
    width: 88px;
    height: 88px;
    margin: 0 auto;
    border: 2px solid var(--pd-line);
    border-radius: 50%;
    background: var(--pd-mint);
    overflow: hidden;
    transition: border-color .15s;
}

.owl-carousel .owl-item .hm-catcard__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hm-catcard:hover .hm-catcard__img,
.hm-catcard:focus-visible .hm-catcard__img {
    border-color: var(--pd-green);
}

.hm-catcard:focus-visible {
    outline: none;
}

.hm-catcard__name {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    font-size: .88rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hm-cats .owl-carousel .owl-nav button.owl-prev,
.hm-cats .owl-carousel .owl-nav button.owl-next {
    top: 44px;
}

/* ---------- Promotional band — the one loud section ---------- */

.hm-promo {
    background: var(--pd-forest);
    border-color: var(--pd-forest);
}

.hm-promo__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.hm-promo .pd-h2 {
    color: #fff;
}

.hm-promo .pd-tag {
    animation: none;
}

.hm-promo .pd-tag::before {
    background: var(--pd-forest);
}

.hm-promo .pd-rail__more {
    color: var(--pd-leaf);
}

.hm-promo .pd-rail__more:hover {
    color: #fff;
}

.hm-promo .pd-card {
    border-color: transparent;
}

/* ---------- Ad banners ---------- */

.hm-ads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.hm-ads a {
    display: block;
    border-radius: 14px;
    overflow: hidden;
}

.hm-ads img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Category product grids ---------- */

.hm-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (min-width: 576px) {
    .hm-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .hm-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .hm-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .hm-slider {
        min-height: 280px;
    }
}

@media (min-width: 1200px) {
    .hm-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .hm > * + * {
        margin-top: 14px;
    }

    .hm-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-slider {
        border-radius: 12px;
    }

    .hm-perks {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hm-perk {
        gap: 10px;
        padding: 12px 10px;
    }

    .hm-perk + .hm-perk {
        border-left: 0;
    }

    .hm-perk:nth-child(even) {
        border-left: 1px solid var(--pd-line);
    }

    .hm-perk:nth-child(n + 3) {
        border-top: 1px solid var(--pd-line);
    }

    .hm-perk__icon {
        width: 36px;
        height: 36px;
        font-size: .9rem;
    }

    .hm-perk strong {
        font-size: .95rem;
    }

    .hm-perk small {
        font-size: .8rem;
    }

    .hm-catcard__img {
        width: 72px;
        height: 72px;
    }

    .hm-cats .owl-carousel .owl-nav button.owl-prev,
    .hm-cats .owl-carousel .owl-nav button.owl-next {
        top: 38px;
    }
}
