/*
 * product-list-lahoda-4 — category "folder" tiles only, no product grid
 * (see product-list-lahoda-3's identical tile markup/styling, which this
 * mirrors). Wrapper / inner split (same as footer-lahoda-1 / form-lahoda-1 /
 * product-list-lahoda-1): the root stays full-bleed so a future full-width
 * background can be added without touching the centred content.
 */

.product-list-lahoda-4 {
    width: 100%;
    container-type: inline-size;
}

.product-list-lahoda-4__inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: var(--space-7) var(--container-gutter);
}

/* Anchor target (anchorId): clears the sticky header + contact bar. */
.product-list-lahoda-4__categories {
    scroll-margin-top: 140px;
}

.product-list-lahoda-4__heading {
    font-family: var(--font-display);
    color: var(--ink);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin: 0 0 var(--space-6);
}

.product-list-lahoda-4__categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (min-width: 768px) {
    .product-list-lahoda-4__categories {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1080px) {
    .product-list-lahoda-4__categories {
        grid-template-columns: repeat(4, 1fr);
    }
}

/*
 * Fixed column count (editor field "Počet kategórií v riadku"), overriding
 * the 2/3/4-responsive default above. Same convention as
 * product-list-lahoda-3's identical `__categories` grid — see that file's
 * rule for the full rationale.
 */
.product-list-lahoda-4__categories.product-list-lahoda-4__categories--cols-mobile-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@container (min-width: 768px) {
    .product-list-lahoda-4__categories.product-list-lahoda-4__categories--cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .product-list-lahoda-4__categories.product-list-lahoda-4__categories--cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .product-list-lahoda-4__categories.product-list-lahoda-4__categories--cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .product-list-lahoda-4__categories.product-list-lahoda-4__categories--cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.product-list-lahoda-4__category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
    color: inherit;
    padding: var(--space-2) var(--space-2) var(--space-3);
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.product-list-lahoda-4__category-link:not(
        .product-list-lahoda-4__category-link--static
    ):hover,
.product-list-lahoda-4__category-link:not(
        .product-list-lahoda-4__category-link--static
    ):focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 6px 18px rgba(42, 33, 26, 0.12));
}

.product-list-lahoda-4__category-link--static {
    cursor: default;
}

/* The tile whose link matches the page currently being viewed — set
 * server-side in component.php, not a click/filter state. */
.product-list-lahoda-4__category-link.is-active {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 1px var(--brand-red);
}

.product-list-lahoda-4__category-photo {
    display: block;
    width: 100%;
    /* 3:2 rather than square — keeps a row of tiles compact so the section
       doesn't push the content below it out of the first viewport. */
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: var(--radius-sm, var(--radius));
}

.product-list-lahoda-4__category-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-list-lahoda-4__category-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.25;
    color: var(--ink);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-list-lahoda-4__category-link.is-active .product-list-lahoda-4__category-name {
    color: var(--brand-red);
}

/* Active tile: the name bar becomes a red pill with a leading check mark, so
   the current category is unmistakable (brief 09). */
.product-list-lahoda-4__category-link.is-active .product-list-lahoda-4__category-name {
    align-self: stretch;
    background: var(--brand-red);
    color: var(--bg-cream);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-3);
}

.product-list-lahoda-4__category-link.is-active
    .product-list-lahoda-4__category-name::before,
.product-list-lahoda-4--landing
    .product-list-lahoda-4__category-link.is-active
    .product-list-lahoda-4__category-overlay::before {
    content: "✓\00a0";
    /* Decorative: empty alt text keeps it out of the accessible name where supported. */
    content: "✓\00a0" / "";
}

/* Image-less tile: warm tint + big initial (both variants). */
.product-list-lahoda-4__category-photo {
    position: relative;
}

.product-list-lahoda-4__category-photo--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-gold-tint);
}

.product-list-lahoda-4__category-initial {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    line-height: 1;
    color: var(--brand-gold);
}

.product-list-lahoda-4__category-tagline {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--ink-muted);
    text-align: center;
}

/* Hover: photo zoom + warm shadow. */
.product-list-lahoda-4__category-link {
    transition:
        transform 200ms ease,
        box-shadow 200ms ease,
        border-color 200ms ease;
}

.product-list-lahoda-4__category-link:not(
        .product-list-lahoda-4__category-link--static
    ):hover,
.product-list-lahoda-4__category-link:not(
        .product-list-lahoda-4__category-link--static
    ):focus-visible {
    box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {
    .product-list-lahoda-4__category-link {
        transition: none;
    }
}

/*
 * Phone compact rows (grid variant only, below 768px). The home page lists
 * 6 + 8 categories; two columns of photo tiles with name + tagline ran
 * ~1 500px on a phone. Each tile becomes a short row — round 44px thumbnail
 * beside the name, tagline dropped — still two per row, so both lists fit
 * in roughly one screen. Tablet and desktop keep the full tile; the
 * `is-active` pill (brief 09) keeps working inline; `--landing` is excluded.
 */
@container (max-width: 767.98px) {
    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__categories {
        gap: var(--space-2);
    }

    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__category-link {
        flex-direction: row;
        align-items: center;
        gap: var(--space-3);
        min-height: 60px;
        padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
    }

    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__category-photo {
        width: 44px;
        flex: 0 0 44px;
        aspect-ratio: 1 / 1;
        border-radius: 50%;
    }

    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__category-initial {
        font-size: 1.375rem;
    }

    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__category-name {
        font-size: 0.875rem;
        text-align: left;
    }

    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__category-link.is-active
        .product-list-lahoda-4__category-name {
        align-self: center;
        padding: 2px var(--space-2);
    }

    .product-list-lahoda-4:not(.product-list-lahoda-4--landing)
        .product-list-lahoda-4__category-tagline {
        display: none;
    }
}

/* ---- variant "landing": 2 per row, 16:9 photo, overlaid name, CTA pill ---- */
.product-list-lahoda-4__category-overlay,
.product-list-lahoda-4__category-cta {
    display: none;
}

.product-list-lahoda-4--landing .product-list-lahoda-4__categories {
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

@media (min-width: 768px) {
    .product-list-lahoda-4--landing .product-list-lahoda-4__categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.product-list-lahoda-4--landing .product-list-lahoda-4__category-link {
    padding: var(--space-2) var(--space-2) var(--space-4);
    gap: var(--space-3);
}

.product-list-lahoda-4--landing .product-list-lahoda-4__category-photo {
    aspect-ratio: 16 / 9;
}

.product-list-lahoda-4--landing .product-list-lahoda-4__category-overlay {
    display: flex;
    align-items: flex-end;
    position: absolute;
    inset: 0;
    padding: var(--space-4);
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    line-height: 1.1;
    color: var(--bg-cream);
    background: linear-gradient(to top, var(--ink-surface), transparent 65%);
    pointer-events: none;
}

/* The overlay carries the name visually; keep the plain name for screen readers only. */
.product-list-lahoda-4--landing .product-list-lahoda-4__category-name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.product-list-lahoda-4--landing
    .product-list-lahoda-4__category-link.is-active
    .product-list-lahoda-4__category-name {
    color: inherit;
    background: none;
    padding: 0;
    border-radius: 0;
}

.product-list-lahoda-4--landing .product-list-lahoda-4__category-tagline {
    font-size: 0.9375rem;
    padding: 0 var(--space-2);
}

.product-list-lahoda-4--landing .product-list-lahoda-4__category-cta {
    display: inline-block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--brand-red);
    color: var(--bg-cream);
}
