/* ============================================================
   Koszyk — komponent współdzielony (index.html + product-page.html)
   ============================================================ */

#cart {
    position: absolute;
    right: 20px;
    top: 36px;
    width: 37px;
    height: 37px;
    padding: 10px;
    box-sizing: border-box;
    background-color: #202020;
    border: none;
    border-radius: 11px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    cursor: pointer;
}

#cart img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: filter 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    #cart:hover {
        transform: translateY(-2px);
        background-color: #ffffff;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }

    #cart:hover img {
        filter: invert(1);
    }
}

#cart.is-pressed {
    transform: translateY(-2px);
    background-color: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#cart.is-pressed img {
    filter: invert(1);
}

#cart-count {
    position: absolute;
    top: 27px;
    right: 11px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 50%;
    background: #f2f2f2;
    color: #111111;
    font-size: 11px;
    font-weight: 700;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

#cart-count.visible {
    display: flex;
}

.sidebar {
    width: 400px;
    height: 100vh;
    position: fixed;
    top: 0;
    right: -450px; /* Ukryte poza ekranem */
    background: #ffffff;
    color: rgb(0, 0, 0);
    transition: right 0.5s ease-in-out;
    border-radius: 25px 0 0 25px;
    border: 1px solid #eeeeee;
    border-right: none;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 3000;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 14px 20px;
    border-bottom: 1px solid #eeeeee;
    flex-shrink: 0;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 18px;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.close-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #202020;
    color: #f2f2f2;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .close-btn:hover {
        transform: translateY(-2px);
        background-color: #ffffff;
        color: #111111;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    }
}

.close-btn.is-pressed {
    transform: translateY(-2px);
    background-color: #ffffff;
    color: #111111;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    scrollbar-width: thin;
    scrollbar-color: #000000 transparent;
}

.cart-items::-webkit-scrollbar {
    width: 4px;
}

.cart-items::-webkit-scrollbar-track {
    border-radius: 30px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: #0000009f;
    border-radius: 10px;
}

.cart-footer {
    flex-shrink: 0;
    padding: 16px 20px 20px 20px;
    border-top: 1px solid #eeeeee;
}

.cart-footer:empty {
    display: none;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 16px;
    margin-bottom: 14px;
}

.cart-total strong {
    font-size: 18px;
}

#buynow,
.continue-btn {
    color: #f2f2f2;
    background-color: #202020;
    text-decoration: none;
    padding: 10px 15px;
    border: 2px solid #000000;
    border-radius: 30px;
    width: 100%;
    display: block;
    margin: 0 auto 10px auto;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 14px;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.25);
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
    text-align: center;
}

@media (hover: hover) and (pointer: fine) {
    #buynow:hover,
    .continue-btn:hover {
        background-color: #ffffff;
        color: #111111;
    }
}

#buynow.is-pressed,
.continue-btn.is-pressed {
    background-color: #ffffff;
    color: #111111;
}

.continue-btn {
    margin: 0 auto;
}

.cart-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    position: relative;
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 16px;
    border: 1px solid #eeeeee;
    background: #ffffff;
}

.cart-item img {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.cart-item .name {
    font-size: 16px;
    margin: 0 0 3px 0;
    padding-right: 22px;
}

.cart-item-size {
    font-size: 13px;
    color: gray;
    font-family: 'Courier New', Courier, monospace;
    margin: 0 0 10px 0;
}

.cart-item-tag {
    display: inline-block;
    margin: 0 6px 10px 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: #a80808;
    padding: 3px 8px;
    border-radius: 999px;
}

.cart-item-tag-limited {
    color: #3a2a05;
    background: #caa227;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cart-item-price {
    font-size: 15px;
    font-weight: bold;
    white-space: nowrap;
}

.remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    line-height: 1;
    padding: 2px 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.remove-btn:hover {
    color: #000;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 9px;
}

.qty-btn {
    color: #f2f2f2;
    background-color: #202020;
    border: 1px solid #000000;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    box-sizing: border-box;
    font-family: 'Barlow Semi Condensed', 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 0.2s, color 0.2s;
}

@media (hover: hover) and (pointer: fine) {
    .qty-btn:hover {
        background-color: #ffffff;
        color: #111111;
    }
}

.qty-btn.is-pressed {
    background-color: #ffffff;
    color: #111111;
}

.qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (hover: hover) and (pointer: fine) {
    .qty-btn:disabled:hover {
        background-color: #202020;
        color: #f2f2f2;
    }
}

.quantity-controls span {
    font-size: 14px;
    font-weight: bold;
    min-width: 14px;
    text-align: center;
}

#opis {
    font-size: 15px;
    color: gray;
    font-family: 'Courier New', Courier, monospace;
}

/* ===== Responsywność koszyka (telefon) ===== */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
        border-radius: 0;
        border: none;
    }

    .cart-item {
        gap: 14px;
        padding: 14px;
    }

    .cart-item img {
        width: 84px;
        height: 84px;
    }

    .cart-item-bottom {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .quantity-controls {
        flex-shrink: 0;
        gap: 6px;
    }

    .cart-item-price {
        font-size: 14px;
    }

    .remove-btn {
        top: 8px;
        right: 8px;
    }
}
