/* ==========================================================================
   CART PAGE
   ========================================================================== */

/* --- Empty Cart --- */

.cart-empty {
    padding: 100px 20px 120px;
}

.cart-empty__inner {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.cart-empty__title {
    font-family: var(--font-decorative);
    font-weight: 400;
    font-size: 56px;
    line-height: 1.1;
    color: var(--color-black);
    text-transform: uppercase;
    margin: 0;
    letter-spacing: 1px;
}

.cart-empty__text {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-black);
    margin: 0;
    max-width: 520px;
}

.cart-empty__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 55px;
    padding: 0 40px;
    margin-top: 12px;
    background-color: var(--color-red);
    color: var(--color-white);
    font-family: var(--font-decorative);
    font-weight: 400;
    font-size: 22px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-lg);
    box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.17);
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.cart-empty__btn:hover {
    opacity: 1;
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Hide WC default empty-cart notice + return-to-shop button when our custom template is active */
.woocommerce-cart .cart-empty.woocommerce-info,
.woocommerce-cart p.cart-empty,
.woocommerce-cart p.return-to-shop {
    display: none !important;
}


/* --- Free Shipping Bar --- */

.cart-shipping-bar {
    background-color: #EDEDED;
}

.cart-shipping-bar__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    height: 84px;
}

.cart-shipping-bar__text {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 18px;
    color: var(--color-black);
    text-transform: uppercase;
    text-align: center;
    margin: 0;
}

.cart-shipping-bar__btn {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 55px;
    padding: 0 36px;
    background-color: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-decorative);
    font-weight: 400;
    font-size: 22px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-lg);
    border: 0;
    box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.17);
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.cart-shipping-bar__btn:hover {
    opacity: 1;
    background-color: var(--color-white);
    color: var(--color-black);
}

/* --- Cart Layout (2-column) --- */

.cart-layout {
    display: grid;
    grid-template-columns: 57% 1fr;
    gap: 50px;
    align-items: start;
    padding-top: 89px;
    padding-bottom: 20px;
}

/* --- Cart Items Table --- */

.cart-items {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

.cart-items thead th {
    font-family: var(--font-primary);
    font-weight: 400 !important;
    font-size: 16px;
    color: var(--color-black);
    text-align: left;
    padding: 0 10px 18px;
    border-bottom: none;
    white-space: nowrap;
}

.cart-items__col-remove {
    width: 20px;
}

.cart-items__col-thumb {
    width: 82px;
}

.cart-items__col-name {
    width: auto;
}

.cart-items__col-price,
.cart-items__col-qty,
.cart-items__col-subtotal {
    width: 110px;
    text-align: center !important;
}

/* --- Cart Item Row --- */

.cart-items__row td {
    padding: 20px 10px;
    border-bottom: none;
    vertical-align: middle;
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    color: var(--color-black);
}

/* Remove button */
.cart-items__remove {
    width: 20px;
    padding-left: 0 !important;
    padding-right: 5px !important;
}

.cart-items__remove-btn,
.cart-items__remove-btn.remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    line-height: 1;
    color: var(--color-black) !important;
    text-decoration: none;
    opacity: 0.6;
    transition: opacity var(--transition);
    background: none !important;
}

.cart-items__remove-btn:hover,
.cart-items__remove-btn.remove:hover {
    opacity: 1;
    color: var(--color-red) !important;
    background: none !important;
}

/* Thumbnail */
.cart-items__thumb {
    width: 82px;
    padding: 20px 10px !important;
}

.cart-items__thumb a,
.cart-items__thumb img {
    display: block;
}

.cart-items__thumb img,
.woocommerce .cart-items__thumb img {
    width: 82px !important;
    height: 95px !important;
    max-width: 82px !important;
    min-width: 82px !important;
    object-fit: contain;
    /*background-color: var(--color-black);*/
    padding: 4px;
}

/* Product name */
.cart-items__name {
    font-family: var(--font-decorative) !important;
    font-size: 21px !important;
    text-transform: uppercase;
}

.cart-items__name a {
    color: var(--color-black);
    text-decoration: none;
}

.cart-items__name a:hover {
    opacity: 0.7;
}

.cart-items__name .variation {
    display: block;
    font-family: var(--font-primary);
    font-size: 13px;
    text-transform: none;
    color: var(--color-gray);
    margin-top: 4px;
}

/* Price & Subtotal */
.cart-items__price,
.cart-items__subtotal {
    text-align: center !important;
    white-space: nowrap;
}

/* Quantity */
.cart-items__qty {
    text-align: center !important;
}

.cart-items__qty .quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cart-items__qty .quantity .qty {
    width: 34px;
    height: 34px;
    text-align: center;
    border: 1px solid #999;
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    color: var(--color-black);
    background: transparent;
    outline: none;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.cart-items__qty .quantity .qty::-webkit-inner-spin-button,
.cart-items__qty .quantity .qty::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- Order Summary --- */

.cart-layout__summary {
    padding-top: 0;
}

.cart-summary__title {
    font-family: var(--font-primary) !important;
    font-weight: 700;
    font-size: 28px;
    color: var(--color-black);
    text-transform: uppercase;
    margin: 0 0 20px;
    line-height: 1.2;
}

.cart-summary {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--color-black);
}

.cart-summary th,
.cart-summary td {
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--color-black);
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-black);
    vertical-align: top;
}

.cart-summary th {
    font-weight: 700;
    text-align: left;
    width: 40%;
    white-space: nowrap;
}

.cart-summary td {
    font-weight: 400;
    text-align: left;
}

.cart-summary__row--total th,
.cart-summary__row--total td {
    border-bottom: none;
}

.cart-summary__row--total td {
    font-weight: 700;
}

.cart-summary__row--total td .includes_tax {
    font-weight: 400;
    font-size: 12px;
    display: inline;
}

/* Shipping row (rendered by WC cart-shipping.php) */
.cart-summary tr.woocommerce-shipping-totals th,
.cart-summary tr.woocommerce-shipping-totals td {
    font-family: var(--font-primary);
    font-size: 16px;
    color: var(--color-black);
    border-bottom: 1px solid var(--color-black);
    vertical-align: top;
}

.cart-summary tr.woocommerce-shipping-totals th {
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.cart-summary tr.woocommerce-shipping-totals td {
    padding-bottom: 18px;
}

.cart-summary .woocommerce-shipping-methods {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
}

.cart-summary .woocommerce-shipping-methods li {
    margin-bottom: 6px;
    font-size: 16px;
}

.cart-summary .woocommerce-shipping-methods li label {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    cursor: pointer;
}

.cart-summary .woocommerce-shipping-methods li input[type="radio"] {
    accent-color: var(--color-red);
    margin-right: 6px;
    vertical-align: middle;
}

.cart-summary .woocommerce-shipping-destination {
    font-size: 16px;
    margin: 8px 0;
    line-height: 1.5;
}

.cart-summary .shipping-calculator-button {
    font-size: 16px;
    color: var(--color-black);
    text-decoration: underline;
    font-family: var(--font-primary);
    cursor: pointer;
}

.cart-summary .shipping-calculator-form {
    margin-top: 12px;
}

.cart-summary .shipping-calculator-form .form-row {
    margin-bottom: 8px;
}

.cart-summary .shipping-calculator-form select,
.cart-summary .shipping-calculator-form input[type="text"] {
    width: 100%;
    height: 36px;
    border: 1px solid #CCC;
    font-family: var(--font-primary);
    font-size: 14px;
    padding: 0 10px;
}

.cart-summary .shipping-calculator-form button {
    background-color: var(--color-black);
    color: var(--color-white);
    font-family: var(--font-primary);
    font-size: 14px;
    height: 36px;
    padding: 0 20px;
    border: none;
    cursor: pointer;
    margin-top: 4px;
}

/* Coupon removal link */
.cart-summary .woocommerce-remove-coupon {
    color: var(--color-red);
    font-size: 14px;
}

/* Hide native proceed-to-checkout block (we have our own in .cart-actions).
   Kept in markup so 3rd-party plugins hooked on woocommerce_proceed_to_checkout
   (PayPal Express, Apple Pay, etc.) can still render inside it if needed. */
.cart-layout__summary .wc-proceed-to-checkout {
    display: none;
}

/* --- Bottom Actions Bar --- */

.cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    padding-bottom: 40px;
    gap: 20px;
    flex-wrap: wrap;
}

.cart-actions__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cart-actions__coupon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cart-actions__coupon-input {
    height: 55px;
    padding: 0 20px;
    border: none;
    font-family: var(--font-primary);
    background-color: var(--color-off-white);
    font-weight: 400;
    font-size: 16px;
    color: var(--color-black);
    outline: none;
    min-width: 160px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-actions__coupon-input::placeholder {
    color: var(--color-black);
    opacity: 0.6;
}

/* Shared button base */
.cart-actions__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 55px;
    padding: 0 30px;
    font-family: var(--font-decorative);
    font-weight: 400;
    font-size: 22px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 5px 5px 0 0 rgba(0, 0, 0, 0.17);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1;
}

.cart-actions__btn:hover {
    opacity: 1;
    background-color: var(--color-black);
    color: var(--color-white);
}

/* Coupon button */
.cart-actions__btn--coupon {
    background-color: var(--color-red);
    color: var(--color-white);
}

/* Update cart button — aktywny czerwony, szary tylko gdy disabled */
.cart-actions__btn--update {
    background-color: var(--color-red);
    color: var(--color-white);
}

.cart-actions__btn--update:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #B0B0B0;
}

.cart-actions__btn--update:disabled:hover {
    background-color: #B0B0B0;
    color: var(--color-white);
}

/* Checkout button */
.cart-actions__btn--checkout {
    background-color: var(--color-red);
    color: var(--color-white);
}

.cart-actions__right {
    display: flex;
    align-items: center;
}

/* --- Hide default WC elements we don't need --- */

.woocommerce-cart .entry-header,
.woocommerce-cart .entry-title {
    display: none;
}

.woocommerce-cart .entry-content {
    max-width: none;
    padding: 0;
    margin: 0;
}

.woocommerce-cart .site-main.container {
    max-width: none;
    padding: 0;
}

/* Override WC default table styles */
.woocommerce table.cart-items td::before,
.woocommerce table.cart-summary td::before {
    display: none !important;
}

/* WC default remove button override */
.woocommerce a.remove {
    color: #AA0100 !important;
    font-weight: 400;
}

.woocommerce a.remove:hover {
    color: var(--color-red) !important;
    background: transparent !important;
}

/* WC default table border overrides */
.woocommerce table.shop_table.cart-items {
    border: none;
    border-radius: 0;
}

.woocommerce table.shop_table.cart-summary {
    border-radius: 0;
}

.woocommerce table.shop_table.cart-items td,
.woocommerce table.shop_table.cart-items th {
    border-top: none;
    border-left: none;
    border-right: none;
}

/* WC quantity input overrides */
.woocommerce .cart-items .quantity .qty {
    width: 55px !important;
    height: 55px !important;
    min-height: auto !important;
    min-width: auto !important;
    padding: 0 !important;
    background-color: var(--color-off-white) !important;
    border-radius: 0 !important;
    border: none;
}

/* WC amount styling */
.woocommerce-cart .woocommerce-Price-amount {
    font-family: var(--font-primary);
}

/* Hide page title from page.php wrapper */
.woocommerce-cart .entry-header {
    display: none !important;
}

.woocommerce-cart .site-main {
    padding-top: 0;
    padding-bottom: 0;
}

.woocommerce-cart .site-main > article {
    padding: 0;
    margin: 0;
}

.woocommerce-cart .site-main > article > .entry-content {
    padding: 0;
    margin: 0;
    max-width: none;
}

/* ==========================================================================
   RESPONSIVE - TABLET (shipping bar stack)
   ========================================================================== */

@media (max-width: 900px) {

    .cart-shipping-bar__inner {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 16px 0;
        gap: 12px;
    }

    .cart-shipping-bar__text {
        grid-column: unset;
        grid-row: unset;
        justify-self: unset;
        text-align: center;
    }

    .cart-shipping-bar__btn {
        grid-column: unset;
        grid-row: unset;
        height: 46px;
        font-size: 18px;
        padding: 0 24px;
    }
}

/* ==========================================================================
   RESPONSIVE - MOBILE
   ========================================================================== */

@media (max-width: 768px) {

    .cart-shipping-bar__text {
        font-size: 14px;
    }

    /* Layout: single column */
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 20px;
    }

    /* Table: card-style rows — override WC responsive table */
    .cart-items thead {
        display: none !important;
    }

    .woocommerce table.shop_table.cart-items,
    .woocommerce table.shop_table.cart-items tbody,
    .cart-items,
    .cart-items tbody {
        display: block !important;
        width: 100%;
    }

    .woocommerce table.shop_table.cart-items tr.cart-items__row,
    .cart-items__row {
        display: grid !important;
        grid-template-columns: 82px 1fr;
        grid-template-rows: auto auto auto;
        gap: 8px 16px;
        padding: 20px 0;
        border-bottom: 1px solid #E0E0E0;
        position: relative;
    }

    .woocommerce table.shop_table.cart-items td,
    .cart-items__row td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        width: auto !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    /* WC responsive table pseudo-element label override */
    .woocommerce table.shop_table_responsive tr.cart-items__row td::before {
        display: none !important;
    }

    /* Remove button - top right, centered with product name */
    .cart-items__remove {
        position: absolute !important;
        top: 20px;
        right: 0;
        width: 24px !important;
        height: 24px;
        display: flex !important;
        align-items: center;
        justify-content: center;
        grid-column: unset;
        grid-row: unset;
    }

    .cart-items__remove .cart-items__remove-btn,
    .cart-items__remove .cart-items__remove-btn.remove {
        width: 24px;
        height: 24px;
        font-size: 22px;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Thumbnail - left, spans rows, image vertically centered */
    .woocommerce table.shop_table.cart-items td.cart-items__thumb,
    .cart-items__row td.cart-items__thumb {
        grid-column: 1;
        grid-row: 1 / 4;
        align-self: stretch;
        display: flex !important;
        align-items: center;
    }

    .cart-items__thumb img {
        width: 82px !important;
        height: 95px !important;
    }

    /* Name */
    .woocommerce table.shop_table.cart-items td.cart-items__name,
    .cart-items__row td.cart-items__name {
        grid-column: 2;
        grid-row: 1;
        font-size: 16px !important;
        padding-right: 40px !important;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Price - hidden on mobile (subtotal is the meaningful value) */
    .woocommerce table.shop_table.cart-items td.cart-items__price,
    .cart-items__row td.cart-items__price {
        display: none !important;
    }

    /* Qty */
    .cart-items__qty {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }

    /* Subtotal */
    .cart-items__subtotal {
        grid-column: 2;
        grid-row: 3;
        font-weight: 700;
    }

    /* Override WC default zebra-striping on mobile (rgba(0,0,0,.025) on every 2nd row) */
    .woocommerce-page table.shop_table_responsive.cart-items tr:nth-child(2n) td,
    .woocommerce table.shop_table_responsive.cart-items tr:nth-child(2n) td,
    .woocommerce-page table.shop_table.cart-items tr:nth-child(2n) td,
    .woocommerce table.shop_table.cart-items tr:nth-child(2n) td {
        background-color: transparent !important;
    }

    /* Summary */
    .cart-summary__title {
        font-size: 22px;
    }

    .cart-summary th,
    .cart-summary td {
        padding: 12px 14px;
        font-size: 14px;
    }

    /* Actions */
    .cart-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 30px;
    }

    .cart-actions__left {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-actions__coupon {
        flex-direction: column;
    }

    .cart-actions__coupon-input {
        width: 100%;
        min-width: 0;
        height: 48px;
        font-size: 14px;
    }

    .cart-actions__btn {
        width: 100%;
        height: 48px;
        font-size: 18px;
    }

    .cart-actions__right {
        width: 100%;
    }

    .cart-actions__btn--checkout {
        width: 100%;
    }
}
