/* ======================================================
   CUSTOM FEATURED PRODUCTS — FRONT
   Desktop: obraz boczny + lista ofert
   Tablet: slider 2 produkty / slide
   Mobile: slider 1 produkt / slide
   ====================================================== */

.cfp-wrapper {
    width: 100%;
    max-width: none;
}

.cfp-featured-products {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.cfp-product-image {
    flex: 0 0 393px;
    width: 393px;
    min-width: 393px;
    min-height: 595px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.3s ease-in-out;
    border-radius: 250px;
}

.cfp-product-list {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.cfp-product-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) 180px;
    align-items: center;
    gap: 20px;
    padding: 18px;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.cfp-product-item:last-child {
    border-bottom: 0;
}

.cfp-product-item:first-child,
.cfp-product-item:first-child:hover {
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
}

.cfp-product-item:last-child,
.cfp-product-item:last-child:hover {
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}

.cfp-product-item:hover,
.cfp-product-item.active {
    background: #f1ece5;
}

.cfp-product-thumbnail {
    display: none;
}

.fc-card-header-slot,
.cfp-product-desc,
.cfp-product-btn {
    min-width: 0;
}

.cfp-featured-products .card-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* ======================================================
   TITLE
   ====================================================== */

.cfp-product-item .fc-card-header-slot > .card-header > .woocommerce-loop-product__title > a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.22;
    font-size: 1.125rem;
    font-weight: 400;
    text-decoration: none;
    text-align: left;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}

.cfp-product-item .fc-card-header-slot .paese-title-lead {
    display: block !important;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1px;
}

.cfp-product-item .fc-card-header-slot .paese-title-rest {
    display: block !important;
    font-weight: 400;
    line-height: 1.22;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
}


/* ======================================================
   DESCRIPTION
   ====================================================== */

.cfp-product-desc .wp-block-paragraph {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--theme-text-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cfp-product-desc .wp-block-paragraph p {
    margin-bottom: 0;
}


/* ======================================================
   BUTTON
   ====================================================== */

.cfp-product-btn {
    display: flex;
    justify-content: flex-end;
}

.cfp-product-btn .button {
    width: 100%;
    max-width: 160px;
    min-height: var(--theme-button-min-height) !important;
    margin-left: auto;
}


/* ======================================================
   HIDDEN BY DEFAULT
   ====================================================== */

.block-carousel__dots,
.cfp-carousel-buttons {
    display: none;
}


/* ======================================================
   TABLET / SMALL SCREENS — SLIDER
   768px–1199px: 2 produkty widoczne na slide
   ====================================================== */

@media screen and (min-width: 768px) and (max-width: 1199px) {

    .cfp-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .cfp-featured-products {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 0 56px;
        position: relative;
        overflow: visible;
        box-sizing: border-box;
    }

    .cfp-product-image {
        display: none !important;
    }

    .cfp-product-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0;
        padding: 0;
        list-style: none;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        box-sizing: border-box;
    }

    .cfp-product-list::-webkit-scrollbar {
        display: none;
    }

    .cfp-product-item {
        flex: 0 0 calc((100% - 16px) / 2);
        width: calc((100% - 16px) / 2);
        max-width: calc((100% - 16px) / 2);
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
        padding: 16px 0;
        border: 0;
        background: transparent !important;
        box-sizing: border-box;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        cursor: default;
    }

    .cfp-product-item:first-child,
    .cfp-product-item:first-child:hover,
    .cfp-product-item:last-child,
    .cfp-product-item:last-child:hover {
        border-radius: 0;
    }

    .cfp-product-item:hover,
    .cfp-product-item.active {
        background: transparent !important;
    }

    .cfp-product-thumbnail {
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: 360px;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 20px;
    }

    .cfp-product-item .fc-card-header-slot > .card-header > .woocommerce-loop-product__title > a {
        font-size: 1.05rem;
        line-height: 1.22;
    }

    .cfp-product-desc .wp-block-paragraph {
        -webkit-line-clamp: 3;
    }

    .cfp-product-btn {
        margin-top: auto;
        width: 100%;
        justify-content: stretch;
    }

    .cfp-product-btn .button {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .block-carousel__dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 2px;
        margin: 12px auto 0;
        width: fit-content;
    }
}


/* ======================================================
   MOBILE — SLIDER
   <= 767px: 1 produkt widoczny na slide
   ====================================================== */

@media screen and (max-width: 767px) {

    .cfp-wrapper {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .cfp-featured-products {
        display: block;
        width: 100%;
        max-width: 100%;
        padding: 0 42px;
        position: relative;
        overflow: visible;
        box-sizing: border-box;
    }

    .cfp-product-image {
        display: none !important;
    }

    .cfp-product-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: 0;
        padding: 0;
        list-style: none;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        box-sizing: border-box;
    }

    .cfp-product-list::-webkit-scrollbar {
        display: none;
    }

    .cfp-product-item {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
        padding: 16px 0;
        border: 0;
        background: transparent !important;
        box-sizing: border-box;
        scroll-snap-align: start;
        scroll-snap-stop: always;
        cursor: default;
    }

    .cfp-product-item:first-child,
    .cfp-product-item:first-child:hover,
    .cfp-product-item:last-child,
    .cfp-product-item:last-child:hover {
        border-radius: 0;
    }

    .cfp-product-item:hover,
    .cfp-product-item.active {
        background: transparent !important;
    }

    .cfp-product-thumbnail {
        display: block;
        width: 100%;
        max-width: 100%;
        max-height: 320px;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 20px;
    }

    .cfp-product-item .fc-card-header-slot > .card-header > .woocommerce-loop-product__title > a {
        font-size: 1.125rem;
        line-height: 1.22;
    }

    .cfp-product-desc .wp-block-paragraph {
        -webkit-line-clamp: 3;
    }

    .cfp-product-btn {
        margin-top: auto;
        width: 100%;
        justify-content: stretch;
    }

    .cfp-product-btn .button {
        width: 100%;
        max-width: none;
        margin-left: 0;
    }

    .block-carousel__dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 2px;
        margin: 12px auto 0;
        width: fit-content;
    }
}


/* ======================================================
   STACKABLE-LIKE ARROWS — TABLET + MOBILE
   Przyciski poza sliderem, większe i odsunięte od slajdów
   ====================================================== */

@media screen and (max-width: 1199px) {

    .cfp-featured-products {
        position: relative;
        overflow: visible;
    }

    .cfp-carousel-buttons {
        display: block;
        pointer-events: none;
    }

    .cfp-carousel-buttons .stk-block-carousel__button,
    .cfp-carousel-button {
        position: absolute !important;
        top: 50% !important;
        z-index: 20;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;

        padding: 0 !important;
        margin: 0 !important;

        border: 0 !important;
        border-radius: 0 !important;
        outline: 0;
        box-shadow: none !important;

        background: transparent !important;
        background-color: transparent !important;
        color: var(--theme-text-color, #222) !important;

        line-height: 1 !important;
        font-size: 0 !important;

        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;

        transform: translateY(-50%) !important;
        pointer-events: auto;

        opacity: 0.9;
        transition: opacity 0.2s ease, color 0.2s ease;
    }

    .cfp-carousel-buttons .stk-block-carousel__button::before,
    .cfp-carousel-buttons .stk-block-carousel__button::after,
    .cfp-carousel-button::before,
    .cfp-carousel-button::after {
        content: none !important;
        display: none !important;
    }

    .cfp-carousel-buttons .stk-block-carousel__button:hover,
    .cfp-carousel-buttons .stk-block-carousel__button:focus,
    .cfp-carousel-buttons .stk-block-carousel__button:active,
    .cfp-carousel-button:hover,
    .cfp-carousel-button:focus,
    .cfp-carousel-button:active {
        background: transparent !important;
        background-color: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        color: var(--theme-palette-color-1, #ac8a6d) !important;
        opacity: 1;
        transform: translateY(-50%) !important;
    }

    .cfp-carousel-buttons .stk-block-carousel__button:focus-visible,
    .cfp-carousel-button:focus-visible {
        outline: 1px solid currentColor;
        outline-offset: 3px;
    }

    .cfp-carousel-buttons .stk-block-carousel__button svg,
    .cfp-carousel-button svg {
        display: block !important;
        width: 18px !important;
        height: 18px !important;
        fill: currentColor !important;
        color: inherit !important;
        pointer-events: none;
    }

    .cfp-carousel-buttons .stk-block-carousel__button svg path,
    .cfp-carousel-button svg path {
        fill: currentColor !important;
    }

    .cfp-carousel-button--prev,
    .cfp-carousel-buttons .stk-block-carousel__button__prev {
        left: -22px !important;
    }

    .cfp-carousel-button--next,
    .cfp-carousel-buttons .stk-block-carousel__button__next {
        right: -22px !important;
    }

    .cfp-carousel-button.is-disabled,
    .cfp-carousel-buttons .stk-block-carousel__button.is-disabled {
        opacity: 0.25;
        pointer-events: none;
    }
}


/* ======================================================
   DOTS — TABLET + MOBILE
   ====================================================== */

@media screen and (max-width: 1199px) {

    .block-carousel__dots div[role="listitem"] {
        display: inline-block;
        line-height: 0;
    }

    .block-carousel__dot {
        display: flex;
        align-items: center;
        justify-content: center;
        width: max(24px, var(--dot-size, 8px)) !important;
        height: max(24px, var(--dot-size, 8px)) !important;
        position: relative;
        cursor: pointer;
        background-color: transparent;
        border: 0;
        padding: 0;
        margin: 0;
        appearance: none;
        -webkit-appearance: none;
    }

    .block-carousel__dot::before {
        content: "";
        width: 8px;
        height: 8px;
        border: 1px solid var(--theme-palette-color-1, #ac8a6d);
        border-radius: 50%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        transition: all 0.3s ease;
        box-sizing: border-box;
    }

    .block-carousel__dot--active::before {
        background: var(--theme-palette-color-1, #ac8a6d) !important;
        width: 16px;
        height: 16px;
        opacity: 1;
    }

    .block-carousel__dot.is-hidden,
    .block-carousel__dots div[role="listitem"].is-hidden {
        display: none !important;
    }
}


/* ======================================================
   SMALL MOBILE
   ====================================================== */

@media screen and (max-width: 480px) {

    .cfp-featured-products {
        padding: 0 38px;
        overflow: visible;
    }

    .cfp-product-list {
        gap: 12px;
    }

    .cfp-product-thumbnail {
        max-height: 300px;
        border-radius: 18px;
    }

    .cfp-product-item {
        gap: 12px;
        padding: 14px 0;
    }

    .cfp-carousel-button--prev,
    .cfp-carousel-buttons .stk-block-carousel__button__prev {
        left: -18px !important;
    }

    .cfp-carousel-button--next,
    .cfp-carousel-buttons .stk-block-carousel__button__next {
        right: -18px !important;
    }
}