/* =================================================
   SIDE CART – KRYSTALSPACE PREMIUM
================================================= */

/* --- OVERLAY --- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 9998;
}

body.side-cart-open .cart-overlay {
    opacity: 1;
    visibility: visible;
}

/* --- DRAWER --- */
.side-cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(420px, 100%);
    height: 100vh;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -20px 0 50px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.165,.84,.44,1);
    display: flex;
    flex-direction: column;
}

body.side-cart-open .side-cart-drawer {
    transform: translateX(0);
}

/* --- HEADER --- */
.side-cart-header {
    padding: 22px 26px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.side-cart-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* Badge ilości */
.side-cart-title span {
    font-size: .75rem;
    padding: 3px 9px;
    border-radius: 20px;
    background: #000;
    color: #fff;
    font-weight: 600;
}

/* Close */
.close-side-cart {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all .25s ease;
}

.close-side-cart:hover {
    background: #000;
    color: #fff;
    transform: rotate(90deg);
}

/* --- CONTENT WRAPPER --- */
.side-cart-content {
    display: flex;
    flex-direction: column;
    flex: 1; /* Zapobiega ucinaniu przycisków na dole */
    min-height: 0;
}

.side-cart-content .widget_shopping_cart_content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* --- PRODUCT LIST --- */
.side-cart-content .cart_list {
    list-style: none;
    margin: 0;
    padding: 0 26px;
    overflow-y: auto;
    flex-grow: 1;
}

.side-cart-content .cart_list li {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    position: relative;
}

.side-cart-content .cart_list li:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,.05);
}

/* Product image */
.side-cart-content .cart_list li img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 12px;
}

/* Product title */
.side-cart-content .cart_list li a {
    font-size: .9rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.side-cart-content .cart_list li .quantity {
    display: block;
    font-size: .8rem;
    color: #64748b;
    margin-top: 4px;
}

/* Remove button */
.side-cart-content .cart_list li .remove {
    position: absolute;
    top: 18px;
    right: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fef2f2;
    color: #ef4444 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background .2s ease;
}

.side-cart-content .cart_list li .remove:hover {
    background: #fee2e2;
}

/* --- TOTAL --- */
.side-cart-content .total {
    padding: 22px 26px;
    border-top: 1px solid rgba(0,0,0,.06);
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: .95rem;
    color: #0f172a;
}

/* --- BUTTONS --- */
.side-cart-content .buttons {
    padding: 20px 26px 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.side-cart-content .buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all .25s ease;
}

/* View cart */
.side-cart-content .buttons a.cart {
    background: #f1f5f9;
    color: #475569;
}

.side-cart-content .buttons a.cart:hover {
    background: #e2e8f0;
}

/* Checkout */
.side-cart-content .buttons a.checkout {
    background: #000;
    color: #fff !important;
}

.side-cart-content .buttons a.checkout:hover {
    background: #111;
    transform: translateY(-1px);
}

/* --- KRYSTALSPACE EMPTY MINI-CART --- */
.bz-mini-cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    background: #ffffff;
    flex: 1;
}

/* Stylizacja ikony torby */
.bz-empty-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: #ec8088;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Połączony efekt hover: tło, kolor, powiększenie i przesunięcie do góry */
.bz-mini-cart-empty:hover .bz-empty-icon {
    background: #f1f5f9;
    color: #ec8088;
    transform: scale(1.05) translateY(-5px);
}

/* Dodatkowy ciągły efekt "oddechu" dla ikony wewnątrz koszyka */
@keyframes bz-float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* Aplikacja animacji na samej grafice SVG */
.bz-empty-icon svg {
    animation: bz-float 4s ease-in-out infinite;
}

/* Komunikat "Twój koszyk jest pusty" */
.woocommerce-mini-cart__empty-message {
    font-family: 'Archivo', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 30px 0 !important;
}

/* Przycisk powrotu */
.bz-primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a; 
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    border-radius: 14px;
    padding: 15px 32px; 
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.bz-primary-btn:hover {
    background: #6366f1; 
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

/* =================================================
   HEADER CART BUBBLE (TWARDE WYMUSZENIE)
================================================= */

/* 1. Ustawienie przycisku koszyka jako ramy */
#site-header-cart a.cart-contents {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
}

/* 2. Oderwanie licznika od tekstu i wymuszenie okrągłego kształtu */
#site-header-cart a.cart-contents .badge-count {
    position: absolute !important;
    top: -5px !important;
    right: -10px !important;
    background-color: #1e293b !important; /* Ciemny granat */
    color: #ffffff !important; 
    font-size: 10px !important;
    font-weight: 700 !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important; 
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    z-index: 99 !important; 
}


/* =================================================
   PREMIUM MOBILE DRAWER - KRYSTALSPACE
================================================= */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: -100%; 
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: #ec8088; 
    z-index: 2500;
    transition: var(--ks-transition, all 0.5s cubic-bezier(0.2, 1, 0.3, 1));
    box-shadow: 20px 0 80px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
}

.mobile-drawer.is-active {
    left: 0;
}

/* Header Szuflady */
.drawer-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-drawer {
    background: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #ec8088;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--ks-transition);
}

/* Zawartość Menu Mobilnego */
.drawer-content {
    flex-grow: 1;
    padding: 30px 25px;
    overflow-y: auto;
}

.mobile-menu-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.mobile-menu-list li {
    margin-bottom: 20px;
    list-style: none !important;
    position: relative;
    transform: translateX(-20px);
    opacity: 0;
    transition: all 0.4s ease;
}

.mobile-drawer.is-active li {
    transform: translateX(0);
    opacity: 1;
}

/* Linki Główne w Mobile */
.mobile-menu-list a {
    font-family: 'Archivo', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: block;
    transition: opacity 0.3s;
}

.mobile-menu-list a:hover {
    opacity: 0.8;
}

/* --- OBSŁUGA PODMENU W MOBILE --- */
.mobile-menu-list .menu-item-has-children > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-menu-list .menu-item-has-children > a::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 400;
    transition: transform 0.3s ease;
}

.mobile-menu-list .sub-menu {
    list-style: none !important;
    padding: 10px 0 0 20px;
    margin: 0;
    display: none; 
}

.mobile-menu-list .menu-item-has-children.is-open > .sub-menu {
    display: block;
}

.mobile-menu-list .menu-item-has-children.is-open > a::after {
    content: '-';
    transform: rotate(180deg);
}

.mobile-menu-list .sub-menu li {
    margin-bottom: 12px;
}

.mobile-menu-list .sub-menu a {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

/* Footer Szuflady */
.drawer-footer {
    padding: 30px 25px;
    background: rgba(0, 0, 0, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-socials {
    display: flex;
    gap: 12px;
}

.drawer-socials a {
    width: 38px;
    height: 38px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ec8088;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.drawer-socials a:hover {
    transform: translateY(-3px);
}

/* Overlay tła */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 2400;
}

body.menu-open .drawer-overlay {
    opacity: 1;
    visibility: visible;
}


/* =================================================
   KS-SIDEBAR (FILTER) - ZINTEGROWANY Z DRAWEREM
================================================= */

@media (max-width: 991px) {
    .ks-sidebar {
        position: fixed;
        top: 0;
        left: -100%; 
        width: 100%;
        max-width: 320px;
        height: 100vh;
        background: #f8fafc; 
        z-index: 2600; 
        transition: var(--ks-transition, all 0.5s cubic-bezier(0.2, 1, 0.3, 1));
        box-shadow: 20px 0 80px rgba(15, 23, 42, 0.15);
        display: flex;
        flex-direction: column;
        padding: 0 !important;
        overflow: hidden;
    }

    .ks-sidebar.active {
        left: 0;
    }

    .ks-sidebar-header {
        background: #ec8088; 
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: #ffffff;
    }

    .ks-sidebar-header span {
        font-family: 'Archivo', sans-serif;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .ks-close-btn {
        background: #ffffff;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        color: #ec8088;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        line-height: 0;
    }

    .ks-sidebar > .widget,
    .ks-sidebar > div:not(.ks-sidebar-header) {
        flex-grow: 1;
        overflow-y: auto;
        padding: 20px;
    }
}


/* =================================================
   STYLIZACJA WIDŻETÓW (Karty produktów)
================================================= */
.ks-sidebar .widget {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.ks-sidebar .widgettitle, 
.ks-sidebar .widget-title {
    font-family: 'Archivo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ks-sidebar .widgettitle::before,
.ks-sidebar .widget-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: #ec8088; 
    border-radius: 10px;
    display: inline-block;
}

.ks-mobile-filter-btn {
    display: none;
}

@media (max-width: 991px) {
    .ks-mobile-filter-btn {
        display: flex;
        width: 100%;
        background: #1e293b; 
        color: white;
        padding: 14px;
        border-radius: 12px;
        border: none;
        font-family: 'Archivo', sans-serif;
        font-weight: 600;
        margin-bottom: 25px;
        justify-content: center;
        align-items: center;
        gap: 10px;
        cursor: pointer;
    }
}

.site-overlay.is-active {
    opacity: 1;
    visibility: visible;
}