/* =========================================================
   MOBILE PRODUCT UI
   Compact layout + correct order (Blocksy SAFE)
========================================================= */

@media (max-width: 1024px) {

    /* =====================================================
       0. GLOBALNE ZMIENNE
    ===================================================== */

    body.has-mobile-product-ui {
        --fc-edrone-bottom-offset: 0px;
        --fc-mobile-summary-height: 82px;
        --fc-mobile-safe-gap: 8px;
    }

    /* =====================================================
       0. GŁÓWNY WRAPPER
    ===================================================== */

    body.has-mobile-product-ui.single-product .product-entry-wrapper {
        display: flex !important;
        flex-direction: column;
        gap: 0;
    }

    /* =====================================================
       0.1 MOBILE BREADCRUMBS — AUTO COMPACT
    ===================================================== */

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact {
        display: flex !important;
        align-items: center;
        flex-wrap: nowrap;
        gap: 5px;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        white-space: nowrap;
        font-size: 12px;
        line-height: 1.3;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact > * {
        flex: 0 0 auto;
        min-width: 0;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact a {
        color: inherit;
        text-decoration: none;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-home,
    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-home a {
        display: inline-flex;
        align-items: center;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .ct-home-icon {
        width: 13px;
        height: 13px;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-separator {
        flex: 0 0 auto;
        opacity: 0.55;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-dots {
        appearance: none;
        -webkit-appearance: none;
        flex: 0 0 auto;
        border: 0;
        background: transparent;
        padding: 0;
        margin: 0;
        font: inherit;
        color: inherit;
        line-height: inherit;
        cursor: pointer;
        opacity: 0.65;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-dots:hover {
        opacity: 1;
        text-decoration: underline;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-category {
        display: inline-block;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-compact .fc-mobile-breadcrumb-current {
        display: inline-block;
        flex: 1 1 auto;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.single-product .hero-section .ct-breadcrumbs.fc-mobile-breadcrumbs-expanded {
        white-space: normal;
        overflow: visible;
    }

    /* =====================================================
       0.2 PRODUCT CARD TITLE — NIE SKRACAJ TYTUŁU
    ===================================================== */

    .fc-card-header-slot .woocommerce-loop-product__title,
    .fc-card-header-slot .woocommerce-loop-product__title a,
    .fc-card-header-slot .woocommerce-loop-product__title .paese-title-lead,
    .fc-card-header-slot .woocommerce-loop-product__title .paese-title-rest {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-height: none !important;
        -webkit-line-clamp: unset !important;
        line-clamp: unset !important;
        -webkit-box-orient: unset !important;
    }

    .fc-card-header-slot .woocommerce-loop-product__title a {
        display: block !important;
    }

    .fc-card-header-slot .woocommerce-loop-product__title .paese-title-lead,
    .fc-card-header-slot .woocommerce-loop-product__title .paese-title-rest {
        display: inline !important;
    }

    /* =====================================================
       KOLEJNOŚĆ GŁÓWNYCH BLOKÓW
    ===================================================== */

    .fc-gallery-wrap {
        order: 1;
    }

    .summary {
        order: 2;
    }

    .woocommerce-tabs {
        order: 6;
    }

    .ct-product-additional-info {
        order: 7;
    }

    .ct-payment-methods {
        order: 8;
    }

    /* =====================================================
       SUMMARY – UKŁAD WEWNĘTRZNY
    ===================================================== */

    .summary {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .summary h1,
    .summary p,
    .summary .woocommerce-loop-product__rating,
    .summary .paese-product-capacity {
        margin: 0;
    }

    .summary .product_title {
        order: 1;
        margin-bottom: 4px;
    }

    .summary .paese-product-capacity {
        order: 2;
    }

    .summary .woocommerce-loop-product__rating {
        order: 3;
    }

    .summary .woocommerce-product-details__short-description {
        order: 4;
    }

    /* =====================================================
       TABS – MNIEJSZE ODSTĘPY
    ===================================================== */

    .woocommerce-tabs {
        margin-top: 6px;
    }

    .woocommerce-tabs .tabs {
        margin-bottom: 6px;
    }

    .woocommerce-tabs .panel {
        margin-top: 6px;
    }

    /* =====================================================
       ADDITIONAL INFO + PAYMENT – KOMPAKT
    ===================================================== */

    .ct-product-additional-info,
    .ct-payment-methods {
        margin-top: 6px;
    }

    /* =====================================================
       1. USUWAMY DOMYŚLNE CENY WOO
    ===================================================== */

    .single_variation .woocommerce-variation-price {
        display: none !important;
    }

    .summary > .price {
        display: none !important;
    }

    /* =====================================================
       2. UKRYWAMY SELECT GDY SĄ SWATCHE
    ===================================================== */

    .variations_form .value:has(.fc-swatches) select {
        display: none !important;
    }

    .variations_form .value .fc-swatches ~ select {
        display: none !important;
    }

    /* =====================================================
       3. STICKY SUMMARY BAR
       Układ:
       [cena]  [swatche]
       [ilość] [CTA]
    ===================================================== */

    .fc-mobile-summary-bar {
        position: fixed;
        /*bottom: calc(var(--fc-edrone-bottom-offset) + var(--fc-mobile-safe-gap));*/
        bottom: 0;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: minmax(118px, 0.9fr) minmax(0, 1.35fr);
        grid-template-areas:
            "price swatches"
            "qty   cta";
        gap: 6px 8px;
        align-items: center;
        background: #ffffff;
        padding: 7px 10px;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .06);
        z-index: 9998;
        transition:
                transform .22s ease,
                opacity .22s ease,
                visibility .22s ease;
        will-change: transform;
    }

    body.has-mobile-summary-bar {
        padding-bottom: calc(
                var(--fc-mobile-summary-height) +
                var(--fc-edrone-bottom-offset) +
                var(--fc-mobile-safe-gap) +
                env(safe-area-inset-bottom)
        );
    }

    body.fc-mobile-summary-footer-visible .fc-mobile-summary-bar {
        transform: translateY(calc(100% + var(--fc-edrone-bottom-offset) + 24px));
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    body.fc-mobile-summary-footer-visible.has-mobile-summary-bar {
        padding-bottom: calc(
                var(--fc-edrone-bottom-offset) +
                var(--fc-mobile-safe-gap) +
                env(safe-area-inset-bottom)
        );
    }

    /* =====================================================
       3.1 WYPŁASZCZENIE STRUKTURY FORMULARZA
    ===================================================== */

    .fc-mobile-summary-bar .fc-ms-price,
    .fc-mobile-summary-bar .fc-ms-cart,
    .fc-mobile-summary-bar .ct-product-add-to-cart,
    .fc-mobile-summary-bar .variations_form.cart,
    .fc-mobile-summary-bar .single_variation_wrap,
    .fc-mobile-summary-bar .woocommerce-variation-add-to-cart,
    .fc-mobile-summary-bar .ct-cart-actions {
        display: contents;
    }

    /* =====================================================
       4. CENA – LEWA GÓRNA KOLUMNA
       Omnibus i cena jednostkowa zostają widoczne.
    ===================================================== */

    .fc-mobile-summary-bar .fc-summary-price,
    .fc-mobile-summary-bar .fc-price,
    .fc-mobile-summary-bar .woocommerce-variation-price {
        grid-area: price;
        min-width: 0;
    }

    .fc-mobile-summary-bar .fc-price {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }

    .fc-mobile-summary-bar .fc-price-main,
    .fc-mobile-summary-bar .sale-price {
        display: block;
        min-width: 0;
        font-size: 12px;
        line-height: 1.05;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fc-mobile-summary-bar .woocommerce-Price-amount {
        font-size: inherit;
        line-height: inherit;
        font-weight: inherit;
    }

    .fc-mobile-summary-bar del {
        font-size: 10px;
        opacity: .55;
    }

    .fc-mobile-summary-bar ins {
        text-decoration: none;
    }

    .fc-mobile-summary-bar .fc-omnibus-notice,
    .fc-mobile-summary-bar .fc-card-unit-price {
        display: block !important;
        margin: 0;
        padding: 0;
        max-width: 100%;
        font-size: 8.5px;
        line-height: 1.15;
        opacity: .78;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fc-mobile-summary-bar .fc-omnibus-notice strong,
    .fc-mobile-summary-bar .fc-card-unit-price .woocommerce-Price-amount {
        font-size: inherit;
        line-height: inherit;
        font-weight: 600;
    }

    .fc-mobile-summary-bar .woocommerce-variation-description,
    .fc-mobile-summary-bar .woocommerce-variation-availability,
    .fc-mobile-summary-bar .single_variation,
    .fc-mobile-summary-bar .reset_variations,
    .fc-mobile-summary-bar .reset_variations_alert {
        display: none !important;
    }

    /* =====================================================
       5. SWATCHE – PRAWA GÓRNA KOLUMNA
    ===================================================== */

    .fc-mobile-summary-bar .variations {
        grid-area: swatches;
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0;
        align-self: center;
    }

    .fc-mobile-summary-bar .variations tbody,
    .fc-mobile-summary-bar .variations tr,
    .fc-mobile-summary-bar .variations th,
    .fc-mobile-summary-bar .variations td {
        display: block;
        width: 100%;
        padding: 0;
        margin: 0;
        border: 0;
    }

    .fc-mobile-summary-bar .variations .label {
        display: none !important;
    }

    .fc-mobile-summary-bar .variations .value {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .fc-mobile-summary-bar .fc-swatches {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 5px;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 3px 2px;
        margin: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .fc-mobile-summary-bar .fc-swatches::-webkit-scrollbar {
        display: none;
    }

    .fc-mobile-summary-bar .fc-swatch {
        flex: 0 0 auto;
        width: 17px;
        height: 17px;
        min-width: 17px;
        min-height: 17px;
        margin: 0;
        border-radius: 999px;
    }

    .fc-mobile-summary-bar .fc-swatch.is-active {
        outline: 1px solid #222222;
        outline-offset: 2px;
    }

    /* =====================================================
       6. ILOŚĆ – LEWA DOLNA KOLUMNA
       Poprawione wyśrodkowanie + i -.
    ===================================================== */

    .fc-mobile-summary-bar .quantity {
        grid-area: qty;
        position: relative;
        display: grid !important;
        grid-template-columns: 24px minmax(0, 1fr) 24px;
        align-items: center;
        width: 100%;
        min-width: 0;
        height: 32px;
        min-height: 32px;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden;
    }

    .fc-mobile-summary-bar .quantity input {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        height: 32px;
        min-height: 32px;
        margin: 0;
        padding: 0 24px !important;
        font-size: 12px;
        line-height: 32px;
        text-align: center;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease,
    .fc-mobile-summary-bar .quantity .ct-increase {
        position: relative;
        z-index: 2;
        grid-row: 1;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 24px !important;
        height: 32px !important;
        min-width: 24px;
        min-height: 32px;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
        cursor: pointer;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease {
        grid-column: 1;
    }

    .fc-mobile-summary-bar .quantity .ct-increase {
        grid-column: 3;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease::before,
    .fc-mobile-summary-bar .quantity .ct-decrease::after,
    .fc-mobile-summary-bar .quantity .ct-increase::before,
    .fc-mobile-summary-bar .quantity .ct-increase::after {
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        margin: 0 !important;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease::before,
    .fc-mobile-summary-bar .quantity .ct-increase::before {
        display: block !important;
        line-height: 1 !important;
    }

    /* =====================================================
       7. CTA – PRAWA DOLNA KOLUMNA
    ===================================================== */

    .fc-mobile-summary-bar .single_add_to_cart_button {
        grid-area: cta;
        width: 100%;
        min-height: 32px;
        height: 32px;
        padding: 0 12px;
        font-size: 11px;
        line-height: 32px;
        white-space: nowrap;
    }

    /* =====================================================
       8. IKONY PŁATNOŚCI
    ===================================================== */

    .ct-payment-methods .ct-icon-container svg {
        width: auto;
        height: 20px;
    }

}


/* =========================================================
   DESKTOP – BRAK ZMIAN
========================================================= */

@media (min-width: 1025px) {

    .fc-mobile-summary-bar {
        position: static;
        box-shadow: none;
    }

}

/* =========================================================
   MOBILE PRODUCT UI — FINALNE WYRÓWNANIE STICKY BAR
   - trochę wyższy pasek
   - więcej miejsca dla swatchy
   - cena przyklejona do góry
   - kolor wyrównany do prawej
========================================================= */

@media (max-width: 1024px) {

    body.has-mobile-product-ui {
        --fc-mobile-summary-height: 88px;
    }

    .fc-mobile-summary-bar {
        grid-template-columns: minmax(112px, 0.85fr) minmax(0, 1.5fr);
        grid-template-areas:
            "price swatches"
            "qty   cta";
        align-items: start;
        gap: 6px 10px;
        padding: 8px 10px 9px;
        min-height: 78px;
    }

    /* Cena — lewa góra */
    .fc-mobile-summary-bar .fc-summary-price,
    .fc-mobile-summary-bar .fc-price,
    .fc-mobile-summary-bar .woocommerce-variation-price {
        align-self: start;
        justify-self: start;
        margin: 0 !important;
        padding: 0 !important;
        min-width: 0;
    }

    .fc-mobile-summary-bar .fc-price {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }

    .fc-mobile-summary-bar .fc-price-main,
    .fc-mobile-summary-bar .sale-price {
        font-size: 13px;
        line-height: 1.05;
        font-weight: 600;
        white-space: nowrap;
    }

    .fc-mobile-summary-bar del {
        font-size: 10px;
        line-height: 1;
    }

    .fc-mobile-summary-bar .fc-omnibus-notice,
    .fc-mobile-summary-bar .fc-card-unit-price {
        margin: 0;
        padding: 0;
        font-size: 8.5px;
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Prawa góra — swatche + nazwa koloru */
    .fc-mobile-summary-bar .variations {
        align-self: start;
        justify-self: stretch;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }

    .fc-mobile-summary-bar .variations tbody,
    .fc-mobile-summary-bar .variations tr,
    .fc-mobile-summary-bar .variations th,
    .fc-mobile-summary-bar .variations td {
        display: block;
        width: 100%;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
    }

    .fc-mobile-summary-bar .variations .label {
        display: none !important;
    }

    .fc-mobile-summary-bar .variations .value {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible;
        text-align: right;
    }

    .fc-mobile-summary-bar .fc-swatches {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        margin: 0 !important;
        padding: 4px 4px 4px !important;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .fc-mobile-summary-bar .fc-swatches::-webkit-scrollbar {
        display: none;
    }

    .fc-mobile-summary-bar .fc-swatch {
        flex: 0 0 auto;
        width: 19px;
        height: 19px;
        min-width: 19px;
        min-height: 19px;
        margin: 0 !important;
    }

    .fc-mobile-summary-bar .fc-swatch.is-active {
        outline: 1px solid #222222;
        outline-offset: 2px;
    }

    .fc-mobile-summary-bar .fc-mobile-selected-swatch-name {
        display: block !important;
        width: 100%;
        max-width: 100%;
        margin: 1px 1px 0 0 !important;
        padding: 0 !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        line-height: 1.15;
        text-align: right;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: .75;
    }

    .fc-mobile-summary-bar .fc-mobile-selected-swatch-name-row {
        display: none !important;
    }

    /* Dolny rząd — ilość + CTA */
    .fc-mobile-summary-bar .quantity {
        align-self: end;
        height: 32px;
        min-height: 32px;
        margin: 0 !important;
    }

    .fc-mobile-summary-bar .quantity input {
        height: 32px;
        min-height: 32px;
        line-height: 32px;
        font-size: 12px;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease,
    .fc-mobile-summary-bar .quantity .ct-increase {
        height: 32px !important;
        min-height: 32px;
    }

    .fc-mobile-summary-bar .single_add_to_cart_button {
        align-self: end;
        width: 100%;
        height: 32px;
        min-height: 32px;
        margin: 0 !important;
        padding: 0 12px;
        font-size: 10.5px;
        line-height: 32px;
        white-space: nowrap;
    }

    .fc-mobile-summary-bar .reset_variations,
    .fc-mobile-summary-bar .reset_variations_alert {
        display: none !important;
    }
}

/* =========================================================
   MOBILE PRODUCT UI — POPRAWA PRZYCISKÓW W STICKY BAR
   - ukrycie "Zobacz koszyk"
   - równe wysokości
   - lepsze wyrównanie ilości i CTA
========================================================= */

@media (max-width: 1024px) {

    /* Ukrywamy link "Zobacz koszyk", bo rozbija układ sticky bara */
    /*
     * Back in stock: JS oznacza natywne elementy zakupowe tą klasą.
     * !important jest konieczne, bo mobilny CTA ma wymuszone display:flex.
     */
    body .fc-mobile-summary-bar .paese-bis-hidden-buy-element {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Przycisk powiadomienia zastępuje CTA w tej samej komórce siatki. */
    .fc-mobile-summary-bar .paese-bis-add-to-cart-slot {
        grid-area: cta;
        display: block;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .fc-mobile-summary-bar .paese-bis-add-to-cart-slot .paese-bis-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 34px;
        min-height: 34px;
        margin: 0 !important;
        padding: 0 12px !important;
        border-radius: 7px;
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }

    .fc-mobile-summary-bar .added_to_cart,
    .fc-mobile-summary-bar .added_to_cart.wc-forward,
    .fc-mobile-summary-bar a.added_to_cart {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Dolny rząd sticky bara */
    .fc-mobile-summary-bar .ct-cart-actions {
        display: contents !important;
    }

    /* Ilość */
    .fc-mobile-summary-bar .quantity {
        grid-area: qty;
        display: grid !important;
        grid-template-columns: 26px minmax(0, 1fr) 26px;
        align-items: center;
        width: 100%;
        height: 34px;
        min-height: 34px;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 7px;
        overflow: hidden;
    }

    .fc-mobile-summary-bar .quantity input {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        height: 34px;
        min-height: 34px;
        padding: 0 26px !important;
        font-size: 11px;
        line-height: 34px;
        text-align: center;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease,
    .fc-mobile-summary-bar .quantity .ct-increase {
        position: relative;
        z-index: 2;
        grid-row: 1;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 26px !important;
        height: 34px !important;
        min-width: 26px !important;
        min-height: 34px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease {
        grid-column: 1;
    }

    .fc-mobile-summary-bar .quantity .ct-increase {
        grid-column: 3;
    }

    /* Przycisk KUP TERAZ */
    .fc-mobile-summary-bar .single_add_to_cart_button {
        grid-area: cta;
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 34px;
        min-height: 34px;
        margin: 0 !important;
        padding: 0 12px !important;
        border-radius: 7px;
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
    }

    /* Stan po dodaniu do koszyka — przycisk nie może zmieniać rozmiaru */
    .fc-mobile-summary-bar .single_add_to_cart_button.added,
    .fc-mobile-summary-bar .single_add_to_cart_button.loading {
        width: 100%;
        height: 34px;
        min-height: 34px;
        padding: 0 12px !important;
    }

    .fc-mobile-summary-bar .single_add_to_cart_button.loading::after,
    .fc-mobile-summary-bar .single_add_to_cart_button.added::after {
        display: none !important;
    }

    /* Usunięcie zbędnych marginesów Woo/Blocksy */
    .fc-mobile-summary-bar .woocommerce-variation-add-to-cart,
    .fc-mobile-summary-bar .ct-cart-actions,
    .fc-mobile-summary-bar .cart {
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }
}

/* =========================================================
   MOBILE STICKY BUY BAR – UKŁAD PRODUKCYJNY
   Rząd 1: cena | warianty przewijane poziomo
   Rząd 2: ilość | dodaj do koszyka
========================================================= */

@media (max-width: 1024px) {
    body.has-mobile-product-ui {
        --fc-mobile-summary-height: 108px;
    }

    .fc-mobile-summary-bar {
        grid-template-columns: minmax(104px, 34%) minmax(0, 1fr) !important;
        grid-template-areas:
            "price swatches"
            "qty cta" !important;
        align-items: center !important;
        gap: 10px 12px !important;
        min-height: 96px !important;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
        border-top: 1px solid var(--theme-border-color, rgba(0, 0, 0, .12));
        background: var(--theme-palette-color-8, #fff) !important;
        box-shadow: 0 -8px 24px rgba(24, 24, 24, .10) !important;
    }

    .fc-mobile-summary-bar .fc-ms-price {
        grid-area: price !important;
        display: block !important;
        align-self: center !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .fc-mobile-summary-bar .fc-summary-price {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .fc-mobile-summary-bar .fc-summary-price:empty {
        min-height: 24px;
    }

    .fc-mobile-summary-bar .fc-price-main,
    .fc-mobile-summary-bar .sale-price {
        display: block !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .fc-mobile-summary-bar .variations {
        position: relative !important;
        grid-area: swatches !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .fc-mobile-summary-bar .variations::after {
        content: "";
        position: absolute;
        z-index: 3;
        top: 0;
        right: 0;
        bottom: 0;
        width: 22px;
        pointer-events: none;
        background: linear-gradient(90deg, transparent, var(--theme-palette-color-8, #fff));
    }

    .fc-mobile-summary-bar .variations tbody {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 4px 18px 4px 2px !important;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .fc-mobile-summary-bar .variations tbody::-webkit-scrollbar {
        display: none;
    }

    .fc-mobile-summary-bar .variations tr {
        display: block !important;
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: min(100%, 280px) !important;
        scroll-snap-align: start;
    }

    .fc-mobile-summary-bar .variations th.label {
        display: none !important;
    }

    .fc-mobile-summary-bar .variations td.value {
        display: block !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .fc-mobile-summary-bar .fc-swatches {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: max-content !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 3px !important;
        overflow: visible !important;
    }

    .fc-mobile-summary-bar .fc-swatch {
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        border: 1px solid var(--theme-border-color, rgba(0, 0, 0, .18));
        border-radius: 50% !important;
        scroll-snap-align: center;
    }

    .fc-mobile-summary-bar .fc-swatch.is-active {
        outline: 2px solid var(--theme-palette-color-1, currentColor) !important;
        outline-offset: 2px !important;
    }

    .fc-mobile-summary-bar .variations select {
        width: auto !important;
        max-width: 190px !important;
        min-height: 34px !important;
        margin: 0 !important;
        padding-block: 4px !important;
        white-space: nowrap;
    }

    .fc-mobile-summary-bar .fc-mobile-selected-swatch-name {
        display: none !important;
    }

    .fc-mobile-summary-bar .quantity {
        grid-area: qty !important;
        display: grid !important;
        grid-template-columns: 34px minmax(34px, 1fr) 34px !important;
        align-items: center !important;
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        border: 1px solid var(--theme-border-color, rgba(0, 0, 0, .18));
        border-radius: var(--theme-button-border-radius, 7px) !important;
        background: var(--theme-palette-color-8, #fff);
        overflow: hidden !important;
    }

    .fc-mobile-summary-bar .quantity input {
        grid-column: 1 / -1 !important;
        grid-row: 1 !important;
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 34px !important;
        border: 0 !important;
        background: transparent !important;
        text-align: center !important;
        box-shadow: none !important;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease,
    .fc-mobile-summary-bar .quantity .ct-increase {
        z-index: 2 !important;
        grid-row: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 34px !important;
        height: 44px !important;
        min-width: 34px !important;
        min-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease {
        grid-column: 1 !important;
    }

    .fc-mobile-summary-bar .quantity .ct-increase {
        grid-column: 3 !important;
    }

    .fc-mobile-summary-bar .single_add_to_cart_button,
    .fc-mobile-summary-bar .paese-bis-add-to-cart-slot,
    .fc-mobile-summary-bar .paese-bis-add-to-cart-slot .paese-bis-trigger {
        grid-area: cta !important;
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        margin: 0 !important;
        border-radius: var(--theme-button-border-radius, 7px) !important;
    }

    .fc-mobile-summary-bar .single_add_to_cart_button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding-inline: 16px !important;
        white-space: nowrap !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
        transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
    }

    .fc-mobile-summary-bar .single_add_to_cart_button:active {
        transform: translateY(1px);
        box-shadow: 0 2px 6px rgba(0, 0, 0, .10);
    }

    .fc-mobile-summary-bar .single_add_to_cart_button.disabled,
    .fc-mobile-summary-bar .single_add_to_cart_button:disabled {
        opacity: .55;
        box-shadow: none;
    }
}

/* Jedna etykieta koloru: mobilna nazwa pod swatchami + natywne „Wyczyść”. */
@media (max-width: 1024px) {
    body.single-product.has-mobile-product-ui form.variations_form .variations th.label {
        display: none !important;
    }

    body.single-product.has-mobile-product-ui form.variations_form .fc-mobile-selected-swatch-name {
        display: inline-block !important;
        width: auto !important;
        max-width: 100% !important;
        margin: 7px 8px 0 0 !important;
        padding: 0 !important;
        vertical-align: middle;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.single-product.has-mobile-product-ui form.variations_form .reset_variations {
        display: inline-flex !important;
        align-items: center;
        width: auto !important;
        margin: 7px 0 0 !important;
        vertical-align: middle;
    }

    .fc-mobile-summary-bar .variations td.value {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 6px;
    }

    .fc-mobile-summary-bar .variations td.value > .fc-swatches,
    .fc-mobile-summary-bar .variations td.value > select {
        grid-column: 1 / -1;
    }

    .fc-mobile-summary-bar .variations td.value > .fc-mobile-selected-swatch-name {
        grid-column: 1;
        justify-self: end;
    }

    .fc-mobile-summary-bar .variations td.value > .reset_variations {
        grid-column: 2;
        justify-self: end;
    }

    body.has-mobile-product-ui {
        --fc-mobile-summary-height: 126px;
    }

    .fc-mobile-summary-bar {
        min-height: 114px !important;
    }

    /*
     * Produkt prosty nie ma tabeli wariantów, ale zachowuje identyczną siatkę:
     * cena | puste miejsce, a poniżej ilość | CTA.
     */
    .fc-mobile-summary-bar form.cart:not(.variations_form),
    .fc-mobile-summary-bar form.cart:not(.variations_form) .ct-cart-actions {
        display: contents !important;
    }

    .fc-mobile-summary-bar form.cart:not(.variations_form) .quantity {
        grid-area: qty !important;
    }

    .fc-mobile-summary-bar form.cart:not(.variations_form) .single_add_to_cart_button {
        grid-area: cta !important;
    }
}

/* =========================================================
   MOBILE STICKY BAR — WIELO-RZĘDOWE WARIANTY
   Przewija się wyłącznie paleta; nazwa wybranego koloru
   pozostaje statycznie pod nią.
========================================================= */
@media (max-width: 1024px) {
    .fc-mobile-summary-bar .variations { overflow: visible !important; }
    .fc-mobile-summary-bar .variations::after { content: none !important; display: none !important; }

    .fc-mobile-summary-bar .variations tbody {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .fc-mobile-summary-bar .variations tr {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
    }

    .fc-mobile-summary-bar .variations td.value {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .fc-mobile-summary-bar .fc-swatches {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-rows: repeat(2, 28px) !important;
        grid-auto-columns: 28px !important;
        grid-auto-flow: column !important;
        align-items: center !important;
        justify-content: start !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 68px !important;
        margin: 0 !important;
        padding: 4px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    .fc-mobile-summary-bar .fc-swatches::-webkit-scrollbar { display: none; }

    .fc-mobile-summary-bar .fc-mobile-selected-swatch-name {
        grid-column: 1 !important;
        display: block !important;
        justify-self: start !important;
        width: 100% !important;
        margin: 3px 0 0 !important;
        font-size: 12px !important;
        font-weight: 500 !important;
        line-height: 1.25 !important;
        text-align: left !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .fc-mobile-summary-bar .variations td.value > .reset_variations {
        grid-column: 2 !important;
        margin: 3px 0 0 6px !important;
    }

    body.has-mobile-product-ui { --fc-mobile-summary-height: 164px; }
    .fc-mobile-summary-bar { min-height: 150px !important; }

    .fc-mobile-summary-bar .quantity {
        grid-template-columns: 40px minmax(32px, 1fr) 40px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-color: var(--theme-palette-color-1, #b99073) !important;
    }

    .fc-mobile-summary-bar .quantity input.qty {
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 40px !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 44px !important;
        appearance: textfield;
        -moz-appearance: textfield;
    }

    .fc-mobile-summary-bar .quantity input.qty::-webkit-inner-spin-button,
    .fc-mobile-summary-bar .quantity input.qty::-webkit-outer-spin-button {
        margin: 0;
        -webkit-appearance: none;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease,
    .fc-mobile-summary-bar .quantity .ct-increase {
        position: relative !important;
        top: auto !important;
        inset-inline: auto !important;
        width: 40px !important;
        height: 44px !important;
        min-width: 40px !important;
        min-height: 44px !important;
        color: var(--theme-palette-color-1, #b99073) !important;
        background: transparent !important;
        border-radius: 0 !important;
    }

    .fc-mobile-summary-bar .quantity .ct-decrease {
        border-right: 1px solid var(--theme-border-color, rgba(0, 0, 0, .12));
    }

    .fc-mobile-summary-bar .quantity .ct-increase {
        border-left: 1px solid var(--theme-border-color, rgba(0, 0, 0, .12));
    }

    .fc-mobile-summary-bar .quantity .ct-decrease::before,
    .fc-mobile-summary-bar .quantity .ct-increase::before {
        margin: 0 !important;
        font-size: 12px !important;
        line-height: 1 !important;
    }
}

/* =========================================================
   MOBILE STICKY BAR — ADAPTACYJNA LICZBA RZĘDÓW
   Jeden rząd pozostaje bez zmian. Drugi rząd pojawia się
   dopiero wtedy, gdy paleta faktycznie nie mieści się wszerz.
========================================================= */
@media (max-width: 1024px) {
    body.has-mobile-product-ui {
        --fc-mobile-safe-gap: 18px;
    }

    .fc-mobile-summary-bar {
        min-height: 118px !important;
    }

    .fc-mobile-summary-bar .fc-swatches {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        height: 36px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .fc-mobile-summary-bar .fc-swatches .fc-swatch {
        flex: 0 0 28px !important;
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
    }

    .fc-mobile-summary-bar .fc-swatches.is-multiline {
        display: flex !important;
        flex-flow: row wrap !important;
        align-content: flex-start !important;
        align-items: center !important;
        gap: 6px !important;
        box-sizing: border-box !important;
        height: 56px !important;
        padding-block: 3px !important;
        overflow: hidden !important;
    }

    .fc-mobile-summary-bar .fc-swatches.is-multiline .fc-swatch {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
        flex-basis: 22px !important;
    }

    .fc-mobile-summary-bar.has-multiline-swatches {
        min-height: 148px !important;
    }

    /* Text variants keep the card-tag appearance and wrap without a row limit. */
    .fc-mobile-summary-bar .fc-swatches.has-text-tags {
        display: flex !important;
        flex-flow: row wrap !important;
        align-content: flex-start !important;
        gap: 6px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        height: auto !important;
        min-height: 24px !important;
        padding-block: 3px !important;
        overflow: visible !important;
    }

    .fc-mobile-summary-bar .fc-swatches.has-text-tags .fc-swatch--text {
        flex: 0 1 auto !important;
        width: auto !important;
        min-width: 24px !important;
        max-width: 100% !important;
        height: 18px !important;
        min-height: 18px !important;
        padding: 0 5px !important;
        border-radius: 10px !important;
        font-size: 10px !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
    }

    .fc-mobile-summary-bar .fc-swatches.has-text-tags .fc-swatch--text.is-active {
        outline: none !important;
        background: var(--theme-palette-color-6) !important;
        color: #fff !important;
        border-color: var(--theme-palette-color-6) !important;
    }

    /*
     * Komunikat Omnibus musi być czytelny w całości. Starsze reguły paska
     * wymuszały jedną linię i ukrywały jej koniec pod wielokropkiem.
     */
    .fc-mobile-summary-bar .fc-price-supplements {
        display: flex;
        flex-direction: column;
        gap: 2px;
        width: 100%;
        min-width: 0;
    }

    .fc-mobile-summary-bar .fc-omnibus-notice,
    .fc-mobile-summary-bar .fc-card-unit-price {
        position: relative;
        z-index: 2;
        display: block !important;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
        font-size: 9px;
        line-height: 1.25;
        white-space: normal !important;
        overflow: visible !important;
        overflow-wrap: normal;
        word-break: normal;
        text-overflow: clip !important;
    }

    /*
     * Produkt prosty nie ma wariantów. Cena zajmuje cały pierwszy wiersz,
     * dzięki czemu nie zostaje pusta prawa kolumna i nie obcinamy promocji.
     * Drugi wiersz pozostaje wspólny: ilość po lewej, CTA po prawej.
     */
    .fc-mobile-summary-bar.is-simple-product {
        grid-template-columns: minmax(112px, 0.72fr) minmax(0, 1.55fr) !important;
        grid-template-areas:
            "price price"
            "qty cta" !important;
        grid-template-rows: auto auto;
        align-items: center;
        gap: 8px 10px;
        min-height: 0 !important;
    }

    .fc-mobile-summary-bar.is-simple-product .fc-ms-price,
    .fc-mobile-summary-bar.is-simple-product .fc-summary-price,
    .fc-mobile-summary-bar.is-simple-product .fc-price {
        grid-area: price;
        width: 100%;
        max-width: 100%;
        justify-self: stretch;
        align-self: start;
    }

    .fc-mobile-summary-bar.is-simple-product .fc-price-main {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
    }

    .fc-mobile-summary-bar.is-simple-product .fc-price-main > .price {
        max-width: 100%;
        margin: 0;
    }

    .fc-mobile-summary-bar.is-simple-product .fc-price-supplements {
        width: 100%;
        max-width: 100%;
    }
}
