/* ============================================
   SWCS Cart Page Styles
   ============================================ */

.swcs-cart-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    box-sizing: border-box;
}

/* === Cart Content Grid === */
.swcs-cart-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: flex-start;
}

/* === Cart Table === */
.swcs-cart-table {
    padding: 20px clamp(20px, 3vw, 60px);
    background-color: var(--color-fourth);
    border: 1px solid var(--color-sixth);
    border-radius: var(--radius);
}


.swcs-cart-table__header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    gap: 20px;
    padding: 15px 0;
    border-bottom: 1px solid var(--swcs-border, #e3e3e3);
}

.swcs-cart-table__col {
    font-family: var(--swcs-font-body, system-ui);
    font-size: 18px;
    font-weight: 600;
    color: var(--swcs-text, #1e1e1e);
}

.swcs-cart-table__col--center {
    text-align: center;
}

/* === Cart Item === */
.swcs-cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--swcs-border, #e3e3e3);
    align-items: center;
}
.swcs-cart-item:last-child {
    border: none !important;
    padding-bottom: 10px !important;
}
.swcs-cart-item__product {
    display: flex;
    align-items: center;
    gap: 20px;
}
.swcs-cart-item .qib-button-wrapper button {
    border-radius: 50% !important;
    border: none !important;
}
.swcs-cart-item .qib-button-wrapper .quantity input.input-text.qty.text {
    background-color: transparent !important;
    border: none !important;
}

.swcs-cart-item__image {
    width: 100px;
    height: 100px;
    background: #f5f5f5;
    border-radius: var(--swcs-radius, 15px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    flex-shrink: 0;
    overflow: hidden;
}

.swcs-cart-item__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.swcs-cart-item__image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.swcs-cart-item__info {
    flex: 1;
}

.swcs-cart-item__name {
    font-family: var(--swcs-font-body, system-ui);
    font-size: 18px;
    font-weight: 600;
    color: var(--swcs-text, #1e1e1e);
    margin: 0 0 5px 0;
}

.swcs-cart-item__name a {
    color: inherit;
    text-decoration: none;
}

.swcs-cart-item__name a:hover {
    color: var(--swcs-primary, #10059f);
}

/* Variation data */
.swcs-cart-item__info dl.variation {
    margin: 5px 0 0;
    font-size: 14px;
    color: #888;
}

.swcs-cart-item__info dl.variation dt {
    display: inline;
    font-weight: 500;
}

.swcs-cart-item__info dl.variation dd {
    display: inline;
    margin: 0 10px 0 0;
}

.swcs-cart-item__price,
.swcs-cart-item__total {
    font-family: var(--swcs-font-body, system-ui);
    font-size: 18px;
    font-weight: 600;
    color: var(--swcs-text, #1e1e1e);
    text-align: center;
}

/* Quantity input */
.swcs-cart-item__quantity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swcs-cart-item__quantity .quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
}

.swcs-cart-item__quantity input.qty,
.swcs-cart-item__quantity input[type="number"] {
    width: 70px !important;
    max-width: 70px !important;
    min-width: 70px !important;
    height: 44px;
    text-align: center;
    font-family: var(--swcs-font-body, system-ui);
    font-size: 16px;
    font-weight: 500;
    color: var(--swcs-text, #1e1e1e);
    border: none !important;
    background: #fff;
    padding: 0 10px;
    -moz-appearance: textfield;
    outline: none !important;
    box-shadow: none !important;
}

.swcs-cart-item__quantity input.qty::-webkit-outer-spin-button,
.swcs-cart-item__quantity input.qty::-webkit-inner-spin-button,
.swcs-cart-item__quantity input[type="number"]::-webkit-outer-spin-button,
.swcs-cart-item__quantity input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
    display: none;
}

/* Remove button */
.swcs-cart-item__remove {
    text-align: center;
}

.swcs-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: #b5b5b5;
    cursor: pointer;
    transition: color 0.3s ease;
    text-decoration: none;
}

.swcs-remove-btn:hover {
    color: #e74c3c;
}

/* === Cart Sidebar === */
.swcs-cart-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === Coupon === */
.swcs-cart-coupon {
    display: flex;
    gap: 0;
    background: #fff;
    border: 1px solid var(--swcs-border, #e3e3e3);
    border-radius: var(--swcs-radius, 15px);
    overflow: hidden;
    padding: 10px 10px 10px 20px;
    border-radius: var(--radius);
    background-color: var(--color-fourth);
    width: 320px;
    max-width: 100%;
}

.swcs-cart-coupon__input {
    flex: 1;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    color: var(--swcs-text, #1e1e1e);
    border: none;
    padding: 10px 0;
    background-color: transparent;
    border: transparent;
    outline: none;
    font-size: .85rem;
    line-height: 120%;
}

.swcs-cart-coupon__input::placeholder {
    color: #b5b5b5;
}

.swcs-cart-coupon__btn {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background-color: var(--color-main);
    border-radius: var(--radius);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.swcs-goto {
    margin-left: auto;
    display: block;
}

.swcs-cart-coupon__btn:hover {
    background-color: var(--swcs-primary-hover, #0a0470);
    color: #fff;
}

/* === Empty Cart === */
.swcs-cart-empty {
    text-align: center;
    padding: 80px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.swcs-cart-empty__icon {
    margin-bottom: 30px;
    color: var(--swcs-primary, #10059f);
}

.swcs-cart-empty__title {
    font-family: var(--swcs-font-heading, system-ui);
    font-size: 36px;
    font-weight: 600;
    color: var(--swcs-text, #1e1e1e);
    margin: 0 0 15px;
}

.swcs-cart-empty__text {
    font-family: var(--swcs-font-body, system-ui);
    font-size: 18px;
    font-weight: 400;
    color: #666;
    margin: 0 0 8px;
}

.swcs-cart-empty__subtext {
    font-family: var(--swcs-font-body, system-ui);
    font-size: 16px;
    font-weight: 400;
    color: #888;
    margin: 0 0 40px;
}

.swcs-cart-empty__actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Fix: Razem z VAT - tekst "zawiera XX zl VAT" pod kwota === */
.swcs-summary__row--total span:nth-child(2) {
    text-align: right !important;
}

.swcs-summary__row--total small {
    display: block !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    color: #666 !important;
    margin-top: 2px;
    line-height: 1.3;
}

/* === Fix: Ukryj przycisk Apaczki na koszyku (dziala tylko na checkout) === */
.woocommerce-cart .apaczka_pl_after_rate_btn,
.woocommerce-cart #apaczka_pl_geowidget_classic {
    display: none !important;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .swcs-cart-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

 
}

@media (max-width: 768px) {
    .swcs-cart-table__header {
        display: none;
    }

    .swcs-cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 20px 0;
        position: relative;
    }

    .swcs-cart-item__product {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .swcs-cart-item__image {
        width: 80px;
        height: 80px;
    }

    .swcs-cart-item__price,
    .swcs-cart-item__total {
        text-align: left;
    }

    .swcs-cart-item__price::before {
        content: attr(data-label) ' ';
        font-weight: 400;
    }

    .swcs-cart-item__total::before {
        content: attr(data-label) ' ';
        font-weight: 400;
    }

    .swcs-cart-item__quantity {
        justify-content: flex-start;
    }

    .swcs-cart-item__remove {
        position: absolute;
        top: 20px;
        right: 0;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .swcs-cart-coupon {
        flex-direction: column;
    }

    .swcs-cart-coupon__btn {
        width: 100%;
        text-align: center;
    }

    .swcs-cart-empty__title {
        font-size: 24px;
    }

    .swcs-cart-empty__actions {
        flex-direction: column;
    }

    .swcs-cart-empty__actions .swcs-btn {
        width: 100%;
    }
}
