/* Nowoczesne odświeżenie motywu */

:root {
    --primary-color: #76b001; /* Zielony z logo */
    --accent-color: #4a6d00;  /* Ciemniejszy zielony zamiast pomarańczu dla lepszej spójności */
    --secondary-accent: #8bc34a; /* Jaśniejszy zielony do subtelnych akcentów */
    --dark-green: #3d5a00;
    --text-main: #333333;
    --transition-speed: 0.3s;
    --border-radius: 0px; /* Usunięcie zaokrągleń na życzenie użytkownika */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
}

body, #wrapper {
    font-family: var(--font-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .page-heading {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Sticky Header */
#header {
    width: 100%;
    z-index: 1000;
}

.header-top {
    transition: all 0.3s ease;
    background: #fff;
    border-bottom: 1px solid #f1f1f1;
}

@media (min-width: 992px) {
    body.is-sticky .header-nav, 
    body.is-sticky .header-banner {
        display: none !important;
    }
}

body.is-sticky #header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

@media (min-width: 992px) {
    body.is-sticky #header {
        box-shadow: var(--shadow-md);
    }
}

body.is-sticky .header-top {
    padding: 5px 0;
}

body.is-sticky .row-custom {
    display: flex;
    align-items: center;
    width: 100%;
}

body.is-sticky #top-menu {
    padding: 0;
    border-bottom: none;
}

body.is-sticky #_desktop_logo {
    flex-shrink: 0;
}

body.is-sticky #_desktop_logo img {
    width: 192px;
    height: 50px;
}

@media (min-width: 992px) {
    body.is-sticky #wrapper {
        margin-top: 100px; /* Wartość do ewentualnej korekty w zależności od wysokości menu */
    }
}

/* Ukrywanie zbędnych elementów w sticky menu */
body.is-sticky .header-top-right > *:not(#_desktop_cart):not(#_desktop_user_info):not(#_desktop_top_menu) {
    display: none !important;
}

body.is-sticky .header-top-right {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    flex-grow: 1;
}

body.is-sticky #_desktop_top_menu {
    flex-grow: 1;
    display: flex !important;
    justify-content: center;
}

body.is-sticky #top-menu {
    margin: 0;
    border: none;
    padding: 0;
}

body.is-sticky #top-menu li.category {
    margin: 0 10px;
}

body.is-sticky #top-menu li a {
    padding: 5px 0;
    font-size: 0.8rem;
}

.row-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Fix dla odstępów między produktami (góra/dół) */
.products .product {
    margin-bottom: 30px;
}

/* Reset zaokrągleń dla wszystkich przycisków */
.btn, .btn-primary, .blockcart, .product-miniature, .popover.sub-menu {
    border-radius: var(--border-radius) !important;
}

/* Poprawa przycisku dodaj do koszyka w miniaturze */
.add-to-cart-btn-custom, .product-miniature .btn-primary.add-to-cart {
    padding: 10px 20px !important;
    font-size: 14px !important;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0 !important;
}

.product-miniature .btn-primary.add-to-cart i {
    display: none !important;
}

/* Menu Główne - Poprawki kolorów i submenu */
#top-menu > li > a:after {
    background-color: var(--primary-color) !important;
}

#top-menu > li > a:hover,
#top-menu > li.current > a,
#top-menu > li.sfHover > a,
#top-menu > li.active > a,
#top-menu > li.current-menu-parent > a,
#top-menu > li.current-menu-ancestor > a {
    color: var(--primary-color) !important;
}

#top-menu li ul li.current > a,
#top-menu li ul li.active > a {
    color: var(--primary-color) !important;
}

/* aktywna kategoria w submenu */
#top-menu li ul li.current > a,
#top-menu li ul li.active > a {
    color: var(--primary-color) !important;
}

/* RODZIC, gdy którakolwiek podkategoria jest aktywna */
#top-menu > li:has(ul li.current) > a,
#top-menu > li:has(ul li.active) > a {
    color: var(--primary-color) !important;
}

#top-menu > li > a:hover:after, #top-menu > li.current > a:after {
    width: 100% !important;
}

/* Fix dla podkreśleń w submenu - tylko aktywny element w submenu powinien mieć podkreślenie */
.popover.sub-menu #top-menu li:not(.current) a:after {
    display: none;
}

.popover.sub-menu #top-menu li.current > a:after {
    display: block !important;
    width: 100% !important;
    height: 2px;
}

.popover.sub-menu #top-menu li.current > a {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.popover.sub-menu #top-menu li a {
    padding: 5px 0;
    text-transform: none;
    font-weight: normal;
}

.popover.sub-menu #top-menu li a:hover {
    color: var(--primary-color) !important;
}

/* Koszyk w nagłówku */
.blockcart .shopping-cart {
    color: var(--primary-color);
}

.blockcart .cart-products-count {
    background: var(--primary-color);
}

.block-categories {
    background: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #f1f1f1;
}

.block-categories .category-top-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.block-categories .category-top-menu > li {
    margin-bottom: 15px;
}

.block-categories .category-back {
    margin-bottom: 20px !important;
}

.block-categories .back-link {
    display: flex !important;
    align-items: center;
    color: #888 !important;
    font-size: 0.85rem !important;
    text-decoration: none;
    transition: color 0.2s;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.block-categories .back-link i {
    font-size: 16px;
    margin-right: 5px;
}

.block-categories .back-link:hover {
    color: var(--primary-color) !important;
}

.block-categories .category-top-menu > li > a {
    display: block;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--text-main);
}

.block-categories ul {
    list-style: none;
    padding-left: 0;
}

.block-categories ul ul {
    padding-left: 15px;
    margin-top: 5px;
}

.block-categories li {
    position: relative;
    line-height: 1.6;
}

.block-categories .category-sub-link.active,
.block-categories .category-top-menu > li > a.active,
.block-categories a.active,
.block-categories a.has-child-active {
    color: var(--primary-color) !important;
    font-weight: bold;
}

#header .header-nav .cart-preview.active {
    background: var(--primary-color);
}

body.is-sticky .header-top-right #_desktop_user_info .user-info {
    margin-right: 15px;
}

body.is-sticky .header-top-right #_desktop_cart .blockcart {
    padding: 5px 15px;
}

.block-categories .category-sub-menu {
    margin-bottom: 10px;
}

.block-categories a {
    color: #555;
    transition: color 0.2s;
}

.block-categories a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

/* Animacja rotacji dla ikony ładowania */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.rotating {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* Menu Główne - Estetyka */
#top-menu {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #f1f1f1;
    padding: 10px 0;
}

#top-menu li.category {
    margin: 0 15px;
}

#top-menu li a {
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #444;
    padding: 10px 0;
    position: relative;
    transition: color var(--transition-speed);
    display: inline-block;
}

#top-menu > li > a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-speed);
    border-radius: 3px;
}

#top-menu > li > a:hover, #top-menu > li.current > a {
    color: var(--primary-color);
    text-decoration: none;
}

#top-menu > li > a:hover:after, #top-menu > li.current > a:after {
    width: 100%;
}

/* Submenu / Popover */
.popover.sub-menu {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
}

/* Koszyk w nagłówku */
.blockcart {
    background: #fff;
    border-radius: 30px;
    padding: 8px 20px;
    transition: box-shadow var(--transition-speed), transform var(--transition-speed);
    display: flex;
    align-items: center;
}

.blockcart .header {
    display: flex;
    align-items: center;
}

.blockcart .shopping-cart {
    color: var(--primary-color);
    margin-right: 8px;
    font-size: 24px;
}

.blockcart .cart-products-count {
    background: #fff;
    color: #333;
    border-radius: 50%;
    padding: 0;
    font-size: 11px;
    margin-left: 8px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    display: inline-block;
    text-align: center;
    font-weight: bold;
}

/* Ukrywanie wyszukiwarki na mobile */
@media (max-width: 767px) {
    #search_widget {
        display: block !important;
        position: absolute;
        top: -41px;
    }
    .is-open #search_widget {
        display: none !important;

    }
    .header-top .container {
        margin-top: 21px;
    }

}

/* Poprawki dla Mobile Sticky Header */
@media (max-width: 991px) {
    body.is-sticky .header-nav {
        display: block !important; /* Na mobile header-nav zawiera ikonę menu i logo */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
        background: #fff;
        box-shadow: var(--shadow-md);
    }

    body.is-sticky .header-banner {
        display: none !important;
    }

    body.is-sticky .header-top {
        display: none !important; /* Ukrywamy header-top na mobile w trybie sticky, bo logo i koszyk są w nav */
    }

    body.is-sticky #wrapper {
        margin-top: 60px;
    }

    /* Układ elementów w mobile sticky */
    .header-nav .mobile {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    #_mobile_logo img {
        max-height: 35px;
        width: auto;
    }

    #menu-icon {
        margin-top: 0 !important;
        padding: 0 10px;
    }

    #_mobile_cart, #_mobile_user_info {
        display: flex;
        align-items: center;
    }

    #_mobile_cart .cart-preview.active {
        background: none;
    }

    #_mobile_cart .cart-preview .header {
        padding: 0;
    }

    #_mobile_cart .shopping-cart {
        font-size: 20px;
        color: var(--primary-color);
    }

    #_mobile_cart .cart-products-count {
        font-size: 10px;
        width: 18px;
        height: 18px;
        line-height: 18px;
        background: var(--primary-color);
        color: #fff;
        margin-left: 3px;
    }
}

/* Przyciski dodaj do koszyka */
.btn-primary.add-to-cart, .add-to-cart-btn-custom {
    border-radius: 25px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 10px 20px; 
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary.add-to-cart i, .add-to-cart-btn-custom i {
    display: none;
}

.btn-primary.add-to-cart:hover, .add-to-cart-btn-custom:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Miniatury produktów */
.product-miniature {
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    border: 1px solid #f0f0f0;
    padding: 20px;
    background: #fff;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-miniature .thumbnail-top {
    min-height: 200px;
    display: block;
    align-items: center;
    justify-content: center;
}
.product-miniature .thumbnail-container .product-thumbnail img {
    width: 100%;
}

.product-miniature .product-title a {
    font-size: 16px;
}

.product-miniature .product-title {
    height: 60px;
    overflow: hidden;
    margin: 10px 0;
}

.product-miniature .thumbnail-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-miniature:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(118, 176, 1, 0.15); /* Subtelna zielona poświata przy hover */
}

.product-miniature .product-title a {
    color: #333;
    font-weight: 600;
    font-family: var(--font-heading);
}

.product-miniature .product-price-and-shipping {
    color: var(--primary-color) !important;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-top: auto;
}

#_desktop_logo img {
    width: 192px;
    height: 50px;
}

#contact-link a {
    font-weight: bold;
}

body.is-sticky .header-top .row-custom {
    display: flex !important;
}

#main .tabs {
    margin-bottom: 50px;
}

/* RWD menu - lepsza estetyka i czytelność */
@media (max-width: 1199px) {
    #top-menu {
        flex-wrap: wrap;
        row-gap: 6px;
        padding: 8px 0;
    }

    #top-menu li.category {
        margin: 0 10px;
    }

    #top-menu li a {
        font-size: 0.78rem;
        padding: 8px 0;
        letter-spacing: 0.2px;
    }
}

@media (max-width: 991px) {
    #top-menu {
        display: block;
        padding: 0;
        border-bottom: none;
    }

    #top-menu li.category {
        margin: 0;
    }

    #top-menu li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 14px;
        font-size: 0.95rem;
        text-transform: none;
    }

    #top-menu > li > a:after {
        display: none;
    }

    #mobile_top_menu_wrapper {
        background: #fff;
        border-top: 1px solid #f1f1f1;
        border-bottom: 1px solid #f1f1f1;
    }

    #mobile_top_menu_wrapper .top-menu {
        padding: 4px 0;
    }

    #mobile_top_menu_wrapper .top-menu > li {
        border-bottom: 1px solid #f1f1f1;
    }

    #mobile_top_menu_wrapper .top-menu > li:last-child {
        border-bottom: none;
    }

    #mobile_top_menu_wrapper .top-menu .sub-menu {
        position: static;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
    }

    #mobile_top_menu_wrapper .top-menu .sub-menu ul {
        padding: 0;
    }

    #mobile_top_menu_wrapper .top-menu .sub-menu ul li a {
        padding: 10px 20px;
        font-size: 0.9rem;
        text-transform: none;
        font-weight: 500;
    }

    #mobile_top_menu_wrapper .top-menu .collapse {
        display: none;
    }

    #mobile_top_menu_wrapper .top-menu .collapse.in {
        display: block;
    }
}
