/**
 * Cart Page Styles - Officelicentie Style
 *
 * @package licentie-child
 */

/* ============================================
   Prevent Horizontal Overflow
   Note: Using clip instead of hidden to preserve position: sticky
   ============================================ */

body.woocommerce-cart {
    overflow-x: clip;
}

body.woocommerce-cart .site-content {
    overflow-x: clip;
    max-width: 100vw;
}

body.woocommerce-cart #page {
    overflow-x: clip;
}

/* ============================================
   Override Parent Theme Layout
   ============================================ */

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

/* Hide sidebar on cart page */
body.woocommerce-cart #secondary {
    display: none !important;
}

/* Override col-full constraints */
body.woocommerce-cart .site-content > .col-full {
    max-width: 100% !important;
    padding: 0 !important;
}

body.woocommerce-cart #content.site-content {
    padding: 0 !important;
}

/* Override Shoptimizer cart wrapper */
body.woocommerce-cart .shoptimizer-cart-wrapper {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Override entry-content constraints */
body.woocommerce-cart .entry-content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.woocommerce-cart .woocommerce {
    max-width: 100% !important;
}

/* Override page wrapper */
body.woocommerce-cart .hentry {
    padding: 0 !important;
    margin: 0 !important;
}

/* ============================================
   Cart Page Background
   ============================================ */

body.woocommerce-cart {
    background: #fff;
}

body.woocommerce-cart #content.site-content {
    background: #fff;
}

/* ============================================
   Cart V2 Wrapper
   ============================================ */

.cart-v2-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    background: #fff;
}

.cart-v2-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

/* Smooth proportional scaling for both columns */
@media (max-width: 1200px) and (min-width: 1001px) {
    .cart-v2-content {
        grid-template-columns: 55% 45%;
    }
}

/* ============================================
   Cart Items Column (Left)
   ============================================ */

.cart-v2-items {
    background: #fff;
}

.cart-v2-title {
    display: inline-flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f274a;
    margin: 0 0 1.5rem 0;
}

.cart-items-list {
    display: flex;
    flex-direction: column;
}

/* ============================================
   Individual Cart Item
   ============================================ */

.cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto auto;
    gap: 1.5rem;
    align-items: start;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e5e5e5;
}

.cart-item:last-child {
    border-bottom: none;
}

/* Product Image */
.cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.cart-item-image a {
    display: block;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

/* Product Info */
.cart-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
    padding-top: 0.25rem;
}

.cart-item-name {
    font-size: 0.9375rem;
    font-weight: 400;
    color: #1f274a;
    margin: 0;
    line-height: 1.4;
}

.cart-item-name a {
    color: #1f274a;
    text-decoration: none;
    transition: color 0.2s;
}

.cart-item-name a:hover {
    color: #1bbc9b;
}

/* Delivery Status */
.cart-item-delivery {
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.cart-item-delivery span {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.cart-item-delivery .delivery-digital,
.cart-item-delivery .delivery-stock {
    color: #1bbc9b;
    font-weight: 600;
}

.cart-item-delivery .delivery-backorder {
    color: #f59e0b;
}

.cart-item-delivery .delivery-backorder-note {
    color: #6b7280;
    font-style: italic;
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
}

/* Quantity Selector - WooCommerce Blocks style */
.cart-item-qty {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
}

.cart-item-qty-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.wc-block-components-quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.wc-block-components-quantity-selector__input {
    width: 28px;
    height: 32px;
    text-align: center;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f274a;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0 !important;
    margin: 0;
}

.wc-block-components-quantity-selector__input::-webkit-outer-spin-button,
.wc-block-components-quantity-selector__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wc-block-components-quantity-selector__input:focus {
    outline: none;
}

.wc-block-components-quantity-selector__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #1f274a;
    font-size: 1rem;
    font-weight: 300;
    transition: background-color 0.2s;
    padding: 0;
}


.wc-block-components-quantity-selector__button:disabled {
    color: #ccc;
    cursor: not-allowed;
}

.wc-block-components-quantity-selector__button--minus {
    order: -1;
}

.wc-block-components-quantity-selector__button--plus {
    /* geen border */
}

/* Remove link - WooCommerce Blocks style */
.wc-block-cart-item__remove-link {
    font-size: 0.75rem;
    color: #999;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    padding-top: 0.5rem;
    transition: color 0.2s;
}

.wc-block-cart-item__remove-link:hover {
    color: #e74c3c;
}

/* Price per item */
.cart-item-price-each {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1f274a;
    text-align: center;
    white-space: nowrap;
}

.cart-item-price-each .price-label {
    color: #6b7280;
}

/* Subtotal */
.cart-item-subtotal {
    text-align: right;
    min-width: 90px;
    padding-top: 0.25rem;
}

.cart-item-subtotal .woocommerce-Price-amount {
    font-size: 1rem;
    font-weight: 600;
    color: #1f274a;
}

.cart-item-subtotal .tax_label {
    display: none;
}

/* ============================================
   Cart Totals Column (Right) - Sticky Sidebar
   ============================================ */

.cart-v2-totals {
    position: sticky;
    top: calc(var(--header-height, 73px) + 24px);
    align-self: start;
    overflow: visible;
}

/* Admin bar adjustment for sticky sidebar */
.admin-bar .cart-v2-totals {
    top: calc(var(--header-height, 73px) + 24px + 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .cart-v2-totals {
        top: calc(var(--header-height, 73px) + 24px + 46px);
    }
}

/* Info Tooltip in Title */
.cart-info-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    cursor: help;
}

.cart-info-icon {
    width: 18px;
    height: 18px;
    color: #767676;
    transition: color 0.2s;
}

.cart-info-tooltip:hover .cart-info-icon {
    color: #1bbc9b;
}

.cart-info-tooltip-text {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    background: #1f274a;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 400;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: calc(100vw - 32px);
}

.cart-info-tooltip-text::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #1f274a;
}

.cart-info-tooltip:hover .cart-info-tooltip-text {
    opacity: 1;
    visibility: visible;
}

.cart-v2-totals .cart-collaterals {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem 2rem;
}

/* Hide cross-sells on cart page for cleaner look */
.cart-v2-totals .cross-sells {
    display: none;
}

/* Cart Totals - Div-based layout */
.cart-v2-totals .cart_totals {
    width: 100%;
}

/* Hide old H2 title if present */
.cart-v2-totals .cart_totals h2 {
    display: none;
}

/* Totals rows container */
.cart-v2-totals .cart-totals-rows {
    display: flex;
    flex-direction: column;
}

/* Individual row */
.cart-v2-totals .cart-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
}

/* Labels */
.cart-v2-totals .cart-totals-label {
    font-weight: 600;
    color: #1f274a;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cart-v2-totals .cart-totals-label .label-suffix {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
}

/* Values */
.cart-v2-totals .cart-totals-value {
    text-align: right;
    color: #1f274a;
    font-size: 0.9375rem;
}

/* Shipping row - CO2 styling */
.cart-v2-totals .cart-shipping .co2-icon {
    width: 14px;
    height: 14px;
    margin-right: 2px;
}

.cart-v2-totals .cart-shipping .co2-label {
    font-size: 12px;
    font-weight: 600;
    color: #1bbc9b;
    margin-right: 4px;
}

.cart-v2-totals .cart-shipping .shipping-free {
    color: #1bbc9b;
    font-weight: 600;
}

/* Total row */
.cart-v2-totals .cart-total {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid #e5e5e5;
}

.cart-v2-totals .cart-total .cart-totals-label {
    font-size: 1rem;
}

.cart-v2-totals .cart-total .cart-totals-value {
    font-size: 1.125rem;
    font-weight: 700;
}

/* Hide extra info in total (like BTW breakdown) */
.cart-v2-totals .cart-total .cart-totals-value small,
.cart-v2-totals .cart-total .includes_tax {
    display: none;
}

/* Proceed to Checkout Button */
.cart-v2-totals .wc-proceed-to-checkout {
    padding: 1.25rem 0 0 0;
}

.cart-v2-totals .wc-proceed-to-checkout .checkout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: #1bbc9b;
    color: #fff;
    text-align: center;
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid #1bbc9b;
    border-bottom: 3px solid #17a387;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none !important;
    text-shadow: none;
    transition: background 0.1s linear;
    margin-bottom: 3px;
    -webkit-appearance: none;
    outline: none;
}

.cart-v2-totals .wc-proceed-to-checkout .checkout-button:hover {
    background-color: #17a387;
    border-color: #17a387;
    color: #fff;
}

.cart-v2-totals .wc-proceed-to-checkout .checkout-button::before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ============================================
   Payment Logos
   ============================================ */

.cart-payment-logos {
    margin-top: 1.5rem;
    text-align: center;
}

.cart-payment-title {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

/* SSL Lock Icon */
.ssl-lock-icon {
    color: #10b981;
    flex-shrink: 0;
}

/* SSL Info Trigger */
.ssl-info-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
}

.ssl-info-icon {
    flex-shrink: 0;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.ssl-info-trigger:hover .ssl-info-icon {
    transform: scale(1.1);
}

/* SSL Tooltip */
.ssl-info-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    right: 0;
    left: auto;
    transform: none;
    width: 260px;
    background: #1f2937;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-style: normal;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 99999;
}

.ssl-info-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 6px;
    left: auto;
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.ssl-info-trigger:hover .ssl-info-tooltip {
    opacity: 1;
    visibility: visible;
}

.ssl-info-tooltip strong {
    display: block;
    color: #10b981;
    font-weight: 600;
    margin-bottom: 4px;
}

.ssl-info-tooltip span {
    display: block;
    color: #d1d5db;
}

.cart-payment-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cart-payment-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-payment-item img {
    height: 32px;
    width: auto;
    max-width: 50px;
    object-fit: contain;
    display: block;
}

.cart-payment-item.thuiswinkel img {
    height: 30px;
    max-width: 110px;
}

.cart-payment-item.applepay img {
    height: 36px;
    border-radius: 6px;
}

/* ============================================
   Remove Item Modal
   ============================================ */

.cart-remove-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    max-width: 100vw;
}

.cart-remove-modal.active {
    display: flex;
}

.cart-remove-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.cart-remove-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 400px;
    width: calc(100% - 32px);
    margin: 0 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalFadeIn 0.2s ease;
    box-sizing: border-box;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cart-remove-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e5e5;
}

.cart-remove-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f274a;
}

.cart-remove-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.cart-remove-modal-close:hover {
    color: #1f274a;
}

.cart-remove-modal-body {
    padding: 1.25rem;
}

.cart-remove-modal-body p {
    margin: 0;
    color: #1f274a;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.cart-remove-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #e5e5e5;
}

.cart-remove-modal-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.15s ease;
}

.cart-remove-modal-cancel {
    background: #f3f4f6;
    border: 1px solid #e5e5e5;
    border-bottom: 2px solid #d1d5db;
    color: #1f274a;
    margin-bottom: 2px;
}

.cart-remove-modal-cancel:hover {
    background: #e5e5e5;
}

.cart-remove-modal-confirm {
    background: #e74c3c;
    border: 1px solid #e74c3c;
    border-bottom: 2px solid #c0392b;
    color: #fff;
    margin-bottom: 2px;
}

.cart-remove-modal-confirm:hover {
    background: #c0392b;
    border-color: #c0392b;
    color: #fff;
}

/* ============================================
   Update Cart Button (Hidden by default)
   ============================================ */

.cart-update-btn {
    display: none !important;
}

/* ============================================
   Empty Cart
   ============================================ */

.woocommerce-cart .cart-empty {
    text-align: center;
    padding: 3rem 1rem;
}

.woocommerce-cart .return-to-shop {
    text-align: center;
}

.woocommerce-cart .return-to-shop .button {
    background: #1bbc9b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}

.woocommerce-cart .return-to-shop .button:hover {
    background: #17a387;
}

/* ============================================
   Responsive Design
   ============================================ */

/* Large screens - wrapper scales, columns stay proportional */
@media (max-width: 1200px) {
    .cart-v2-wrapper {
        padding: 2rem 1.5rem;
    }

    .cart-v2-content {
        gap: 1.5rem;
    }
}

/* Medium-large screens */
@media (max-width: 1080px) {
    .cart-v2-content {
        gap: 1.25rem;
    }

    .cart-v2-totals .cart-collaterals {
        padding: 1.25rem 1.5rem;
    }
}

/* Medium screens */
@media (max-width: 980px) {
    .cart-v2-wrapper {
        padding: 1.5rem 1.25rem;
    }

    .cart-v2-content {
        gap: 1rem;
    }
}

/* Single column layout */
@media (max-width: 1000px) {
    .cart-v2-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        max-width: 650px;
        margin: 0 auto;
    }

    .cart-v2-totals,
    .admin-bar .cart-v2-totals {
        position: static;
        max-width: 100%;
        max-height: none;
        overflow-y: visible;
    }

    .cart-v2-totals .cart-collaterals {
        padding: 1.5rem;
    }
}

/* Tablet portrait */
@media (max-width: 768px) {
    .cart-v2-wrapper {
        padding: 1.5rem 1rem;
    }

    .cart-v2-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .cart-item {
        grid-template-columns: 70px 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.75rem 1rem;
        padding: 1.25rem 0;
    }

    .cart-item-image {
        width: 70px;
        height: 70px;
        grid-row: span 2;
    }

    .cart-item-info {
        grid-column: 2 / -1;
    }

    .cart-item-name {
        font-size: 0.875rem;
    }

    .cart-item-delivery {
        font-size: 0.75rem;
    }

    .cart-item-qty {
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
    }

    .cart-item-qty-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }

    .cart-item-subtotal {
        grid-column: 3;
        grid-row: 2;
        text-align: right;
        min-width: 70px;
    }

    .cart-item-subtotal .woocommerce-Price-amount {
        font-size: 0.9375rem;
    }

    .cart-item-price-each {
        display: block;
        font-size: 0.75rem;
    }

    .cart-v2-totals {
        max-width: 100%;
    }

    .cart-payment-title {
        font-size: 0.8125rem;
    }

    .cart-payment-item img {
        height: 26px;
        max-width: 44px;
    }
}

/* Mobile */
@media (max-width: 576px) {
    .cart-v2-wrapper {
        padding: 1rem 0.75rem;
    }

    .cart-v2-title {
        font-size: 1.125rem;
    }

    /* Hide hover tooltip on mobile - doesn't work with touch */
    .cart-info-tooltip-text {
        display: none !important;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto auto;
        gap: 0.5rem 0.75rem;
        padding: 1rem 0;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
        grid-row: 1;
        grid-column: 1;
    }

    .cart-item-info {
        grid-column: 2;
        grid-row: 1;
    }

    .cart-item-qty {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        padding-top: 0.5rem;
    }

    .cart-item-subtotal {
        grid-column: 1 / -1;
        grid-row: 3;
        text-align: left;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 0.5rem;
        border-top: 1px dashed #e5e5e5;
        margin-top: 0.5rem;
    }

    .cart-item-subtotal::before {
        content: 'Subtotaal:';
        font-size: 0.8125rem;
        color: #6b7280;
        font-weight: 400;
    }

    .cart-v2-totals .cart-collaterals {
        padding: 1rem;
        border-radius: 8px;
    }

    .cart-v2-totals .cart-totals-row {
        padding: 0.5rem 0;
    }

    .cart-v2-totals .cart-totals-label,
    .cart-v2-totals .cart-totals-value {
        font-size: 0.875rem;
    }

    .cart-v2-totals .cart-total .cart-totals-label {
        font-size: 0.9375rem;
    }

    .cart-v2-totals .cart-total .cart-totals-value {
        font-size: 1rem;
    }

    .cart-v2-totals .wc-proceed-to-checkout .checkout-button {
        font-size: 0.9375rem;
        padding: 0.625rem 1rem;
    }

    .cart-payment-list {
        gap: 0.5rem;
    }

    .cart-payment-item img {
        height: 24px;
        max-width: 40px;
    }

    /* Modal aanpassingen voor mobiel */
    .cart-remove-modal-content {
        width: calc(100% - 24px);
        margin: 0 12px;
    }

    .cart-remove-modal-footer {
        flex-direction: column;
    }

    .cart-remove-modal-btn {
        width: 100%;
    }
}

/* Extra small mobile */
@media (max-width: 380px) {
    .cart-v2-wrapper {
        padding: 0.75rem 0.5rem;
    }

    .cart-item {
        gap: 0.5rem;
    }

    .cart-item-image {
        width: 50px;
        height: 50px;
    }

    .cart-item-name {
        font-size: 0.8125rem;
    }

    .wc-block-components-quantity-selector__button,
    .wc-block-components-quantity-selector__input {
        width: 24px;
        height: 28px;
    }

    .cart-v2-totals .cart-collaterals {
        padding: 0.75rem;
    }
}

/* ============================================
   Override default WooCommerce styles
   ============================================ */

.woocommerce-cart .woocommerce {
    max-width: 100%;
}

/* Hide default WooCommerce remove message */
.woocommerce-cart .woocommerce-message {
    display: none !important;
}

/* Hide default WooCommerce cart table styles */
body.woocommerce-cart .shop_table,
body.woocommerce-cart .shop_table.cart {
    border: none;
}

body.woocommerce-cart .shop_table th,
body.woocommerce-cart .shop_table td {
    border: none;
}

/* Hide coupon form on cart (optional) */
.cart-v2-wrapper .coupon {
    display: none;
}

/* ============================================
   Additional Shoptimizer Overrides
   ============================================ */

/* Reset any table display from parent theme */
body.woocommerce-cart .cart-v2-wrapper .woocommerce-cart-form {
    display: block;
}

/* Fix Shoptimizer cart form width override */
body.woocommerce-cart .woocommerce-cart-form {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* Hide Shoptimizer's extra quantity nav buttons */
body.woocommerce-cart .qty-wrapper .quantity-nav {
    display: none !important;
}

/* Reset quantity wrapper from Shoptimizer */
body.woocommerce-cart .qty-wrapper .quantity.buttons_added {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Ensure grid layout is not overridden */
body.woocommerce-cart .cart-v2-content {
    display: grid !important;
}

/* Ensure cart items display correctly */
body.woocommerce-cart .cart-item {
    display: grid !important;
}

/* Override any float issues */
body.woocommerce-cart .cart-v2-items,
body.woocommerce-cart .cart-v2-totals {
    float: none !important;
    width: auto !important;
}

/* Force sticky sidebar on desktop */
@media (min-width: 1001px) {
    /* Ensure no parent breaks sticky context */
    body.woocommerce-cart .site-content,
    body.woocommerce-cart #page,
    body.woocommerce-cart .content-area,
    body.woocommerce-cart .site-main,
    body.woocommerce-cart .woocommerce,
    body.woocommerce-cart .cart-v2-wrapper,
    body.woocommerce-cart .woocommerce-cart-form,
    body.woocommerce-cart .cart-v2-content {
        overflow: visible !important;
    }

    body.woocommerce-cart .cart-v2-totals {
        position: sticky !important;
        position: -webkit-sticky !important;
        top: calc(var(--header-height, 73px) + 24px) !important;
        top: 97px !important; /* Fallback */
        align-self: start !important;
    }

    .admin-bar.woocommerce-cart .cart-v2-totals {
        top: calc(var(--header-height, 73px) + 24px + 32px) !important;
        top: 129px !important; /* Fallback */
    }
}

/* Fix cart collaterals positioning */
body.woocommerce-cart .cart-collaterals {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
    clear: none !important;
}

/* Ensure cart totals column stays in grid */
body.woocommerce-cart .cart-v2-totals .cart-collaterals {
    position: static !important;
}

/* Override Shoptimizer cart totals width */
body.woocommerce-cart .cart_totals {
    float: none !important;
    width: 100% !important;
}

/* Ensure checkout button displays correctly */
body.woocommerce-cart .wc-proceed-to-checkout {
    padding: 1rem 0 0 0 !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
    float: none !important;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    line-height: 1.4 !important;
}

/* Hide cross-sells in totals column */
body.woocommerce-cart .cart-v2-totals .cross-sells {
    display: none !important;
}

/* ============================================
   Cart Upsell Section
   ============================================ */

.cart-upsell-section {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0fdf9 0%, #f8fafc 100%);
    border: 1px solid #d1fae5;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.cart-upsell-section::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(27, 188, 155, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cart-upsell-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cart-upsell-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #1bbc9b 0%, #17a387 100%);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(27, 188, 155, 0.3);
}

.cart-upsell-badge svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    stroke: #fff;
}

.cart-upsell-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f274a;
    margin: 0 0 0.5rem 0;
}

.cart-upsell-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* Upsell Products Grid */
.cart-upsell-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.cart-upsell-product {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.cart-upsell-product:hover {
    border-color: #1bbc9b;
    box-shadow: 0 4px 16px rgba(27, 188, 155, 0.12);
    transform: translateY(-2px);
}

.cart-upsell-product-image {
    position: relative;
    display: block;
    text-align: center;
    margin-bottom: 0.75rem;
}

.cart-upsell-product-image img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.cart-upsell-discount {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
}

.cart-upsell-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}

.cart-upsell-product-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1f274a;
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.cart-upsell-product-title:hover {
    color: #1bbc9b;
}

.cart-upsell-product-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.cart-upsell-old-price {
    font-size: 0.75rem;
    color: #767676;
    text-decoration: line-through;
}

.cart-upsell-current-price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1bbc9b;
}

.cart-upsell-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #1bbc9b;
    border-radius: 6px;
    color: #1bbc9b;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-upsell-add-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.cart-upsell-add-btn:hover {
    background: #1bbc9b;
    color: #fff;
}

.cart-upsell-add-btn:hover svg {
    stroke: #fff;
}

.cart-upsell-add-btn.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.cart-upsell-add-btn.added {
    background: #1bbc9b;
    color: #fff;
    pointer-events: none;
}

.cart-upsell-add-btn.added svg {
    stroke: #fff;
}

/* Upsell Benefits */
.cart-upsell-benefits {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px dashed #d1fae5;
}

.cart-upsell-benefit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #374151;
}

.cart-upsell-benefit svg {
    color: #1bbc9b;
    flex-shrink: 0;
}

.cart-upsell-benefit strong {
    color: #1bbc9b;
    font-weight: 700;
}

/* Responsive Upsell */
@media (max-width: 1000px) {
    .cart-upsell-section {
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    .cart-upsell-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
        border-radius: 12px;
    }

    .cart-upsell-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .cart-upsell-product {
        padding: 0.875rem;
    }

    .cart-upsell-product-image img {
        width: 60px;
        height: 60px;
    }

    .cart-upsell-title {
        font-size: 1.125rem;
    }

    .cart-upsell-subtitle {
        font-size: 0.875rem;
    }

    .cart-upsell-benefits {
        gap: 1rem;
    }

    .cart-upsell-benefit {
        font-size: 0.8125rem;
    }
}

@media (max-width: 576px) {
    .cart-upsell-section {
        padding: 1.25rem;
        margin-top: 1.25rem;
    }

    .cart-upsell-badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }

    .cart-upsell-title {
        font-size: 1rem;
    }

    .cart-upsell-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .cart-upsell-product {
        padding: 0.75rem;
    }

    .cart-upsell-product-title {
        font-size: 0.75rem;
    }

    .cart-upsell-current-price {
        font-size: 0.875rem;
    }

    .cart-upsell-add-btn {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
    }

    .cart-upsell-benefits {
        flex-direction: column;
        align-items: center;
        gap: 0.625rem;
    }

    .cart-upsell-benefit {
        font-size: 0.75rem;
    }
}

@media (max-width: 380px) {
    .cart-upsell-section {
        padding: 1rem;
    }

    .cart-upsell-product-image img {
        width: 50px;
        height: 50px;
    }
}
