/* Fairline home categories — desktop photo tiles / mobile icons */

.fl-hc {
    margin: 16px 0 8px;
    padding: 0;
    --fl-hc-radius: 12px;
    --fl-hc-green: #2e3b23;
    --fl-hc-accent: #e07030;
    --fl-hc-border: rgba(46, 59, 35, 0.12);
}

.fl-hc__inner {
    position: relative;
    padding: 0;
}

.fl-hc__swiper {
    overflow: hidden;
}

.fl-hc__swiper .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

.fl-hc-nav {
    position: absolute;
    top: 50%;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(200, 200, 200, 0.72);
    color: #fff;
    box-shadow: none;
    cursor: pointer;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.fl-hc-nav:hover,
.fl-hc-nav:focus {
    background: rgba(180, 180, 180, 0.88);
    outline: none;
}

.fl-hc-nav:active {
    background: rgba(160, 160, 160, 0.92);
}

.fl-hc-nav--prev {
    left: 0;
}

.fl-hc-nav--next {
    right: 0;
}

.fl-hc-nav__icon {
    display: block;
    width: 14px;
    height: 14px;
}

@media (min-width: 768px) and (hover: hover) {
    .fl-hc-nav {
        opacity: 0;
        pointer-events: none;
    }

    .fl-hc__inner:hover .fl-hc-nav,
    .fl-hc__inner:focus-within .fl-hc-nav {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ——— Desktop: full photo tiles, width from Swiper ——— */
.fl-hc-card {
    position: relative;
    display: block;
    width: 100%;
    border-radius: var(--fl-hc-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--fl-hc-green);
    background: transparent;
    box-shadow: none;
    box-sizing: border-box;
    container-type: inline-size;
    container-name: fl-hc-card;
}

.fl-hc-card__icon {
    display: none;
}

.fl-hc-card__label {
    display: none;
}

/* Title + thin rule + small subtitle under baked icon (desktop photos) */
.fl-hc-card__caption {
    position: absolute;
    left: 7.5%;
    top: 25%; /* overridden per item via inline style (caption_top) */
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 78%;
    margin: 0;
    padding: 0;
    color: var(--fl-hc-green);
    pointer-events: none;
    font-family: Ubuntu, "Segoe UI", sans-serif;
}

.fl-hc-card__caption-title {
    display: block;
    margin: 0;
    font-size: clamp(12px, 8cqi, 18px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: pre-line;
}

.fl-hc-card__caption-line {
    display: block;
    width: 1.65em;
    height: 1.5px;
    margin: 0.45em 0 0.42em;
    background: currentColor;
    opacity: 0.95;
}

.fl-hc-card__caption-sub {
    display: block;
    margin: 0;
    font-size: clamp(8px, 4.35cqi, 11px);
    font-weight: 400;
    line-height: 1.22;
    letter-spacing: 0;
    text-transform: none;
    white-space: pre-line;
    opacity: 0.98;
}

/* Sale tile still has baked text — no HTML caption */
.fl-hc-card--accent .fl-hc-card__caption {
    display: none;
}

/* Desktop: hide Акції slide (old baked photo); mobile keeps SVG icon */
@media (min-width: 768px) {
    .fl-hc__swiper .swiper-slide:has(.fl-hc-card--accent) {
        display: none !important;
        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
        border: 0;
    }
}

.fl-hc-card__visual {
    display: block;
    width: 100%;
    line-height: 0;
}

.fl-hc-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--fl-hc-radius);
}

.fl-hc-img--mobile {
    display: none !important;
}

.fl-hc-img--desktop {
    display: block;
}

.fl-hc-card--icon:not(.fl-hc-card--img) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    padding: 20px 14px;
    border: 1px solid var(--fl-hc-border);
    border-radius: var(--fl-hc-radius);
    background: #fff;
}

.fl-hc-card--icon:not(.fl-hc-card--img) .fl-hc-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    color: inherit;
    line-height: 0;
}

.fl-hc-card--icon:not(.fl-hc-card--img) .fl-hc-card__icon svg {
    display: block;
    width: 56px;
    height: 56px;
}

.fl-hc-card--icon:not(.fl-hc-card--img) .fl-hc-card__label {
    display: block;
    text-align: center;
    font-family: Ubuntu, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
}

.fl-hc-card--accent {
    color: var(--fl-hc-accent);
}

/* ——— Mobile ONLY ——— */
@media (max-width: 767px) {
    .fl-hc {
        --fl-hc-radius: 10px;
        --fl-hc-icon: 42px;
        --fl-hc-card: 76px;
        margin: 10px 0 2px;
        padding: 0;
    }

    .fl-hc__inner {
        padding: 0;
    }

    /* Side strokes (nav) — tall bars over edges */
    .fl-hc-nav {
        width: 16px;
        height: 70%;
        min-height: 52px;
        max-height: 78px;
        border-radius: 3px;
        background: rgba(180, 180, 180, 0.55);
        opacity: 1;
        pointer-events: auto;
    }

    .fl-hc-nav:hover,
    .fl-hc-nav:focus {
        background: rgba(160, 160, 160, 0.72);
    }

    .fl-hc-nav__icon {
        width: 10px;
        height: 10px;
    }

    .fl-hc__swiper .swiper-slide {
        width: auto;
        height: auto;
        display: flex;
    }

    .fl-hc-card,
    .fl-hc-card--icon:not(.fl-hc-card--img) {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        width: var(--fl-hc-card);
        height: var(--fl-hc-card);
        min-height: var(--fl-hc-card);
        max-height: var(--fl-hc-card);
        padding: 6px 4px 4px;
        gap: 0;
        border: 1px solid var(--fl-hc-border);
        border-radius: var(--fl-hc-radius);
        background: #fff;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* Full baked mobile tiles (icon + text in PNG) — CSS radius clips corner artifacts */
    .fl-hc-card--img:has(.fl-hc-img--mobile) {
        padding: 0;
        border: 0;
        background: #faf8f5;
        justify-content: center;
        overflow: hidden;
        border-radius: var(--fl-hc-radius);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    /* Full-width icon band (SVG fallback / legacy) */
    .fl-hc-card__icon,
    .fl-hc-card__visual {
        flex: 0 0 var(--fl-hc-icon);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: var(--fl-hc-icon);
        margin: 0;
        overflow: hidden;
        border-radius: 0;
        background: transparent;
        line-height: 0;
        color: inherit;
    }

    .fl-hc-card--img:has(.fl-hc-img--mobile) .fl-hc-card__visual {
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        max-height: none;
        overflow: hidden;
        border-radius: inherit;
    }

    .fl-hc-card__icon svg {
        display: block;
        width: 34px;
        height: 34px;
    }

    .fl-hc-img {
        border-radius: 0;
    }

    .fl-hc-img--desktop {
        display: none !important;
    }

    .fl-hc-img--mobile {
        display: block !important;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    .fl-hc-card--img:has(.fl-hc-img--mobile) .fl-hc-img--mobile {
        border-radius: 0;
        /* slight zoom so any leftover baked corner fringe is clipped by card radius */
        -webkit-transform: scale(1.04);
        transform: scale(1.04);
        -webkit-transform-origin: center center;
        transform-origin: center center;
    }

    .fl-hc-card--img .fl-hc-card__icon {
        display: none !important;
    }

    .fl-hc-card--img .fl-hc-card__visual {
        display: flex !important;
    }

    .fl-hc-card--icon:not(.fl-hc-card--img) .fl-hc-card__icon,
    .fl-hc-card--icon.fl-hc-card--img:not(:has(.fl-hc-img--mobile)) .fl-hc-card__icon {
        display: flex !important;
    }

    .fl-hc-card--icon.fl-hc-card--img:not(:has(.fl-hc-img--mobile)) .fl-hc-card__visual {
        display: none !important;
    }

    .fl-hc-card__caption {
        display: none !important;
    }

    .fl-hc-card__label {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        flex: 1 1 auto;
        width: 100%;
        margin-top: 3px;
        min-height: calc(9px * 1.2 * 2);
        text-align: center;
        font-family: Ubuntu, "Segoe UI", sans-serif;
        font-size: 9px;
        font-weight: 600;
        line-height: 1.2;
        color: inherit;
    }

    /* Text is baked into mobile PNGs — hide HTML label */
    .fl-hc-card--img:has(.fl-hc-img--mobile) .fl-hc-card__label {
        display: none !important;
    }
}

/* 400–767: cards fill slide (N per view from Swiper) */
@media (min-width: 400px) and (max-width: 767px) {
    .fl-hc {
        --fl-hc-icon: clamp(28px, 52%, 42px);
    }

    .fl-hc-card,
    .fl-hc-card--icon:not(.fl-hc-card--img) {
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: 1 / 1;
    }

    .fl-hc-card__icon svg {
        width: clamp(24px, 70%, 34px);
        height: clamp(24px, 70%, 34px);
    }
}
