/* ========================================
   Shalom A+ Cart Page Styles
   Design aligned with checkout page
   ======================================== */

/* ===== Kill gap between Kadence header and cart ===== */
body.woocommerce-cart #inner-wrap,
body.woocommerce-cart main.wrap,
body.woocommerce-cart #primary.content-area,
body.woocommerce-cart .content-area,
body.woocommerce-cart #main.site-main,
body.woocommerce-cart .site-main,
body.woocommerce-cart .entry-content-wrap,
body.woocommerce-cart .entry.single-entry,
body.woocommerce-cart .content-wrap,
body.woocommerce-cart .site-container .site-inner-wrap {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
}

/* Kill ALL WooCommerce/Kadence float & width on cart collaterals */
.sa-cart .cart-collaterals,
.sa-cart .woocommerce-cart-form,
.sa-cart .cross-sells {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sa-cart .cart_totals {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

/* ===== Main Container ===== */
.sa-cart {
    background: #F8F7F4;
    min-height: 60vh;
}

/* ===== Header (Navy bar) — matches checkout ===== */
.sa-cart__header {
    background: var(--sa-navy, #0B1F3B);
    padding: 48px 120px 32px;
}

.sa-cart__title {
    font-family: var(--sa-font-display);
    font-size: 36px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    margin: 0 0 8px;
    line-height: 1.2;
}

.sa-cart__subtitle {
    font-family: var(--sa-font-body);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ===== Two-Column Grid ===== */
.sa-cart > .woocommerce,
.sa-cart .woocommerce {
    max-width: 1440px;
    margin: 0 auto !important;
    padding: 40px 120px 60px !important;
}

.sa-cart .kadence-woo-cart-form-wrap {
    display: grid !important;
    grid-template-columns: 1fr 420px;
    gap: 32px;
    align-items: start;
}

/* Notices span full width */
.sa-cart .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
}

/* Left column: cart form */
.sa-cart .woocommerce-cart-form {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}

/* Right column: cart totals */
.sa-cart .cart-collaterals {
    grid-column: 2;
    grid-row: 1;
}

/* Hide default WooCommerce headings (we add our own) */
.sa-cart .woocommerce > h2,
.sa-cart .kadence-woo-cart-form-wrap > h2,
.sa-cart .woocommerce-cart-form > h2 {
    display: none !important;
}

/* Left column section title */
.sa-cart__section-title {
    font-family: var(--sa-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--sa-navy, #0B1F3B);
    margin: 0 0 16px;
    line-height: 1.3;
}

/* Hide product images (service-based products) */
.sa-cart table.shop_table .product-thumbnail {
    display: none !important;
}

/* ===== Cart Items Card ===== */
.sa-cart table.shop_table {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E5E2DA !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden;
    width: 100%;
    margin: 0 !important;
}

/* Table header row */
.sa-cart table.shop_table thead th {
    font-family: var(--sa-font-body);
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.3px;
    padding: 16px 28px;
    border-bottom: 1px solid #E5E2DA;
    background: #FAFAF8;
}

/* Table body cells */
.sa-cart table.shop_table tbody td {
    padding: 20px 28px;
    border-bottom: 1px solid #F0EDE6;
    border-top: none;
    vertical-align: middle;
    font-family: var(--sa-font-body);
    background: #FFFFFF;
}

.sa-cart table.shop_table tbody tr:last-child td {
    border-bottom: none;
}

/* Remove (x) button */
.sa-cart table.shop_table .product-remove a {
    color: #E53E3E !important;
    font-size: 18px;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.sa-cart table.shop_table .product-remove a:hover {
    opacity: 1;
}

/* Product name */
.sa-cart table.shop_table .product-name a {
    font-family: var(--sa-font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--sa-navy, #0B1F3B);
    text-decoration: none;
    transition: color 0.2s;
}

.sa-cart table.shop_table .product-name a:hover {
    color: var(--sa-gold);
}

/* Price columns */
.sa-cart table.shop_table .product-price,
.sa-cart table.shop_table .product-subtotal {
    font-family: var(--sa-font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--sa-navy, #0B1F3B);
}

/* Quantity input */
.sa-cart table.shop_table .quantity .qty {
    width: 56px;
    height: 40px;
    border: 1px solid #D1CCC0;
    border-radius: 8px;
    text-align: center;
    font-family: var(--sa-font-body);
    font-size: 15px;
    color: var(--sa-navy, #0B1F3B);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -moz-appearance: textfield;
}

.sa-cart table.shop_table .quantity .qty:focus {
    border-color: var(--sa-gold);
    box-shadow: 0 0 0 3px rgba(200, 164, 78, 0.12);
}

/* Actions row (update cart button) */
.sa-cart table.shop_table td.actions {
    padding: 16px 28px;
    background: #FAFAF8;
    border-top: 1px solid #E5E2DA;
}

.sa-cart table.shop_table .actions .button {
    background: var(--sa-navy, #0B1F3B);
    color: #FFFFFF !important;
    border: none;
    border-radius: 8px;
    font-family: var(--sa-font-body);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sa-cart table.shop_table .actions .button:hover {
    opacity: 0.85;
}

.sa-cart table.shop_table .actions .coupon {
    display: none;
}

/* ===== Cart Totals Card (Right Column) ===== */
.sa-cart .cart_totals {
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid #E5E2DA;
    padding: 32px;
    position: sticky;
    top: 100px;
}

.sa-cart .cart_totals > h2 {
    font-family: var(--sa-font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--sa-navy, #0B1F3B);
    margin: 0 0 24px;
    padding: 0;
    line-height: 1.3;
}

.sa-cart .cart_totals table {
    width: 100%;
    border: none !important;
    border-collapse: collapse;
    margin: 0 !important;
}

.sa-cart .cart_totals table th,
.sa-cart .cart_totals table td {
    padding: 14px 0;
    border-top: 1px solid #E5E2DA;
    border-bottom: none;
    font-family: var(--sa-font-body);
    background: transparent !important;
}

.sa-cart .cart_totals table th {
    font-size: 14px;
    font-weight: 400;
    color: #6B7280;
    text-align: left;
}

.sa-cart .cart_totals table td {
    font-size: 14px;
    font-weight: 500;
    color: var(--sa-navy, #0B1F3B);
    text-align: right;
}

/* Total row — gold price */
.sa-cart .cart_totals .order-total th {
    font-family: var(--sa-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--sa-navy, #0B1F3B);
    padding-top: 16px;
}

.sa-cart .cart_totals .order-total td {
    padding-top: 16px;
}

.sa-cart .cart_totals .order-total td,
.sa-cart .cart_totals .order-total td .amount {
    font-family: var(--sa-font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--sa-gold, #C8A24A) !important;
}

/* Checkout button */
.sa-cart .wc-proceed-to-checkout {
    margin-top: 24px;
    padding: 0;
}

.sa-cart .wc-proceed-to-checkout a.checkout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 56px;
    background: var(--sa-gold, #C8A24A) !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 12px;
    font-family: var(--sa-font-display);
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 56px;
    padding: 0 !important;
    margin: 0 !important;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.sa-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background: var(--sa-gold-dark, #B0913A) !important;
}

/* ===== Empty Cart ===== */
.sa-cart .cart-empty {
    text-align: center;
    padding: 80px 20px;
    font-family: var(--sa-font-body);
    font-size: 16px;
    color: #6B7280;
    grid-column: 1 / -1;
}

.sa-cart .return-to-shop {
    grid-column: 1 / -1;
    text-align: center;
}

.sa-cart .return-to-shop a {
    display: inline-block;
    background: var(--sa-gold, #C8A24A);
    color: #FFFFFF !important;
    padding: 14px 32px;
    border-radius: 12px;
    font-family: var(--sa-font-body);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.sa-cart .return-to-shop a:hover {
    background: var(--sa-gold-dark, #B0913A);
}

.sa-cart .wc-empty-cart-message {
    grid-column: 1 / -1;
}

/* ===== WooCommerce Notices ===== */
.sa-cart .woocommerce-error,
.sa-cart .woocommerce-message,
.sa-cart .woocommerce-info {
    border-radius: 8px !important;
    font-family: var(--sa-font-body) !important;
    padding: 12px 16px !important;
    margin: 0 0 8px !important;
    list-style: none !important;
}

.sa-cart .woocommerce-message {
    border-left: 4px solid #2F855A !important;
    background: #F0FFF4 !important;
    color: #276749 !important;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sa-cart__header {
        padding: 40px 40px 28px;
    }
    .sa-cart .woocommerce {
        padding: 32px 40px;
    }
    .sa-cart .kadence-woo-cart-form-wrap {
        grid-template-columns: 1fr 360px;
    }
}

@media (max-width: 768px) {
    .sa-cart__header {
        padding: 32px 20px 24px;
    }
    .sa-cart__title {
        font-size: 28px;
    }
    .sa-cart .woocommerce {
        padding: 24px 20px 40px;
    }
    .sa-cart .kadence-woo-cart-form-wrap {
        grid-template-columns: 1fr !important;
    }
    .sa-cart .cart-collaterals {
        grid-column: 1;
    }
    .sa-cart .cart_totals {
        position: static;
    }
}

@media (max-width: 480px) {
    .sa-cart__header {
        padding: 24px 16px 20px;
    }
    .sa-cart__title {
        font-size: 22px;
    }
    .sa-cart .woocommerce {
        padding: 16px 16px 32px !important;
    }
    .sa-cart table.shop_table {
        border: none !important;
    }
    .sa-cart table.shop_table thead {
        display: none;
    }
    .sa-cart table.shop_table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 16px;
        border-bottom: 1px solid #F0EDE6;
        background: #FFFFFF;
        position: relative;
    }
    .sa-cart table.shop_table tbody tr:first-child {
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }
    .sa-cart table.shop_table tbody td {
        display: block;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }
    .sa-cart table.shop_table .product-remove {
        position: absolute;
        top: 12px;
        right: 12px;
    }
    .sa-cart table.shop_table .product-name {
        width: 100%;
        font-size: 15px;
        padding-right: 24px !important;
    }
    .sa-cart table.shop_table .product-price {
        font-size: 14px;
        color: #6B7280;
    }
    .sa-cart table.shop_table .product-price::before {
        content: attr(data-title) ': ';
        font-weight: 400;
        color: #6B7280;
    }
    .sa-cart table.shop_table .product-quantity {
        margin-left: auto;
    }
    .sa-cart table.shop_table .product-subtotal {
        width: 100%;
        text-align: right;
        font-size: 16px;
        margin-top: 4px;
        padding-top: 8px !important;
        border-top: 1px solid #F0EDE6 !important;
    }
    .sa-cart table.shop_table td.actions {
        display: flex;
        width: 100%;
        justify-content: flex-end;
        padding: 12px 16px !important;
        border-top: none;
    }
    .sa-cart .cart_totals {
        padding: 24px;
    }
}
