@import url("partials/_parfume_horizontal_grid-K6Aw8tT.css");
@import url("partials/_savings_cards-oD3cmaw.css");

.homepage-title {
    text-transform: uppercase;
    font-size: 2.8rem;
    line-height: 1.2;
    font-weight: 300;

    @media (max-width: 767.98px) {
        font-size: 2rem;
    }
}

.homepage-lead {
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    line-height: 1.5;
    margin: 0.9rem auto 0;
    max-width: 48rem;
    text-wrap: balance;

    @media (max-width: 767.98px) {
        font-size: 1rem;
        margin-top: 0.75rem;
    }
}

/* The hero search is the page's main call to action, so it is the strongest element after the
   title: larger than the header one it replaces, with a readable placeholder (the theme's is pale
   lilac). Below 680px autocomplete renders a button that opens a full-screen search instead. */
.homepage-search {
    --aa-search-input-height: 4rem;
    margin: 2rem auto 0;
    max-width: 44rem;

    & .aa-Autocomplete,
    & .aa-Form {
        width: 100%;
    }

    & .aa-Form,
    & .aa-DetachedSearchButton {
        background-color: #fff;
        border-color: rgba(var(--logo-color-rgb), 0.55);
        border-radius: 0.9rem;
        box-shadow: 0 0.6rem 1.75rem rgba(var(--logo-color-rgb), 0.2);
    }

    & .aa-Form:focus-within,
    & .aa-DetachedSearchButton:focus-visible {
        border-color: rgba(var(--logo-color-rgb), 0.7);
        box-shadow: 0 0 0 0.22rem rgba(var(--logo-color-rgb), 0.16);
        outline: none;
    }

    & .aa-Input,
    & .aa-DetachedSearchButton {
        font-size: 1.2rem;
    }

    & .aa-Input::placeholder {
        color: var(--bs-secondary-color);
    }

    & .aa-DetachedSearchButton {
        color: var(--bs-secondary-color);
        padding-inline: 1rem;
    }

    /* The theme lets the placeholder wrap, which would break out of the button on narrow phones. */
    & .aa-DetachedSearchButtonPlaceholder {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    & .aa-SubmitIcon,
    & .aa-DetachedSearchButtonIcon {
        color: var(--logo-color);
    }

    @media (max-width: 767.98px) {
        --aa-search-input-height: 3.5rem;
        margin-top: 1.5rem;

        & .aa-Input,
        & .aa-DetachedSearchButton {
            font-size: 1.1rem;
        }
    }
}

.homepage-quick-links {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1.5rem;
}

.homepage-quick-links-genders {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.homepage-quick-link {
    border: 1px solid rgba(var(--logo-color-rgb), 0.4);
    border-radius: 999px;
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
    padding: 0.3rem 0.9rem;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;

    &:hover,
    &:focus-visible {
        border-color: var(--logo-color);
        color: var(--logo-color);
    }
}

.homepage-quick-links-brands {
    color: var(--bs-secondary-color);
    column-gap: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.92rem;
    justify-content: center;
    row-gap: 0.25rem;

    & a {
        color: inherit;
        text-decoration-color: rgba(var(--logo-color-rgb), 0.55);
        text-underline-offset: 0.22rem;

        &:hover,
        &:focus-visible {
            color: var(--logo-color);
        }
    }
}

.container-page-title {
    margin-top: 6rem;
    margin-bottom: 3rem;

    @media (max-width: 767.98px) {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
}

.homepage-product-section {
    padding-top: 0.5rem;
    position: relative;

    @media (max-width: 767.98px) {
        padding-top: 0;
    }
}

.homepage-product-section-header {
    margin-bottom: 2.25rem;
    padding-bottom: 1.2rem;
    position: relative;

    &::after {
        background: linear-gradient(90deg, rgba(var(--logo-color-rgb), 0.34) 0%, rgba(var(--logo-color-rgb), 0.08) 45%, rgba(var(--logo-color-rgb), 0) 100%);
        content: "";
        height: 1px;
        left: 0;
        position: absolute;
        right: 0;
        bottom: 0;
    }
}

.homepage-product-section-copy {
    max-width: 40rem;
}

/* A section whose "Vidi više" link sits beside its title, above the line. */
.homepage-product-section-header--with-cta {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
}

/* A section title with an info button beside it (_section_info.html.twig). The title is inline, so
   the button follows its last word when the title wraps on a phone. */
.homepage-section-heading > .homepage-product-section-title {
    display: inline;
}

.homepage-section-info {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--bs-secondary-color);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    margin-left: 0.35rem;
    min-height: 24px;
    min-width: 24px;
    padding: 0;
    vertical-align: 0.15em;

    &:hover,
    &[aria-expanded="true"] {
        color: var(--logo-color);
    }

    &[hidden] {
        display: none !important;
    }

    /* A 44 px touch area, as beside a perfume's type, that doesn't make the title taller. */
    @media (pointer: coarse) {
        position: relative;

        &::after {
            content: '';
            inset: -10px;
            position: absolute;
        }
    }
}

.homepage-info-popover {
    --bs-popover-body-padding-x: 0.75rem;
    --bs-popover-body-padding-y: 0.6rem;
    --bs-popover-font-size: 0.875rem;
    --bs-popover-header-font-size: 0.875rem;
    --bs-popover-header-padding-x: 0.75rem;
    --bs-popover-header-padding-y: 0.5rem;
    --bs-popover-max-width: min(20rem, calc(100vw - 2rem));

    & .popover-header {
        font-weight: 600;
    }
}

/* Sections stand closer together on phones, where 6rem is most of a screen. */
.homepage-section-container {
    @media (max-width: 767.98px) {
        margin-bottom: 3.5rem;
    }
}

.homepage-product-section-title {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 0;

    @media (max-width: 767.98px) {
        font-size: 2rem;
    }
}

.homepage-section-cta {
    align-items: center;
    display: inline-flex;
    font-size: 1.14rem;
    font-weight: 600;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.1rem 0;
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease, text-decoration-color 0.2s ease;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.28rem;
    text-decoration-color: rgba(var(--logo-color-rgb), 0.35);
    color: var(--bs-body-color);

    @media (max-width: 767.98px) {
        font-size: 1.18rem;
        min-height: 2.75rem;
    }

    &:hover {
        color: var(--logo-color);
        gap: 0.7rem;
        text-decoration-color: rgba(var(--logo-color-rgb), 0.85);
    }
}

/* The catalogue's size, one line under the search. */
.homepage-trust {
    border-top: 1px solid rgba(var(--logo-color-rgb), 0.18);
    color: var(--bs-secondary-color);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.98rem;
    gap: 0.5rem 1.75rem;
    justify-content: center;
    list-style: none;
    margin: 2.25rem auto 0;
    max-width: 48rem;
    padding: 1.25rem 0 0;

    & li {
        align-items: center;
        display: inline-flex;
        gap: 0.45rem;
    }

    & svg {
        color: var(--logo-color);
        flex-shrink: 0;
    }

    & b {
        color: var(--bs-body-color);
        font-weight: 600;
    }

    @media (max-width: 767.98px) {
        font-size: 0.88rem;
        gap: 0.35rem 1rem;
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
}

/* "Parfemi po budžetu": a card per gender with its three price pages. On phones the three limits
   sit side by side as buttons, so the block takes three short rows instead of nine links. */
.homepage-budget {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    @media (max-width: 991.98px) {
        gap: 0.75rem;
        grid-template-columns: minmax(0, 1fr);
    }
}

.homepage-budget-card {
    background: linear-gradient(180deg, rgba(var(--logo-color-rgb), 0.08), #fff 55%);
    border: 1px solid rgba(var(--logo-color-rgb), 0.28);
    border-radius: 1rem;
    padding: 1.1rem 1.1rem 0.4rem;

    @media (max-width: 767.98px) {
        padding: 0.9rem;
    }
}

.homepage-budget-head {
    align-items: center;
    display: flex;
    gap: 1.4rem;
    margin-bottom: 0.4rem;

    @media (max-width: 767.98px) {
        margin-bottom: 0.75rem;
    }

    /* Three cards in a row are narrowest here: two pictures leave the gender's name one line. */
    @media (min-width: 992px) and (max-width: 1199.98px) {
        gap: 1rem;

        & .homepage-budget-bottles span:nth-child(3) {
            display: none;
        }
    }
}

.homepage-budget-bottles {
    display: flex;
    flex-shrink: 0;

    & span {
        align-items: center;
        background-color: #fff;
        border: 1px solid rgba(var(--logo-color-rgb), 0.18);
        border-radius: 0.6rem;
        display: flex;
        height: 3.9rem;
        justify-content: center;
        margin-right: -0.6rem;
        overflow: hidden;
        width: 3rem;

        &:last-child {
            margin-right: 0;
        }

        @media (max-width: 767.98px) {
            height: 3.25rem;
            width: 2.5rem;
        }
    }

    /* Product photos have a wide white margin; cropping it makes the bottle readable at this size. */
    & img {
        height: 135%;
        max-width: none;
        width: auto;
    }
}

.homepage-budget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.homepage-budget-links {
    list-style: none;
    margin: 0;
    padding: 0;

    & a {
        align-items: center;
        border-top: 1px solid rgba(var(--logo-color-rgb), 0.18);
        color: var(--bs-body-color);
        display: grid;
        gap: 0.6rem;
        grid-template-columns: minmax(0, 1fr) auto auto;
        padding: 0.7rem 0.1rem;
        text-decoration: none;
    }

    & li:first-child a {
        border-top: 0;
    }

    & a:hover .homepage-budget-limit,
    & a:focus-visible .homepage-budget-limit {
        color: #8f3f6b;
    }

    @media (max-width: 767.98px) {
        display: grid;
        gap: 0.5rem;
        grid-template-columns: repeat(3, minmax(0, 1fr));

        & a,
        & li:first-child a {
            background-color: #fff;
            border: 1px solid rgba(var(--logo-color-rgb), 0.35);
            border-radius: 0.75rem;
            gap: 0;
            grid-template-columns: minmax(0, 1fr);
            padding: 0.5rem 0.25rem;
            text-align: center;
        }
    }
}

.homepage-budget-limit {
    font-size: 1.08rem;
    font-weight: 600;
}

.homepage-budget-count {
    color: var(--bs-secondary-color);
    font-size: 0.92rem;

    @media (max-width: 767.98px) {
        font-size: 0.78rem;
    }
}

.homepage-budget-chevron {
    color: var(--logo-color);

    @media (max-width: 767.98px) {
        display: none;
    }
}

/* Six popular perfumes: one row on wide screens, two of three on tablets, and a row to swipe
   through on phones, where six stacked cards would fill several screens. */
.homepage-parfume-grid.detailed-parfume-cards.parfume-card-grid .parfume-horizontal-grid {
    @media (min-width: 768px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

    @media (max-width: 767.98px) {
        grid-auto-columns: 44%;
        grid-auto-flow: column;
        grid-template-columns: none;
    }
}

.homepage-parfume-grid .parfume-horizontal-grid,
.homepage-savings-grid,
.homepage-guides {
    @media (max-width: 767.98px) {
        margin-inline: calc(var(--bs-gutter-x, 1.5rem) * -0.5);
        overflow-x: auto;
        overscroll-behavior-x: contain;
        /* The top padding keeps a focused card's outline from being clipped by the scroll box. */
        padding: 0.25rem calc(var(--bs-gutter-x, 1.5rem) * 0.5) 0.5rem;
        scroll-padding-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
        scroll-snap-type: x mandatory;
        scrollbar-width: none;

        & > * {
            scroll-snap-align: start;
        }
    }
}

/* "Najveće uštede": four cards, a row on wide screens, two rows of two on tablets, a row to swipe on phones. */
.savings-grid.homepage-savings-grid {
    @media (min-width: 768px) and (max-width: 991.98px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (max-width: 767.98px) {
        grid-auto-columns: 44%;
        grid-auto-flow: column;
        grid-template-columns: none;
    }
}

/* "Vodiči za kupnju": the newest guides with their card pictures. */
.homepage-guides {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    /* Block only: on phones the row's negative side margins (above) let it reach the screen edges. */
    margin-block: 0;

    @media (max-width: 767.98px) {
        gap: 1rem;
        grid-auto-columns: 80%;
        grid-auto-flow: column;
        grid-template-columns: none;
    }
}

.homepage-guide {
    color: var(--bs-body-color);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-decoration: none;

    &:hover .homepage-guide-title,
    &:focus-visible .homepage-guide-title {
        color: var(--logo-color);
    }
}

.homepage-guide-image {
    aspect-ratio: 16 / 9;
    border-radius: 0.8rem;
    height: auto;
    margin-bottom: 0.6rem;
    object-fit: cover;
    width: 100%;
}

.homepage-guide-kind {
    color: #8f3f6b;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.homepage-guide-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.homepage-guide-text {
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--bs-secondary-color);
    display: -webkit-box;
    font-size: 0.95rem;
    overflow: hidden;
}
