/* Force full width on cart page by suppressing sidebar and expanding content area */
body.woocommerce-cart #primary {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.woocommerce-cart #secondary {
    display: none !important;
}

/* Safe wrapper constraint inside the theme's content container */
body.woocommerce-cart .woocommerce {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 15px !important;
    box-sizing: border-box !important;
}

/* Clearfix for parent */
body.woocommerce-cart .woocommerce::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* Full width table on desktop, with totals aligned right underneath */
body.woocommerce-cart .woocommerce-cart-form {
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin: 0 0 30px 0 !important;
}

@media (min-width: 769px) {
    body.woocommerce-cart .cart-collaterals {
        width: 480px !important;
        float: right !important;
        clear: both !important;
        margin-top: 20px !important;
    }

    /* Force standard table layout on desktop to override theme responsive collapses */
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents {
        display: table !important;
        width: 100% !important;
    }
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents thead {
        display: table-header-group !important;
    }
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents tbody {
        display: table-row-group !important;
    }
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents tr {
        display: table-row !important;
    }
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents th,
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents td {
        display: table-cell !important;
    }
    body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents td::before {
        display: none !important;
        content: none !important;
    }
}

@media (max-width: 768px) {
    body.woocommerce-cart .woocommerce {
        padding: 0 8px !important;
    }

    body.woocommerce-cart .cart-collaterals {
        width: 100% !important;
        float: none !important;
        clear: both !important;
        margin-top: 20px !important;
    }

    body.woocommerce-cart .cart_totals {
        padding: 18px 14px !important;
    }

    /* ---- Hide ALL theme td::before pseudo-elements on mobile cart ---- */
    body.woocommerce-cart table.shop_table td::before,
    body.woocommerce-cart table.shop_table th::before,
    body.woocommerce-cart .cart_totals table.shop_table td::before,
    body.woocommerce-cart .cart_totals table.shop_table th::before {
        display: none !important;
        content: none !important;
    }

    /* ---- Force LEFT text alignment on mobile (Astra defaults to right) ---- */
    body.woocommerce-cart table.shop_table td,
    body.woocommerce-cart table.shop_table td.product-name,
    body.woocommerce-cart table.shop_table td.product-name * {
        text-align: left !important;
    }

    /* ---- SHIPPING OPTIONS: Fix radio button collision ---- */
    body.woocommerce-cart .cart_totals table.shop_table tr.shipping,
    body.woocommerce-cart table.shop_table tr.shipping {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        padding: 12px 0 !important;
        width: 100% !important;
    }

    body.woocommerce-cart .cart_totals table.shop_table tr.shipping th,
    body.woocommerce-cart table.shop_table tr.shipping th {
        width: 100% !important;
        display: block !important;
        text-align: left !important;
        padding: 0 0 4px 0 !important;
    }

    body.woocommerce-cart .cart_totals table.shop_table tr.shipping td,
    body.woocommerce-cart table.shop_table tr.shipping td {
        width: 100% !important;
        min-width: 0 !important;
        display: block !important;
        padding: 0 !important;
        text-align: left !important;
        word-break: normal !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
    }

    /* Bare ID selectors — specificity 100, beats ANY class-based Astra rule */
    #shipping_method#shipping_method {
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        width: 100% !important;
    }

    /* CSS Grid — 24px column for radio, rest for label */
    #shipping_method#shipping_method li {
        display: grid !important;
        grid-template-columns: 24px 1fr !important;
        gap: 0 8px !important;
        align-items: start !important;
        margin-bottom: 14px !important;
        padding: 0 !important;
        list-style: none !important;
        text-indent: 0 !important;
    }

    /* Force NATIVE radio visible — doubled ID beats any Astra selector */
    #shipping_method#shipping_method li input[type="radio"] {
        position: static !important;
        left: auto !important;
        margin: 3px 0 0 0 !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        -webkit-appearance: auto !important;
        appearance: auto !important;
        opacity: 1 !important;
        visibility: visible !important;
        clip: auto !important;
        clip-path: none !important;
        justify-self: center !important;
        pointer-events: auto !important;
        transform: none !important;
    }

    #shipping_method#shipping_method li label {
        display: block !important;
        line-height: 1.5 !important;
        cursor: pointer !important;
        margin: 0 !important;
        padding: 0 !important;
        word-break: normal !important;
        overflow-wrap: normal !important;
        white-space: normal !important;
        text-align: left !important;
    }

    /* NUKE Astra's fake radio — doubled ID = specificity 2-0-x, unbeatable */
    #shipping_method#shipping_method li label::before,
    #shipping_method#shipping_method li label::after,
    #shipping_method#shipping_method li input[type="radio"]::before,
    #shipping_method#shipping_method li input[type="radio"]::after {
        display: none !important;
        content: none !important;
        width: 0 !important;
        height: 0 !important;
    }

    /* Paczkomat button + extra elements — span both grid columns */
    #shipping_method li button,
    #shipping_method li .button,
    #shipping_method li a.button,
    #shipping_method li > *:not(input):not(label) {
        grid-column: 1 / -1 !important;
        display: block !important;
        width: 100% !important;
        margin-top: 8px !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
}

/* Page heading */
body.woocommerce-cart h1.entry-title {
    max-width: 1200px !important;
    margin: 0 auto 24px auto !important;
    padding: 0 15px !important;
    font-size: 0 !important; /* Ukrywamy oryginalny tekst "Koszyk" */
    font-weight: 800 !important;
    color: inherit !important;
    box-sizing: border-box !important;
}

body.woocommerce-cart:not(.wmc-cart-empty):not(:has(.wmc-empty-cart-page)) h1.entry-title::before {
    content: "Twój koszyk" !important;
    font-size: 26px !important; /* Wyświetlamy nasz tekst w rozmiarze 26px */
}

/* ============================================================
   CART TABLE
   ============================================================ */

body.woocommerce-cart table.shop_table.woocommerce-cart-form__contents {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #ffffff !important;
    border: 1px solid var(--ast-border-color, #e2e8f0) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
    margin-bottom: 30px !important;
}

/* Table head */
body.woocommerce-cart table.shop_table thead th {
    background: #f8fafc !important;
    padding: 14px 18px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
    border-bottom: 2px solid var(--ast-border-color, #e2e8f0) !important;
    text-align: left !important;
}

body.woocommerce-cart table.shop_table thead th.product-subtotal {
    text-align: right !important;
}

body.woocommerce-cart table.shop_table thead th.product-remove {
    text-align: center !important;
    width: 40px !important;
}

/* Table body rows */
body.woocommerce-cart table.shop_table tbody tr {
    transition: background 0.15s ease !important;
}

body.woocommerce-cart table.shop_table tbody tr:hover {
    background: #f8fafc !important;
}

body.woocommerce-cart table.shop_table tbody td {
    padding: 16px 18px !important;
    border-bottom: 1px solid var(--ast-global-color-4, #f1f5f9) !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    color: inherit !important;
}

/* Last row — no border */
body.woocommerce-cart table.shop_table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Remove button */
body.woocommerce-cart table.shop_table .product-remove a.remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: var(--ast-global-color-4, #f1f5f9) !important;
    color: #94a3b8 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

body.woocommerce-cart table.shop_table .product-remove a.remove:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
}

/* Product thumbnail */
body.woocommerce-cart table.shop_table td.product-thumbnail img {
    width: 70px !important;
    height: 70px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: 1px solid var(--ast-border-color, #e2e8f0) !important;
}

/* Product name */
body.woocommerce-cart table.shop_table td.product-name a {
    font-weight: 600 !important;
    color: inherit !important;
    text-decoration: none !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

body.woocommerce-cart table.shop_table td.product-name a:hover {
    color: var(--wmc-primary) !important;
}

/* Product meta/variation data under name */
body.woocommerce-cart table.shop_table td.product-name .variation {
    font-size: 12px !important;
    color: #64748b !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
}

body.woocommerce-cart table.shop_table td.product-name .variation dt {
    display: inline !important;
    float: none !important;
    clear: none !important;
    font-weight: 400 !important;
    margin-right: 6px !important;
    padding: 0 !important;
    color: #64748b !important;
}

body.woocommerce-cart table.shop_table td.product-name .variation dt::after {
    content: ":" !important;
}

body.woocommerce-cart table.shop_table td.product-name .variation dd {
    display: inline !important;
    float: none !important;
    margin-right: 0 !important;
    padding: 0 !important;
    color: inherit !important;
    font-weight: 700 !important;
}

body.woocommerce-cart table.shop_table td.product-name .variation dd p {
    display: inline !important;
    margin: 0 !important;
    font-weight: 700 !important;
}

body.woocommerce-cart table.shop_table td.product-name .variation dd::after {
    content: "" !important;
    display: block !important;
    margin-bottom: 6px !important;
}

/* Quantity input */
body.woocommerce-cart table.shop_table td.product-quantity .quantity {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

body.woocommerce-cart table.shop_table td.product-quantity .quantity input.qty {
    width: 68px !important;
    height: 36px !important;
    border: 1px solid var(--ast-border-color, #e2e8f0) !important;
    border-radius: 8px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: inherit !important;
    padding: 0 4px 0 10px !important;
    background: #ffffff !important;
    transition: border-color 0.2s ease !important;
}

body.woocommerce-cart table.shop_table td.product-quantity .quantity input.qty:focus {
    border-color: var(--wmc-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(var(--wmc-primary-rgb), 0.1) !important;
}

/* Price columns */
body.woocommerce-cart table.shop_table td.product-price,
body.woocommerce-cart table.shop_table td.product-subtotal,
body.woocommerce-cart table.shop_table td.product-price .amount,
body.woocommerce-cart table.shop_table td.product-subtotal .amount {
    font-weight: 700 !important;
    color: inherit !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

body.woocommerce-cart table.shop_table td.product-subtotal {
    text-align: right !important;
    font-size: 15px !important;
}

body.woocommerce-cart table.shop_table td.product-subtotal .amount {
    color: inherit !important; /* Default subtotal color for non-configured products is near-black */
}

/* PC Configurator price breakdown elements on cart page */
body.woocommerce-cart .pc-base-price-row,
body.woocommerce-cart .pc-base-price-row .amount,
body.woocommerce-cart .pc-base-subtotal-row,
body.woocommerce-cart .pc-base-subtotal-row .amount {
    color: #64748b !important; /* Base price is gray */
    font-weight: 600 !important;
}

body.woocommerce-cart .pc-options-price-row,
body.woocommerce-cart .pc-options-price-row .amount,
body.woocommerce-cart .pc-options-subtotal-row,
body.woocommerce-cart .pc-options-subtotal-row .amount {
    color: var(--wmc-primary) !important; /* Options are blue */
    font-weight: 600 !important;
}

body.woocommerce-cart .pc-total-price-row,
body.woocommerce-cart .pc-total-price-row .amount,
body.woocommerce-cart .pc-total-subtotal-row,
body.woocommerce-cart .pc-total-subtotal-row .amount {
    color: inherit !important; /* Total sum is near-black */
    font-weight: 800 !important;
}


/* Coupon / Update row */
body.woocommerce-cart table.shop_table td.actions {
    padding: 20px 18px !important;
    border-top: 1px solid var(--ast-border-color, #e2e8f0) !important;
    border-bottom: none !important;
    background: #f8fafc !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: inherit !important;
    margin: 0 !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon input#coupon_code {
    height: 38px !important;
    padding: 0 14px !important;
    border: 1px solid var(--ast-border-color, #e2e8f0) !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    color: inherit !important;
    width: auto !important;
    min-width: 180px !important;
    background: #fff !important;
    transition: border-color 0.2s ease !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon input#coupon_code:focus {
    border-color: var(--wmc-primary) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(var(--wmc-primary-rgb), 0.1) !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon button[name="apply_coupon"],
body.woocommerce-cart table.shop_table td.actions button[name="update_cart"] {
    height: 38px !important;
    padding: 0 18px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon button[name="apply_coupon"] {
    background: var(--wmc-primary) !important;
    color: #ffffff !important;
    border-color: var(--wmc-primary) !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon button[name="apply_coupon"]:hover {
    opacity: 0.88 !important;
}

body.woocommerce-cart table.shop_table td.actions button[name="update_cart"] {
    background: var(--ast-global-color-4, #f1f5f9) !important;
    color: inherit !important;
    border-color: var(--ast-border-color, #e2e8f0) !important;
    float: right !important;
}

body.woocommerce-cart table.shop_table td.actions button[name="update_cart"]:hover {
    background: var(--ast-border-color, #e2e8f0) !important;
    color: inherit !important;
}

/* ============================================================
   CART TOTALS
   ============================================================ */

body.woocommerce-cart .cart-collaterals {
    margin-top: 0 !important;
}

body.woocommerce-cart .cart_totals {
    background: #ffffff !important;
    border: 1px solid var(--ast-border-color, #e2e8f0) !important;
    border-radius: 14px !important;
    padding: 26px 28px !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06) !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    box-sizing: border-box !important;
}

body.woocommerce-cart .cart_totals h2 {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: inherit !important;
    margin: 0 0 20px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid var(--ast-global-color-4, #f1f5f9) !important;
}

body.woocommerce-cart .cart_totals table.shop_table {
    width: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    background: transparent !important;
}

body.woocommerce-cart .cart_totals table.shop_table th,
body.woocommerce-cart .cart_totals table.shop_table td {
    padding: 12px 0 !important;
    border-bottom: 1px solid var(--ast-global-color-4, #f1f5f9) !important;
    font-size: 14px !important;
    background: transparent !important;
}

body.woocommerce-cart .cart_totals table.shop_table th {
    font-weight: 600 !important;
    color: inherit !important;
    text-align: left !important;
}

body.woocommerce-cart .cart_totals table.shop_table td {
    text-align: right !important;
    font-weight: 600 !important;
    color: inherit !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total th,
body.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: inherit !important;
    border-bottom: none !important;
    padding-top: 16px !important;
}

body.woocommerce-cart .cart_totals table.shop_table tr.order-total td {
    color: var(--wmc-primary) !important;
}

/* Shipping calculation form */
body.woocommerce-cart .cart_totals .woocommerce-shipping-calculator {
    margin-top: 10px !important;
    font-size: 13px !important;
}

/* Proceed to checkout button */
body.woocommerce-cart .wc-proceed-to-checkout {
    margin-top: 20px !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 15px 20px !important;
    background: var(--wmc-primary) !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    text-align: center !important;
    transition: opacity 0.2s ease, transform 0.15s ease !important;
    box-shadow: 0 4px 14px rgba(var(--wmc-primary-rgb), 0.35) !important;
}

body.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}

/* ============================================================
   NOTICES (e.g. after coupon applied, errors, updates)
   ============================================================ */

body.woocommerce-cart .woocommerce-notices-wrapper {
    width: 100% !important;
    margin-bottom: 20px !important;
    clear: both !important;
}

/* Base notice container - high specificity beats product-configurator footer styles */
html body.woocommerce-cart .woocommerce-message,
html body.woocommerce-cart .woocommerce-info,
html body.woocommerce-cart .woocommerce-error,
html body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message,
html body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info,
html body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 10px !important;
    padding: 16px 20px 16px 52px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    margin: 0 0 16px 0 !important;
    position: relative !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    text-align: left !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    clear: both !important;
}

/* Success notice */
body.woocommerce-cart .woocommerce-message,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message {
    background-color: #f0fdf4 !important;
    border: 1px solid #dcfce7 !important;
    border-left: 5px solid #22c55e !important;
    color: #14532d !important;
}

body.woocommerce-cart .woocommerce-message::before,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-message::before {
    content: "\f147" !important; /* dashicons-yes */
    font-family: dashicons !important;
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #22c55e !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Info notice */
body.woocommerce-cart .woocommerce-info,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info {
    background-color: #eff6ff !important;
    border: 1px solid #dbeafe !important;
    border-left: 5px solid #3b82f6 !important;
    color: #1e3a8a !important;
}

body.woocommerce-cart .woocommerce-info::before,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info::before {
    content: "\f348" !important; /* dashicons-info */
    font-family: dashicons !important;
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #3b82f6 !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Error notice */
body.woocommerce-cart .woocommerce-error,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error {
    background-color: #fef2f2 !important;
    border: 1px solid #fee2e2 !important;
    border-left: 5px solid #ef4444 !important;
    color: #991b1b !important;
    list-style: none !important;
}

body.woocommerce-cart .woocommerce-error::before,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error::before {
    content: "\f534" !important; /* dashicons-warning */
    font-family: dashicons !important;
    position: absolute !important;
    left: 18px !important;
    top: 18px !important;
    transform: none !important;
    color: #ef4444 !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

body.woocommerce-cart .woocommerce-error li,
body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-error li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Button inside notice (e.g. 'Cofnij' when removing an item) */
body.woocommerce-cart .woocommerce-message .button,
body.woocommerce-cart .woocommerce-info .button {
    float: right !important;
    margin: -3px 0 -3px 15px !important;
    background: #22c55e !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    padding: 6px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    border: none !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease !important;
}

body.woocommerce-cart .woocommerce-message .button:hover,
body.woocommerce-cart .woocommerce-info .button:hover {
    opacity: 0.9 !important;
    color: #ffffff !important;
}

/* Inline coupon error notice right under the coupon input field */
body.woocommerce-cart table.shop_table td.actions .coupon .coupon-error-notice {
    flex-basis: 100% !important;
    width: fit-content !important;
    max-width: 100% !important;
    text-align: left !important;
    margin: 10px 0 0 0 !important;
    padding: 8px 14px !important;
    background: #fef2f2 !important;
    border: 1px solid #fee2e2 !important;
    border-left: 4px solid #ef4444 !important;
    border-radius: 6px !important;
    color: #991b1b !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    line-height: 1.4 !important;
}

body.woocommerce-cart table.shop_table td.actions .coupon input#coupon_code.has-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

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

/* Suppress default WooCommerce empty cart paragraph and notices (custom .wmc-empty-cart-page is used instead) */
html body.woocommerce-cart p.cart-empty,
html body.woocommerce-cart .cart-empty.woocommerce-info,
html body.woocommerce-cart .woocommerce-info.cart-empty,
html body.woocommerce-cart .woocommerce-notices-wrapper .cart-empty,
html body.woocommerce-cart .woocommerce-notices-wrapper .woocommerce-info.cart-empty {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0 !important;
}

body.woocommerce-cart .return-to-shop a.button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 16px !important;
    padding: 11px 22px !important;
    background: var(--wmc-primary) !important;
    color: #ffffff !important;
    border-radius: 9px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: opacity 0.2s ease !important;
}

body.woocommerce-cart .return-to-shop a.button:hover {
    opacity: 0.88 !important;
    color: #fff !important;
}

/* ================================================================
   CART PAGE — Rename "Cena" column header to "Cena jedn."
   The original th text is hidden with font-size:0 and replaced via ::after
   Both must use the same size as other th (11px uppercase)
   ================================================================ */
body.woocommerce-cart table.shop_table thead th.product-price {
    font-size: 0 !important; /* hide original "Cena" text */
}
body.woocommerce-cart table.shop_table thead th.product-price::after {
    content: 'Cena jedn.' !important;
    font-size: 11px !important;   /* match other th: 11px */
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.07em !important;
}

/* ================================================================
   CART PAGE — PC Configurator price breakdown color differentiation
   CENA JEDN. column: base=gray, options=blue, total=near-black
   These rules are in cart-page.css which IS loaded on /koszyk/
   ================================================================ */

/* Base price row — slate gray */
body.woocommerce-cart .pc-base-price-row {
    color: #64748b !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}
body.woocommerce-cart .pc-base-price-row * {
    color: #64748b !important;
}

/* Options price row — primary blue */
body.woocommerce-cart .pc-options-price-row {
    color: var(--wmc-primary, #2563eb) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
}
body.woocommerce-cart .pc-options-price-row * {
    color: var(--wmc-primary, #2563eb) !important;
}

/* Total price row — near-black bold */
body.woocommerce-cart .pc-total-price-row {
    color: inherit !important;
    font-weight: 800 !important;
    font-size: 14px !important;
}
body.woocommerce-cart .pc-total-price-row * {
    color: inherit !important;
}

/* ============================================================
   EMPTY CART PAGE WMC
   ============================================================ */

.wmc-empty-cart-page {
    display: block !important;
    text-align: center;
    max-width: 750px;
    margin: 40px auto;
    padding: 20px;
    font-family: inherit;
}

.wmc-empty-cart-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 14px;
}

.wmc-empty-icon {
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--wmc-primary, #2563eb);
}

.wmc-line-left, .wmc-line-right {
    width: 32px;
    height: 2px;
    background-color: var(--wmc-primary, #2563eb);
    display: inline-block;
}

.wmc-empty-cart-title {
    font-size: 2rem;
    font-weight: 700;
    color: inherit;
    margin-bottom: 12px;
    line-height: 1.2;
}

.wmc-empty-cart-text {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 30px;
}

.wmc-empty-cart-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--wmc-primary, #2563eb) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    padding: 12px 28px !important;
    border-radius: var(--wmc-radius, 8px) !important;
    text-decoration: none;
    text-transform: uppercase;
    border: none !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
}

.wmc-empty-cart-btn:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.wmc-empty-cart-btn:active {
    transform: scale(0.98) !important;
}

.wmc-btn-icon {
    width: 18px;
    height: 18px;
}

/* Ukrycie domyślnego napisu "Koszyk" z motywu (np. Astra) TYLKO gdy koszyk jest pusty */
body.woocommerce-cart.wmc-cart-empty .ast-article-single .entry-title,
body.woocommerce-cart.wmc-cart-empty .entry-header,
body.woocommerce-cart:has(.wmc-empty-cart-page) .ast-article-single .entry-title,
body.woocommerce-cart:has(.wmc-empty-cart-page) .entry-header {
    display: none !important;
}

/* ================================================================
   PC CONFIGURATOR OPTIONS — MOBILE ONLY
   No changes on desktop — all styling inherited from theme.
   ================================================================ */
@media (max-width: 768px) {
    /* Prevent cart table from overflowing viewport */
    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart table.shop_table {
        max-width: 100% !important;
        overflow: hidden !important;
        table-layout: fixed !important;
        word-wrap: break-word !important;
    }

    /* Cart totals (shipping summary) — auto layout so shipping text doesn't break per-character */
    body.woocommerce-cart .cart_totals table.shop_table {
        table-layout: auto !important;
        word-wrap: normal !important;
    }

    body.woocommerce-cart table.shop_table td.product-name {
        overflow: hidden !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* PC Configurator wrapper */
    .pc-cart-configs-wrapper {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    /* Each option on its own line, children flow inline */
    .pc-cart-config-item {
        display: block !important;
        padding: 2px 0 !important;
        line-height: 1.5 !important;
        font-size: 12px !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    /* All children inline so separator stays next to name */
    .pc-config-name,
    .pc-config-separator,
    .pc-config-value,
    .pc-config-price {
        display: inline !important;
    }

    /* Option label — bold, prominent, MUST wrap on mobile */
    .pc-config-name {
        font-weight: 700 !important;
        white-space: normal !important;
    }

    /* Option value — normal weight, less prominent */
    .pc-config-value {
        font-weight: 400 !important;
    }

    /* Option price — slight spacing from value */
    .pc-config-price {
        margin-left: 6px !important;
    }
}


