/* =========================================================================
   1. Z-INDEX I ORYGINALNE PRZYCISKI W SKLEPIE
   ========================================================================= */
#site-header, #site-header-inner, .oceanwp-mobile-menu-icon { z-index: 99999 !important; position: relative; }
.br_new_compare_block { position: relative; z-index: 10 !important; }
.br_new_compare_block .br_main_top, .br_new_compare_block .br_top_table { z-index: 10 !important; }

/* === STYL DLA DESKTOPU I TABLETU (Twój oryginalny kod w 100%) === */
@media (min-width: 768px) {
    body.woocommerce ul.products li.product .br_compare_button, 
    body.woocommerce-page ul.products li.product .br_compare_button,
    body.woocommerce div.product .br_compare_button,
    body.woocommerce-page div.product .br_compare_button { background: transparent !important; color: #333333 !important; width: auto !important; display: inline-flex !important; align-items: center; justify-content: flex-start; padding: 10px 15px; border: none !important; box-shadow: none !important; font-weight: normal; margin: 0; }
    
    body.woocommerce ul.products li.product .br_compare_button:hover, 
    body.woocommerce-page ul.products li.product .br_compare_button:hover,
    body.woocommerce div.product .br_compare_button:hover,
    body.woocommerce-page div.product .br_compare_button:hover { background: transparent !important; color: #005bc9 !important; }
    
    body.woocommerce ul.products li.product .br_compare_button .br_compare_button_text, 
    body.woocommerce-page ul.products li.product .br_compare_button .br_compare_button_text,
    body.woocommerce div.product .br_compare_button .br_compare_button_text,
    body.woocommerce-page div.product .br_compare_button .br_compare_button_text { display: inline-block; font-size: 14px; margin-left: 8px; line-height: 1; }
    
    body.woocommerce ul.products li.product .br_compare_button::before, 
    body.woocommerce-page ul.products li.product .br_compare_button::before,
    body.woocommerce div.product .br_compare_button::before,
    body.woocommerce-page div.product .br_compare_button::before { content: "\f24e"; font-family: "Font Awesome 5 Free", "FontAwesome", sans-serif; font-weight: 900; font-size: 1.2em; display: inline-block; line-height: 1; }
    
    body.woocommerce ul.products li.product .br_compare_button > i.fa,
    body.woocommerce div.product .br_compare_button > i.fa { display: none !important; }
}

/* === STYL DLA URZĄDZEŃ MOBILNYCH (Zabezpiecza widok siatki OceanWP) === */
@media (max-width: 767px) {
    /* 1. Strona pojedynczego produktu - zachowujemy duży, czytelny przycisk */
    body.woocommerce div.product .br_compare_button,
    body.woocommerce-page div.product .br_compare_button {
        background: transparent !important; color: #333333 !important; width: auto !important; display: inline-flex !important; align-items: center; justify-content: flex-start; padding: 10px 15px; border: none !important; box-shadow: none !important; font-weight: normal; margin: 0;
    }
    body.woocommerce div.product .br_compare_button::before,
    body.woocommerce-page div.product .br_compare_button::before { content: "\f24e"; font-family: "Font Awesome 5 Free", "FontAwesome", sans-serif; font-weight: 900; font-size: 1.2em; display: inline-block; line-height: 1; }
    body.woocommerce div.product .br_compare_button > i.fa { display: none !important; }
    body.woocommerce div.product .br_compare_button .br_compare_button_text { display: inline-block; font-size: 14px; margin-left: 8px; line-height: 1; }

    /* 2. Kategorie (Kafelki) - Kompaktowy przycisk, który nie rozsadza kafelka */
    body.woocommerce ul.products li.product .br_compare_button,
    body.woocommerce-page ul.products li.product .br_compare_button {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        padding: 5px 0 !important;
        margin: 5px 0 10px 0 !important;
        font-size: 13px !important;
        background: transparent !important;
        color: #005bc9 !important;
        border: none !important;
        box-shadow: none !important;
        font-weight: 600 !important;
    }
    
    body.woocommerce ul.products li.product .br_compare_button i.fa,
    body.woocommerce-page ul.products li.product .br_compare_button i.fa {
        display: none !important;
    }
    
    body.woocommerce ul.products li.product .br_compare_button::before,
    body.woocommerce-page ul.products li.product .br_compare_button::before {
        content: "\f24e";
        font-family: "Font Awesome 5 Free", "FontAwesome", sans-serif;
        font-weight: 900;
        margin-right: 6px;
    }
    
    /* 3. Wymuszenie ukrycia krótkiego opisu na mobile na listach (chroni siatkę) */
    body.woocommerce ul.products li.product .woocommerce-product-details__short-description,
    body.woocommerce ul.products li.product .br_compare_short_description {
        display: none !important;
    }

    
    /* 1. Bezwzględne zmniejszenie tytułu produktu */
    body.woocommerce ul.products li.product .woocommerce-loop-product__title,
    body.woocommerce ul.products li.product h2.woocommerce-loop-product__title,
    body.woocommerce ul.products li.product .woo-loop-product__title {
        font-size: 10px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        margin-bottom: 10px !important;
    }

    /* 2. Bezwzględne ukrycie krótkiego opisu (każdej możliwej klasy) */
    body.woocommerce ul.products li.product .woo-desc,
    body.woocommerce ul.products li.product .description,
    body.woocommerce ul.products li.product .short-description,
    body.woocommerce ul.products li.product .woocommerce-product-details__short-description,
    body.woocommerce ul.products li.product .br_compare_short_description {
        display: none !important;
        height: 0 !important;
        visibility: hidden !important;
    }
}

/* =========================================================================
   2. GŁÓWNA TABELA PORÓWNYWARKI (Ukrycie starej TYLKO gdy JS działa, styl nowej)
   ========================================================================= */
body.cz_compare_js_active .br_top_table, 
body.cz_compare_js_active .br_main_top, 
body.cz_compare_js_active .br_opacity_top, 
body.cz_compare_js_active .br_new_compare { 
    display: none !important; 
}

.cz_rebuilt_compare { width: 100%; font-family: inherit; color: #333; font-size: 14px; margin: 20px 0; }
.cz_rebuilt_compare.cz_hide_sames .cz_same_attr { display: none !important; }

.cz_rebuilt_compare.cz_show_highlights .cz_attr_row:not(.cz_same_attr) .cz_attr_name { background-color: #dcedff; }
.cz_rebuilt_compare.cz_show_highlights .cz_attr_row:not(.cz_same_attr) .cz_attr_val { background-color: #e6f2ff; }

.cz_rebuilt_compare .br_show_compare_dif, 
.cz_rebuilt_compare .br_remove_all_compare,
.cz_rebuilt_compare .cz_highlight_diff { display: inline-block; font-size: 13px; font-weight: 600; color: #005bc9; text-decoration: none; padding: 8px 12px; background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 4px; cursor: pointer; text-align: center; transition: 0.2s; margin: 5px; }
.cz_rebuilt_compare .br_show_compare_dif:hover, 
.cz_rebuilt_compare .br_remove_all_compare:hover,
.cz_rebuilt_compare .cz_highlight_diff:hover { background: #005bc9; color: #fff; }

@media (min-width: 768px) {
    .cz_top_section { display: flex; border-top: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0; }
    .cz_top_left { width: 220px; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; background: #fff; padding: 15px;}
    .cz_top_left .br_remove_all_compare, .cz_top_left .br_show_compare_dif, .cz_top_left .cz_highlight_diff { margin-bottom: 10px; width: 100%; }
    .cz_top_products { display: flex; flex-grow: 1; }
    .cz_col { flex: 1; display: flex; flex-direction: column; padding: 25px 15px; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; background: #fff;}
    .cz_img { display: flex; justify-content: center; height: 160px; margin-bottom: 20px; }
    .cz_img img { max-height: 100%; object-fit: contain; }
    .cz_title h3, .cz_title a { font-size: 15px; font-weight: 600; color: #005bc9; text-align: center; line-height: 1.4; display: block; margin-bottom: 15px; text-decoration: none;}
    .cz_action { margin-top: auto; text-align: center; }
    .cz_action .price { font-size: 19px; font-weight: 700; color: #005bc9; margin-bottom: 15px; display: block;}
    .cz_action .button, .cz_action .add_to_cart_button { background: #005bc9; color: #fff; padding: 10px 20px; border-radius: 4px; font-weight: 700; text-transform: uppercase; font-size: 13px; border: none !important; width: auto !important;}
    .cz_action .button:hover { background: #333;}
    .cz_attr_row { display: flex; border-left: 1px solid #e0e0e0; transition: background 0.3s; }
    .cz_attr_row:nth-child(even) { background: #fcfcfc; }
    .cz_attr_name { width: 220px; flex-shrink: 0; font-size: 14px; font-weight: 700; color: #444; padding: 15px; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; display: flex; align-items: center; background: #f9f9f9; transition: background 0.3s; }
    .cz_attr_vals { display: flex; flex-grow: 1; }
    .cz_attr_val { flex: 1; font-size: 14px; padding: 15px; border-right: 1px solid #e0e0e0; border-bottom: 1px solid #e0e0e0; display: flex; justify-content: center; align-items: center; text-align: center; transition: background 0.3s; }
    .cz_sep { background: #f0f0f0; color: #333; font-size: 14px; font-weight: 700; padding: 15px; border: 1px solid #e0e0e0; border-top: none; text-transform: uppercase;}
}

@media (max-width: 767px) {
    .cz_top_section { display: flex; flex-direction: column; border: 1px solid #e0e0e0; border-bottom: none; }
    .cz_top_left { display: flex; justify-content: space-around; flex-wrap: wrap; padding: 10px; background: #f8f9fa; border-bottom: 1px solid #e0e0e0; }
    .cz_top_products { display: flex; }
    .cz_col { flex: 1; display: flex; flex-direction: column; padding: 15px 5px; border-right: 1px solid #e0e0e0; background: #fff;}
    .cz_col:last-child { border-right: none; }
    .cz_img { display: flex; justify-content: center; height: 120px; margin-bottom: 10px; }
    .cz_img img { max-height: 100%; object-fit: contain; max-width: 90%;}
    .cz_title h3, .cz_title a { font-size: 14px; font-weight: 600; color: #005bc9; text-align: center; line-height: 1.3; display: block; margin-bottom: 10px; text-decoration: none;}
    .cz_action { margin-top: auto; text-align: center; }
    .cz_action .price { font-size: 15px; font-weight: 700; margin-bottom: 8px; display: block;}
    .cz_action .button, .cz_action .add_to_cart_button { width: 100%; max-width: 120px; margin: 0 auto; display: block; background: #005bc9; color: #fff; padding: 8px 4px; font-size: 12px; font-weight: 700; border: none !important;}
    .cz_attr_section { border-top: 2px solid #005bc9; }
    .cz_attr_row { border-bottom: 1px solid #e0e0e0; display: block;}
    .cz_attr_name { background: #f2f2f2; color: #444; text-align: center; font-size: 12px; font-weight: 700; padding: 6px 8px; border-bottom: 1px solid #ddd; transition: background 0.3s; }
    .cz_attr_vals { display: flex; background: #fff; }
    .cz_attr_val { flex: 1; padding: 10px 5px; text-align: center; font-size: 13px; border-right: 1px solid #e5e5e5; display: flex; align-items: center; justify-content: center; word-break: break-word; transition: background 0.3s; }
    .cz_attr_val:last-child { border-right: none; }
    .cz_sep { background: #f5f5f5; color: #333; text-align: center; font-size: 14px; font-weight: 700; padding: 10px; border-bottom: 1px solid #ddd; text-transform: uppercase;}
}

body div.berocket_compare_widget_toolbar_block,
body div.berocket_compare_widget_start {
    background: transparent !important; width: 0 !important; height: 0 !important;
    padding: 0 !important; margin: 0 !important; border: none !important;
}

body a.berocket_show_compare_toolbar {
    position: fixed !important; bottom: 20px !important; left: 20px !important;
    max-width: max-content !important; background-color: #005bc9 !important;
    color: #ffffff !important; padding: 12px 24px !important;
    border-radius: 30px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
    align-items: center !important; gap: 10px !important;
    font-weight: 700 !important; font-size: 14px !important; border: none !important;
    z-index: 999999 !important; transform: none !important; white-space: nowrap !important;
}
body a.berocket_show_compare_toolbar:hover { background-color: #003d82 !important; }

body a.berocket_show_compare_toolbar[style*="none"] { display: none !important; }
body a.berocket_show_compare_toolbar:not([style*="none"]) { display: inline-flex !important; }

body div.berocket_compare_widget_toolbar {
    position: fixed !important; bottom: 20px !important; left: 20px !important;
    width: 360px !important; max-width: calc(100vw - 40px) !important; height: auto !important;
    background: #ffffff !important; border: 1px solid #eaeaea !important;
    border-radius: 12px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
    z-index: 999999 !important; padding: 20px !important; box-sizing: border-box !important;
    transform: none !important;
}

div.berocket_compare_widget_toolbar .berocket_compare_widget {
    display: flex !important; flex-direction: column !important; gap: 15px !important; width: 100% !important;
}

div.berocket_compare_widget_toolbar ul {
    order: 1 !important; display: flex !important; flex-wrap: nowrap !important;
    gap: 10px !important; padding: 0 0 15px 0 !important; margin: 0 !important;
    list-style: none !important; justify-content: flex-start !important;
}

div.berocket_compare_widget_toolbar ul li {
    position: relative !important; display: flex !important; align-items: center !important;
    justify-content: center !important; background: transparent !important;
    border: none !important; padding: 0 !important; width: 65px !important; height: 65px !important;
    flex-shrink: 0 !important; margin: 0 !important;
}

div.berocket_compare_widget_toolbar ul li a:not(.br_remove_compare_product) span { display: none !important; }

div.berocket_compare_widget_toolbar ul li a:not(.br_remove_compare_product) {
    display: flex !important; justify-content: center !important; align-items: center !important;
    width: 100% !important; height: 100% !important; text-decoration: none !important;
}
div.berocket_compare_widget_toolbar ul li a img {
    width: 100% !important; height: 100% !important; object-fit: contain !important;
    margin: 0 !important; padding: 0 !important; border: none !important;
}

div.berocket_compare_widget_toolbar ul li .br_remove_compare_product {
    position: absolute !important; top: -5px !important; right: -5px !important;
    background: #cc0000 !important; border: 2px solid #ffffff !important;
    border-radius: 50% !important; width: 20px !important; height: 20px !important;
    display: flex !important; justify-content: center !important; align-items: center !important;
    color: #ffffff !important; font-size: 11px !important; text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important; z-index: 10 !important;
}

div.berocket_compare_widget_toolbar a.berocket_open_compare {
    order: 2 !important; position: relative !important; top: auto !important;
    right: auto !important; left: auto !important; width: 100% !important;
    box-sizing: border-box !important; background-color: #005bc9 !important;
    color: #ffffff !important; padding: 12px 30px !important; border-radius: 6px !important;
    font-weight: 700 !important; text-transform: uppercase !important; font-size: 13px !important;
    text-decoration: none !important; display: block !important; border: none !important;
    text-align: center !important; margin: 0 !important;
}
div.berocket_compare_widget_toolbar a.berocket_open_compare:hover { background-color: #003d82 !important; }

body a.berocket_hide_compare_toolbar {
    position: absolute !important; top: 15px !important; right: 15px !important;
    color: #999 !important; font-size: 24px !important; line-height: 1 !important;
    text-decoration: none !important; background: transparent !important; border: none !important; z-index: 10 !important;
}
body a.berocket_hide_compare_toolbar i { display: none !important; }
body a.berocket_hide_compare_toolbar::before { content: "\00d7" !important; font-family: sans-serif !important; }
body a.berocket_hide_compare_toolbar:hover { color: #333 !important; }

/* =========================================================================
   POWIADOMIENIE (TOAST) O LIMICIE PRODUKTÓW
   ========================================================================= */
#cz-custom-alert {
    position: fixed !important;
    bottom: 40px !important; /* Wysuwa się od dołu */
    left: 50% !important;
    transform: translateX(-50%) translateY(100px) !important;
    background-color: #cc0000 !important; /* Czerwony kolor błędu/ostrzeżenia */
    color: #ffffff !important;
    padding: 15px 25px !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2) !important;
    z-index: 9999999 !important; /* Nad wszystkim */
    font-size: 14px !important;
    font-weight: 700 !important;
    text-align: center !important;
    opacity: 0 !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
    pointer-events: none !important; /* Nie blokuje klikania pod spodem! */
    width: 90% !important;
    max-width: 450px !important;
    line-height: 1.4 !important;
}

#cz-custom-alert.cz-alert-show {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 1 !important;
}