body.woocommerce-cart {
    --petcart-bg: #faf8f4;
    --petcart-card: #fff;
    --petcart-text: #171717;
    --petcart-muted: #7f796f;
    --petcart-border: #e7e0d5;
    --petcart-soft: #f1eadc;
    --petcart-accent: #bf9959;
    --petcart-radius: 14px;
    background: var(--petcart-bg);
}

body.woocommerce-cart .entry-title,
body.woocommerce-cart .page-title {
    display: none !important;
}

body.woocommerce-cart .woocommerce {
    width: min(1400px, calc(100% - 40px));
    max-width: 1400px;
    margin: 0 auto;
    color: var(--petcart-text);
}

body.woocommerce-cart .woocommerce-notices-wrapper {
    margin-bottom: 18px;
}

.petcart-heading {
    margin: 12px 0 32px;
}

.petcart-heading h1 {
    margin: 0;
    font-size: clamp(38px, 4vw, 58px);
    line-height: .98;
    letter-spacing: -0.045em;
    font-weight: 800;
    color: var(--petcart-text);
}

.petcart-heading h1 span {
    color: #aaa398;
    font-size: .55em;
    letter-spacing: -0.025em;
    font-weight: 700;
    white-space: nowrap;
}

.petcart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 28px;
    align-items: start;
}

.petcart-main,
.petcart-aside,
body.woocommerce-cart .woocommerce-cart-form,
body.woocommerce-cart .cart-collaterals,
body.woocommerce-cart .cart_totals {
    min-width: 0;
}

.petcart-aside {
    position: sticky;
    top: 24px;
}

body.woocommerce-cart .cart-collaterals,
body.woocommerce-cart .cart-collaterals .cart_totals,
body.woocommerce-cart .cart_totals {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Tabela jako karty produktów */
body.woocommerce-cart .woocommerce-cart-form table.shop_table {
    display: block;
    overflow: hidden;
    margin: 0 !important;
    border: 1px solid var(--petcart-border) !important;
    border-radius: var(--petcart-radius);
    border-collapse: separate !important;
    background: var(--petcart-card);
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table thead {
    display: none !important;
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table tbody {
    display: block;
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) 132px 122px 34px;
    column-gap: 22px;
    row-gap: 10px;
    align-items: center;
    padding: 22px 28px;
    border-bottom: 1px solid #eee9e0;
    background: var(--petcart-card);
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item:last-of-type {
    border-bottom: 0;
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table td {
    border: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table td::before {
    display: none !important;
}

body.woocommerce-cart .product-thumbnail {
    grid-column: 1;
}

body.woocommerce-cart .product-thumbnail a {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    padding: 10px;
    border: 1px solid #eee7dc;
    border-radius: 12px;
    background: #fff;
}

body.woocommerce-cart .product-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    margin: 0 !important;
}

body.woocommerce-cart .product-name {
    grid-column: 2;
    min-width: 0;
    padding-left: 2px !important;
    text-align: left !important;
}

body.woocommerce-cart .product-name > a {
    color: var(--petcart-text) !important;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 750;
    text-decoration: none !important;
}

.petcart-item-meta,
.petcart-unit-price {
    margin-top: 5px;
    color: var(--petcart-muted);
    font-size: 14px;
    line-height: 1.35;
}

body.woocommerce-cart .product-price {
    display: none !important;
}

body.woocommerce-cart .product-quantity {
    grid-column: 3;
}

body.woocommerce-cart .product-subtotal {
    grid-column: 4;
    text-align: right !important;
    color: var(--petcart-text);
    font-size: 20px;
    font-weight: 800;
    white-space: nowrap;
}

body.woocommerce-cart .product-remove {
    grid-column: 5;
    grid-row: 1;
    display: grid !important;
    place-items: center;
}

body.woocommerce-cart .product-remove a.remove {
    display: grid !important;
    place-items: center;
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #9c958a !important;
    font-size: 28px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
}

body.woocommerce-cart .product-remove a.remove:hover {
    color: var(--petcart-text) !important;
    background: #f4f0e9 !important;
}

/* Ilość +/- */
body.woocommerce-cart .product-quantity .quantity {
    display: grid !important;
    grid-template-columns: 40px 48px 40px;
    align-items: center;
    width: 128px !important;
    min-width: 128px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--petcart-border);
    border-radius: 10px;
    background: #fff;
}

.petcart-qty-minus,
.petcart-qty-plus {
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--petcart-text);
    font: inherit;
    font-size: 20px;
    cursor: pointer;
}

body.woocommerce-cart .product-quantity input.qty {
    width: 48px !important;
    min-width: 0 !important;
    height: 46px !important;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--petcart-text) !important;
    font-size: 16px !important;
    font-weight: 750 !important;
    text-align: center !important;
    box-shadow: none !important;
    appearance: textfield;
}

body.woocommerce-cart .product-quantity input.qty::-webkit-outer-spin-button,
body.woocommerce-cart .product-quantity input.qty::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

/* Ukrywamy natywny wiersz kupon/aktualizacja; update nadal działa z JS */
body.woocommerce-cart td.actions {
    display: block !important;
    width: 1px !important;
    height: 1px !important;
    max-height: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap;
}

.petcart-cart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: -1px;
    padding: 20px 28px;
    border: 1px solid var(--petcart-border);
    border-top: 0;
    border-radius: 0 0 var(--petcart-radius) var(--petcart-radius);
    background: #fcfaf6;
}

body.woocommerce-cart .woocommerce-cart-form table.shop_table {
    border-radius: var(--petcart-radius) var(--petcart-radius) 0 0;
}

.petcart-back {
    color: var(--petcart-text) !important;
    font-weight: 750;
    text-decoration: none !important;
}

.petcart-cart-note {
    color: var(--petcart-muted);
    font-size: 14px;
    text-align: right;
}

/* Dodatki */
.petcart-addons {
    margin-top: 20px;
    padding: 22px 28px 24px;
    border-radius: var(--petcart-radius);
    background: var(--petcart-soft);
}

.petcart-addons h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    color: var(--petcart-text);
    font-size: 20px;
    font-weight: 800;
}

.petcart-addons__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.petcart-addon {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    min-height: 96px;
    padding: 12px 14px;
    border-radius: 11px;
    background: #fff;
}

.petcart-addon__image {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
}

.petcart-addon__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    margin: 0 !important;
}

.petcart-addon__title {
    display: block;
    color: var(--petcart-text) !important;
    font-size: 14px;
    line-height: 1.3;
    font-weight: 750;
    text-decoration: none !important;
}

.petcart-addon__price {
    margin-top: 4px;
    color: var(--petcart-muted);
    font-size: 13px;
}

.petcart-addon__button.button {
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 0 !important;
    border-radius: 9px !important;
    background: var(--petcart-text) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    box-shadow: none !important;
    white-space: nowrap;
}

/* Podsumowanie */
.petcart-totals {
    background: transparent !important;
}

.petcart-summary-card,
.petcart-trust-card {
    border: 1px solid var(--petcart-border);
    border-radius: var(--petcart-radius);
    background: #fff;
}

.petcart-summary-card {
    padding: 30px;
}

.petcart-summary-card h2 {
    margin: 0 0 24px !important;
    padding: 0 !important;
    color: var(--petcart-text);
    font-size: 28px !important;
    line-height: 1.1;
    font-weight: 800;
}

.petcart-summary-row,
.petcart-summary-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.petcart-summary-row {
    margin: 0 0 18px;
    color: var(--petcart-muted);
    font-size: 16px;
}

.petcart-summary-row strong {
    color: var(--petcart-text);
    font-weight: 750;
    white-space: nowrap;
}

.petcart-summary-total {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee9e0;
    color: var(--petcart-text);
    font-size: 18px;
    font-weight: 800;
}

.petcart-summary-total strong {
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

.petcart-checkout {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 64px;
    margin: 30px 0 0 !important;
    padding: 0 22px !important;
    border: 0 !important;
    border-radius: 10px;
    background: var(--petcart-accent);
    color: #111 !important;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-decoration: none !important;
    transition: transform .15s ease, filter .15s ease;
}

.petcart-checkout > span:first-child {
    grid-column: 2;
    white-space: nowrap;
}

.petcart-checkout > span:last-child {
    grid-column: 3;
    justify-self: start;
    margin-left: 18px;
    line-height: 1;
}

.petcart-checkout:hover {
    filter: brightness(.98);
    transform: translateY(-1px);
}

.petcart-payments {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.petcart-payments span {
    display: grid;
    place-items: center;
    min-height: 34px;
    padding: 5px 6px;
    border: 1px solid var(--petcart-border);
    border-radius: 7px;
    color: #5d5851;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.1;
    text-align: center;
}

.petcart-trust-card {
    margin-top: 16px;
    padding: 22px 26px;
}

.petcart-trust-card p {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    margin: 0 0 16px;
    color: var(--petcart-text);
    font-size: 14px;
    line-height: 1.45;
}

.petcart-trust-card p:last-child {
    margin-bottom: 0;
}


/* Mobilnie */
@media (max-width: 1050px) {
    .petcart-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
        gap: 20px;
    }

    body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item {
        grid-template-columns: 80px minmax(0, 1fr) 128px 108px 30px;
        column-gap: 18px;
        row-gap: 10px;
        padding: 20px;
    }

    body.woocommerce-cart .product-thumbnail a {
        width: 80px;
        height: 80px;
        padding: 8px;
    }

    .petcart-summary-card {
        padding: 24px;
    }

    .petcart-payments {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.woocommerce-cart .woocommerce {
        width: min(100% - 28px, 760px);
    }

    .petcart-heading {
        margin-bottom: 24px;
    }

    .petcart-grid {
        grid-template-columns: 1fr;
    }

    .petcart-aside {
        position: static;
    }

    .petcart-addons__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .petcart-heading h1 {
        font-size: 42px;
    }

    .petcart-heading h1 span {
        display: block;
        margin-top: 8px;
        font-size: 18px;
        letter-spacing: 0;
    }

    body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item {
        grid-template-columns: 72px minmax(0, 1fr) 30px;
        grid-template-rows: auto auto;
        column-gap: 16px;
        row-gap: 12px;
        padding: 18px;
    }

    body.woocommerce-cart .product-thumbnail {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
    }

    body.woocommerce-cart .product-thumbnail a {
        width: 72px;
        height: 72px;
        padding: 7px;
    }

    body.woocommerce-cart .product-name {
        grid-column: 2;
        grid-row: 1;
    }

    body.woocommerce-cart .product-name > a {
        font-size: 15px;
    }

    body.woocommerce-cart .product-remove {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }

    body.woocommerce-cart .product-quantity {
        grid-column: 2;
        grid-row: 2;
    }

    body.woocommerce-cart .product-subtotal {
        grid-column: 3;
        grid-row: 2;
        align-self: center;
        font-size: 16px;
    }

    body.woocommerce-cart .product-quantity .quantity {
        grid-template-columns: 34px 42px 34px;
        width: 110px !important;
        min-width: 110px;
        height: 42px;
    }

    body.woocommerce-cart .product-quantity input.qty {
        width: 42px !important;
        height: 40px !important;
    }

    .petcart-cart-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .petcart-cart-note {
        text-align: left;
    }

    .petcart-addons {
        padding: 20px;
    }

    .petcart-addon {
        grid-template-columns: 56px minmax(0, 1fr);
    }

    .petcart-addon__button.button {
        grid-column: 1 / -1;
        width: 100%;
        text-align: center;
    }

    .petcart-summary-card {
        padding: 22px;
    }

    .petcart-summary-total strong {
        font-size: 28px;
    }
}


/* v1.0.2 — stabilne odstępy niezależnie od stylów motywu */
body.woocommerce-cart .woocommerce-cart-form .product-thumbnail,
body.woocommerce-cart .woocommerce-cart-form .product-name,
body.woocommerce-cart .woocommerce-cart-form .product-quantity,
body.woocommerce-cart .woocommerce-cart-form .product-subtotal,
body.woocommerce-cart .woocommerce-cart-form .product-remove {
    box-sizing: border-box;
    margin: 0 !important;
}

body.woocommerce-cart .woocommerce-cart-form .product-thumbnail a,
body.woocommerce-cart .woocommerce-cart-form .product-thumbnail img {
    box-sizing: border-box !important;
}

body.woocommerce-cart .woocommerce-cart-form .product-name > a {
    display: inline-block;
    max-width: 100%;
}

/* v1.0.3 — mobile: pełna cena + spójne ikony */
/* Jeżeli po aktualizacji pozostał w cache starszy pasek darmowej dostawy, ukryj go. */
body.woocommerce-cart .petcart-progress {
    display: none !important;
}

.petcart-trust-icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    color: var(--petcart-text);
}

.petcart-trust-icon svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.petcart-trust-card p {
    align-items: start;
}

@media (max-width: 640px) {
    body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item {
        grid-template-columns: 72px minmax(110px, 1fr) max-content;
    }

    body.woocommerce-cart .product-subtotal {
        min-width: max-content;
        max-width: none;
        overflow: visible;
        padding-left: 6px !important;
        text-align: right !important;
        white-space: nowrap !important;
    }

    body.woocommerce-cart .product-subtotal .amount,
    body.woocommerce-cart .product-subtotal .woocommerce-Price-amount,
    body.woocommerce-cart .product-subtotal .woocommerce-Price-currencySymbol {
        white-space: nowrap !important;
    }
}

@media (max-width: 420px) {
    body.woocommerce-cart .woocommerce-cart-form table.shop_table tr.cart_item {
        grid-template-columns: 68px minmax(0, 1fr) 30px;
        grid-template-rows: auto auto auto;
        column-gap: 14px;
    }

    body.woocommerce-cart .product-thumbnail {
        grid-row: 1 / span 3;
    }

    body.woocommerce-cart .product-subtotal {
        grid-column: 2 / 4;
        grid-row: 3;
        justify-self: end;
        padding-left: 0 !important;
        font-size: 17px;
    }
}
