/**
 * PP Cart Custom - Single Responsive Cart Template
 * Replaces JetWoo Builder dual-widget cart layout
 */

/* =============================================================================
 * Main container - constrain to 1240px
 * =========================================================================== */

.pp-cart {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Spacing between cart sections */
.pp-cart .woocommerce-cart-form {
    margin-bottom: 40px;
}

.pp-cart .checkout-bestsellers-carousel {
    margin-bottom: 40px;
}

.woocommerce .cart-collaterals {
    margin-top: 40px;
}

/* =============================================================================
 * Desktop Table Layout
 * =========================================================================== */

.pp-cart .pp-cart-desktop {
    width: 100%;
    border: none !important;
    border-collapse: collapse;
    background: #fff !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.pp-cart .pp-cart-desktop thead th {
    padding: 12px 15px;
    font-size: 14px;
    font-weight: 600;
    color: #3E3E3E;
    background: #fff !important;
    border: none !important;
    border-bottom: 2px solid #EAEAEA !important;
    text-align: center;
}

.pp-cart .pp-cart-desktop thead th.product-thumbnail {
    width: 120px;
    text-align: center;
}

.pp-cart .pp-cart-desktop thead th.product-name {
    width: 220px;
    text-align: center;
}

.pp-cart .pp-cart-desktop thead th.product-price {
    width: 180px;
    text-align: center;
}

.pp-cart .pp-cart-desktop thead th.product-quantity {
    width: 180px;
    text-align: center;
}

.pp-cart .pp-cart-desktop thead th.product-subtotal {
    width: 180px;
    text-align: center;
}

.pp-cart .pp-cart-desktop thead th.product-remove {
    width: 40px;
}

.pp-cart .pp-cart-desktop tbody tr.cart_item {
    background: #fff !important;
}

.pp-cart .pp-cart-desktop tbody td {
    padding: 15px;
    vertical-align: middle;
    background: #fff !important;
    border: none !important;
    border-bottom: 1px solid #EAEAEA !important;
}

/* Thumbnail */
.pp-cart .pp-cart-desktop td.product-thumbnail {
    text-align: center;
}

.pp-cart .pp-cart-desktop td.product-thumbnail img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
}

/* Product name - centered with SKU and badges */
.pp-cart .pp-cart-desktop td.product-name {
    text-align: center;
}

.pp-cart .pp-cart-desktop td.product-name a {
    color: #00688D;
    font-size: 15px;
    font-weight: 600;
    text-decoration: underline;
}

.pp-cart .pp-cart-desktop td.product-name a:hover {
    color: #00506C;
}

.pp-cart .pp-cart-desktop td.product-name .cart-item-sku {
    font-size: 12px;
    color: #888;
    display: block;
    margin-top: 2px;
}

.pp-cart .pp-cart-desktop td.product-name .cart-item-badges {
    margin-top: 5px;
}

/* Unit price - centered */
.pp-cart .pp-cart-desktop td.product-price {
    text-align: center;
}

.pp-cart .pp-cart-desktop td.product-price .custom-price-without-vat {
    display: block !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #00688D !important;
    line-height: 1.4 !important;
}

.pp-cart .pp-cart-desktop td.product-price .custom-price-with-vat {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #3E3E3E !important;
    margin-top: 2px;
}

.pp-cart .pp-cart-desktop td.product-price br {
    display: none !important;
}

.pp-cart .pp-cart-desktop td.product-price .custom-price-without-vat .woocommerce-Price-amount,
.pp-cart .pp-cart-desktop td.product-price .custom-price-without-vat .woocommerce-Price-currencySymbol,
.pp-cart .pp-cart-desktop td.product-price .custom-price-without-vat span {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #00688D !important;
}

.pp-cart .pp-cart-desktop td.product-price .custom-price-with-vat .woocommerce-Price-amount,
.pp-cart .pp-cart-desktop td.product-price .custom-price-with-vat .woocommerce-Price-currencySymbol,
.pp-cart .pp-cart-desktop td.product-price .custom-price-with-vat span {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #3E3E3E !important;
}

/* Quantity - centered */
.pp-cart .pp-cart-desktop td.product-quantity {
    text-align: center;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

/* Stock warning in cart */
.pp-cart .stock-warning {
    flex: 0 0 100%;
    color: #c00;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-top: 6px;
    padding: 5px 10px;
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    animation: pp-cart-shake 0.4s ease;
}

@keyframes pp-cart-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Quantity input holder styling (from snippet 151) */
.pp-cart .pp-cart-desktop td.product-quantity .quantity-input-holder {
    display: flex;
    align-items: center;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    height: 48px;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity-input-holder input.qty {
    width: 40px !important;
    max-width: 50px !important;
    text-align: center;
    border: none !important;
    outline: none !important;
    font-size: 15px;
    font-weight: 600;
    padding: 0 !important;
    -moz-appearance: textfield;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity-input-holder input.qty::-webkit-outer-spin-button,
.pp-cart .pp-cart-desktop td.product-quantity .quantity-input-holder input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity-chevrons {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 100%;
    cursor: pointer;
    transition: background 0.15s;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity-chevrons:hover {
    background: transparent;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity-chevrons img {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.pp-cart .pp-cart-desktop td.product-quantity .quantity-pieces {
    font-size: 12px;
    color: #7a7a7a;
    padding-right: 4px;
}

/* Neutralize wpautop <p> and <br> inside quantity holder */
.pp-cart .quantity-input-holder p {
    display: contents;
    margin: 0;
}

.pp-cart .quantity-input-holder br,
.pp-cart .quantity-input-holder .screen-reader-text {
    display: none;
}

.pp-cart .quantity-chevrons p {
    display: none;
}

/* Subtotal - centered, excl/incl tax display */
.pp-cart .pp-cart-desktop td.product-subtotal {
    text-align: center;
}

.pp-cart .pp-cart-desktop td.product-subtotal .total-excluding-tax {
    display: block !important;
}

.pp-cart .pp-cart-desktop td.product-subtotal .total-excluding-tax,
.pp-cart .pp-cart-desktop td.product-subtotal .total-excluding-tax .woocommerce-Price-amount,
.pp-cart .pp-cart-desktop td.product-subtotal .total-excluding-tax .woocommerce-Price-currencySymbol {
    font-size: 17px !important;
    font-weight: 700 !important;
    color: #00688D !important;
}

.pp-cart .pp-cart-desktop td.product-subtotal .total-including-tax {
    display: block !important;
    margin-top: 2px;
}

.pp-cart .pp-cart-desktop td.product-subtotal .total-including-tax,
.pp-cart .pp-cart-desktop td.product-subtotal .total-including-tax .woocommerce-Price-amount,
.pp-cart .pp-cart-desktop td.product-subtotal .total-including-tax .woocommerce-Price-currencySymbol,
.pp-cart .pp-cart-desktop td.product-subtotal .total-including-tax .price-vat-label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #3E3E3E !important;
}

.pp-cart .pp-cart-desktop td.product-subtotal br {
    display: none;
}

/* Availability badges in cart */
.pp-cart .cart-item-badges {
    margin-top: 5px;
    display: block;
}

.pp-cart .cart-item-badges .badge-link {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Sale badge */
.pp-cart .sale-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    display: inline-block;
    margin-top: 5px;
}

/* Remove button */
.pp-cart .pp-cart-desktop td.product-remove {
    text-align: center;
    vertical-align: middle;
}

.pp-cart .pp-cart-desktop td.product-remove a.remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #D7D7D7 !important;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
}

.pp-cart .pp-cart-desktop td.product-remove a.remove i {
    font-size: 18px;
}

.pp-cart .pp-cart-desktop td.product-remove a.remove:hover {
    color: #3E3E3E !important;
    background: #f0f0f0;
}

/* Actions row (hidden - only contains nonce for cart updates) */
.pp-cart .pp-cart-desktop td.actions {
    border: none !important;
    padding: 0 !important;
    background: #fff !important;
}

/* =============================================================================
 * Mobile Card Layout (hidden on desktop)
 * =========================================================================== */

.pp-cart .pp-cart-mobile {
    display: none;
}

/* =============================================================================
 * Responsive: Switch to mobile layout at 767px
 * =========================================================================== */

@media only screen and (max-width: 767px) {

    /* Hide desktop table, show mobile cards */
    .pp-cart .pp-cart-desktop {
        display: none !important;
    }

    .pp-cart .pp-cart-mobile {
        display: block;
    }

    /* ── Mobile Card Container ── */
    .pp-cart .pp-cart-mobile-item {
        background: #fff;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 12px;
        position: relative;
    }

    /* ── 1. Header: X (left) + Title (right) ── */
    .pp-cart .pp-cart-mobile-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

    .pp-cart .pp-cart-mobile-remove {
        flex-shrink: 0;
    }

    .pp-cart .pp-cart-mobile-remove a.remove {
        color: #bbb !important;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
    }

    .pp-cart .pp-cart-mobile-remove a.remove i {
        font-size: 16px;
    }

    .pp-cart .pp-cart-mobile-remove a.remove:hover {
        color: #333 !important;
    }

    .pp-cart .pp-cart-mobile-name {
        flex: 1;
        min-width: 0;
        text-align: center;
    }

    .pp-cart .pp-cart-mobile-name a {
        font-size: 16px;
        font-weight: 600;
        color: #00688D;
        text-decoration: underline;
        line-height: 1.3;
    }

    /* ── 2. Body: Image (left ~40%) + Details (right ~60%) ── */
    .pp-cart .pp-cart-mobile-body {
        display: flex;
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 12px;
    }

    .pp-cart .pp-cart-mobile-thumbnail {
        flex: 0 0 38%;
        max-width: 38%;
    }

    .pp-cart .pp-cart-mobile-thumbnail img {
        border-radius: 8px;
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        display: block;
    }

    /* ── Right column: price, sale badge, quantity ── */
    .pp-cart .pp-cart-mobile-details {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    /* Main price (excl. tax) – large bold */
    .pp-cart .pp-cart-mobile-price-main {
        line-height: 1.2;
    }

    .pp-cart .pp-cart-mobile-price-main .woocommerce-Price-amount,
    .pp-cart .pp-cart-mobile-price-main .woocommerce-Price-amount bdi,
    .pp-cart .pp-cart-mobile-price-main .woocommerce-Price-currencySymbol {
        font-size: 22px !important;
        font-weight: 700;
        color: #00688D !important;
    }

    /* VAT price – smaller gray */
    .pp-cart .pp-cart-mobile-price-vat {
        line-height: 1.3;
    }

    .pp-cart .pp-cart-mobile-price-vat,
    .pp-cart .pp-cart-mobile-price-vat .woocommerce-Price-amount,
    .pp-cart .pp-cart-mobile-price-vat .woocommerce-Price-amount bdi,
    .pp-cart .pp-cart-mobile-price-vat .woocommerce-Price-currencySymbol {
        font-size: 14px !important;
        font-weight: 700;
        color: #3E3E3E !important;
    }

    /* Sale badge – full width red button (now outside details, above availability) */
    .pp-cart .pp-cart-mobile-sale {
        margin-bottom: 8px;
        width: 100% !important;
        flex: 0 0 100% !important;
    }
    .pp-cart .pp-cart-mobile-sale .sale-badge {
        display: block !important;
        width: 100% !important;
        background: #dc3545;
        color: #fff;
        font-size: 15px;
        font-weight: 700;
        text-transform: uppercase;
        padding: 8px 16px;
        border-radius: 5px;
        text-align: center;
        box-sizing: border-box;
        letter-spacing: 0.5px;
    }

    /* Quantity selector on mobile */
    .pp-cart .pp-cart-mobile-quantity {
        margin-top: 4px;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity {
        display: flex;
        flex-wrap: wrap;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder {
        display: flex;
        align-items: center;
        border: 1px solid #dedede;
        border-radius: 6px;
        background: #fff;
        overflow: hidden;
        height: 40px;
        width: 100% !important;
        max-width: 160px;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder .quantity-chevrons {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 100%;
        cursor: pointer;
        flex-shrink: 0;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder .quantity-chevrons img {
        width: 14px;
        height: 14px;
        opacity: 0.5;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder input.qty {
        flex: 1;
        width: 40px !important;
        text-align: center;
        border: none !important;
        outline: none !important;
        font-size: 14px;
        font-weight: 600;
        padding: 0 !important;
        -moz-appearance: textfield;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder input.qty::-webkit-outer-spin-button,
    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder input.qty::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-pieces {
        font-size: 12px;
        color: #7a7a7a;
        padding-right: 4px;
    }

    /* Neutralize wpautop inside mobile quantity */
    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder p {
        display: contents;
        margin: 0;
    }

    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder br,
    .pp-cart .pp-cart-mobile-quantity .quantity-input-holder .screen-reader-text {
        display: none;
    }

    .pp-cart .pp-cart-mobile-quantity .stock-warning {
        flex: 0 0 100%;
        margin-top: 6px;
    }

    /* ── 3. Bottom: Availability badge (full width green button) ── */
    .pp-cart .pp-cart-mobile-availability {
        margin-top: 0;
    }

    .pp-cart .pp-cart-mobile-availability .badge-link {
        display: block !important;
        width: 100% !important;
        text-align: center;
        padding: 8px 16px;
        font-size: 15px;
        font-weight: 700;
        text-transform: uppercase;
        border-radius: 5px;
        color: #fff !important;
        letter-spacing: 0.5px;
        box-sizing: border-box;
    }

    /* Hide the hook-generated badges div (we render our own at bottom) */
    .pp-cart .pp-cart-mobile-item > .cart-item-badges {
        display: none;
    }

    /* Hide responsive data-title labels from WooCommerce */
    .pp-cart .woocommerce table.shop_table_responsive tr td::before,
    .pp-cart .woocommerce-page table.shop_table_responsive tr td::before {
        display: none !important;
    }
}

/* =============================================================================
 * Sticky Navigation Bar - matches original Elementor template
 * =========================================================================== */

.pp-cart-sticky-bar {
    background: #FFFFFF;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 5px 0;
    z-index: 99;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.pp-cart-sticky-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Back button - 30% left */
.pp-cart-btn-back {
    flex: 0 0 30%;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #1A1818;
    text-decoration: underline;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 500;
    border: none;
    padding: 10px 0;
    transition: color 0.2s;
    white-space: nowrap;
}

.pp-cart-btn-back:hover {
    color: #00688D;
}

.pp-cart-btn-back i {
    font-size: 12px;
}

/* Right section: summary + continue button - 70% */
.pp-cart-sticky-right {
    flex: 0 0 70%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.pp-cart-sticky-summary {
    flex-shrink: 0;
}

/* Continue button - green, Poppins 18px */
.pp-cart-btn-continue,
.pp-cart-btn-continue:visited {
    flex: 0 0 33%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: #8DB723;
    color: #FFFFFF !important;
    font-family: "Poppins", sans-serif;
    font-size: 22px !important;
    font-weight: 500;
    padding: 18px 30px;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.pp-cart-btn-continue:hover {
    background: #90C619;
    color: #FFFFFF;
}

.pp-cart-btn-continue i {
    font-size: 14px;
}

/* =============================================================================
 * Responsive: Sticky bar on mobile
 * =========================================================================== */

@media only screen and (max-width: 767px) {
    .pp-cart-sticky-inner {
        flex-wrap: wrap;
        gap: 0;
        padding: 5px 15px;
    }

    .pp-cart-btn-back {
        flex: 0 0 100%;
        justify-content: center;
        order: 2;
        padding: 8px 0;
        font-size: 14px;
    }

    .pp-cart-sticky-right {
        flex: 0 0 100%;
        flex-wrap: wrap;
        gap: 0;
    }

    .pp-cart-sticky-summary {
        flex: 0 0 100%;
        text-align: center;
    }

    .pp-cart-btn-continue {
        flex: 0 0 100%;
        font-size: 20px;
        padding: 14px 20px;
    }
}
