/**
 * Cart Styles
 * 
 * @package ChildTheme_Clean
 */

/* Force hide hero section and entry header on cart pages - Maximum specificity */
body.woocommerce-cart .hero-section.is-width-constrained,
body.woocommerce-cart .hero-section.is-width-constrained *,
.woocommerce-cart .hero-section.is-width-constrained,
body.woocommerce-cart div.hero-section.is-width-constrained,
body.woocommerce-cart article .hero-section.is-width-constrained,
body.woocommerce-cart .ct-container-full .hero-section.is-width-constrained,
body.woocommerce-cart #content .hero-section.is-width-constrained,
body.woocommerce-cart .woocommerce-cart .hero-section.is-width-constrained,
.woocommerce-cart .hero-section,
body.woocommerce-cart .hero-section,
body.woocommerce-cart .hero-section.is-width-constrained,
body.woocommerce-cart article .hero-section,
body.woocommerce-cart .ct-container .hero-section,
body.woocommerce-cart .ct-container-full .hero-section,
body.woocommerce-cart [data-row] .hero-section,
body.woocommerce-cart #content .hero-section,
body.woocommerce-cart .content-area .hero-section,
body.woocommerce-cart .site-content .hero-section,
body.woocommerce-cart .entry-header,
body.woocommerce-cart article .entry-header,
body.woocommerce-cart .hero-section .entry-header,
body.woocommerce-cart .entry-header .page-title,
body.woocommerce-cart .entry-header .entry-title,
body.woocommerce-cart .hero-section .page-title,
body.woocommerce-cart .hero-section h1,
body.woocommerce-cart article[class*="post"] .hero-section,
body.woocommerce-cart [class*="hero"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    pointer-events: none !important;
}

/* Remove blank space/empty content wrappers on cart pages */
body.woocommerce-cart .entry-content:empty,
body.woocommerce-cart .ct-container:empty,
body.woocommerce-cart [data-row]:empty,
body.woocommerce-cart .content-area:empty {
    display: none !important;
}

/* Remove min-height that creates blank space on cart pages */
body.woocommerce-cart .entry-content,
body.woocommerce-cart .ct-container,
body.woocommerce-cart [data-row],
body.woocommerce-cart .content-area,
body.woocommerce-cart #main-content {
    min-height: 0 !important;
}

/* Hide empty wrappers that only contain whitespace (modern browsers) */
@supports selector(:has(*)) {

    body.woocommerce-cart .entry-content:has(> *:only-child:empty),
    body.woocommerce-cart .ct-container:has(> *:only-child:empty) {
        display: none !important;
    }

    body.woocommerce-cart .entry-content:not(:has(.woocommerce-cart-form)):not(:has(.cart-collaterals)) {
        min-height: 0 !important;
    }
}

/* Cart Page Layout */
.woocommerce-cart .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.woocommerce-cart-form {
    background: #fff;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 2rem;
}

/* Hide table headers for modern design */
.shop_table thead {
    display: none;
}

.shop_table {
    width: 100%;
    border-collapse: collapse;
    border: none;
}

.shop_table tbody {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.shop_table tr.cart_item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    position: relative;
}

.shop_table td {
    padding: 0;
    border: none;
    vertical-align: top;
}

/* Product Thumbnail */
.product-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    order: 1;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* Product Name & Details */
.product-name {
    flex: 1;
    min-width: 150px;
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 3rem;
}

.product-name>* {
    margin: 0;
}

.product-name a,
.product-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    line-height: 1.5;
    word-wrap: break-word;
}

.product-name .variation {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6B7280;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.5;
}

.product-name .variation dt,
.product-name .variation dd {
    display: inline;
    margin: 0;
}

/* Remove Link - Bottom right position */
.product-remove {
    order: 7;
    position: absolute;
    bottom: 1rem;
    right: 1rem;
}

.product-remove a {
    color: #DC2626;
    font-size: 0;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    position: relative;
}

.product-remove a:hover {
    color: #DC2626;
    background-color: #FEE2E2;
}

/* Add French text "SUPPRIMER" instead of × */
.product-remove a::before {
    content: "SUPPRIMER";
    font-size: 0.75rem;
    display: inline;
}

/* Price Display */
.product-price {
    order: 4;
    font-size: 1rem;
    font-weight: 600;
    color: #059669;
    white-space: nowrap;
    text-align: right;
    min-width: 100px;
}

.product-price .woocommerce-Price-amount {
    display: inline;
}

/* Quantity Controls - Modern Style */
.product-quantity {
    order: 5;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.75rem;
    width: 100%;
}

.product-quantity::before {
    content: "Quantity:";
    font-size: 0.8125rem;
    color: #6B7280;
    font-weight: 400;
}

.quantity {
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 0.375rem;
    overflow: hidden;
    background: #fff;
}

.quantity input[type="number"],
.quantity input.qty {
    width: 50px;
    min-width: 50px;
    text-align: center;
    border: none;
    border-left: 1px solid #D1D5DB;
    border-right: 1px solid #D1D5DB;
    padding: 0.5rem;
    font-size: 0.9375rem;
    background: #fff !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    appearance: textfield;
    -moz-appearance: textfield;
}

.quantity input[type="number"]:focus,
.quantity input.qty:focus {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    outline: none;
    background: #fff !important;
}

.quantity input[type="number"]::-webkit-input-placeholder,
.quantity input.qty::-webkit-input-placeholder {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    opacity: 1;
}

.quantity input[type="number"]::placeholder,
.quantity input.qty::placeholder {
    color: #111827 !important;
    opacity: 1;
}

.quantity input[type="number"]::-webkit-outer-spin-button,
.quantity input[type="number"]::-webkit-inner-spin-button,
.quantity input.qty::-webkit-outer-spin-button,
.quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Subtotal Display */
.product-subtotal {
    order: 6;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    text-align: left;
    margin-top: 0.75rem;
    width: calc(100% - 120px);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-right: 0;
    margin-right: 120px;
}

.product-subtotal::before {
    content: "Subtotal:";
    font-size: 0.8125rem;
    color: #6B7280;
    font-weight: 400;
}

/* Cart Actions */
.shop_table .actions {
    display: none;
}

/* Order Summary (Cart Collaterals) */
.cart-collaterals {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.cart_totals {
    width: 100%;
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cart_totals h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop_table_responsive.cart_totals {
    width: 100%;
    margin-bottom: 0;
}

.shop_table_responsive.cart_totals tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #E5E7EB;
}

.shop_table_responsive.cart_totals tr:last-of-type {
    border-bottom: none;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid #E5E7EB;
    font-weight: 600;
}

.shop_table_responsive.cart_totals th {
    font-weight: 400;
    color: #374151;
    text-align: left;
    padding: 0;
}

.shop_table_responsive.cart_totals td {
    font-weight: 600;
    color: #059669;
    text-align: right;
    padding: 0;
}

/* Separate containers for subtotal, shipping, and total */
.shop_table_responsive.cart_totals tr.cart-subtotal {
    border-bottom: 1px solid #E5E7EB;
}

.shop_table_responsive.cart_totals tr.fee,
.shop_table_responsive.cart_totals tr.shipping {
    background: #F9FAFB;
    padding: 0.875rem 0.5rem;
    margin: 0.5rem 0;
    border-radius: 0.375rem;
    border: 1px solid #E5E7EB;
    border-bottom: 1px solid #E5E7EB;
}

.shop_table_responsive.cart_totals tr.order-total {
    background: #fff;
    padding: 1rem 0.5rem;
    margin-top: 0.75rem;
    border-top: 2px solid #059669;
    border-bottom: none;
}

.shop_table_responsive.cart_totals tr.order-total th,
.shop_table_responsive.cart_totals tr.order-total td {
    font-weight: 600;
    font-size: 1.125rem;
    color: #059669;
}

/* Free delivery styling */
.shop_table_responsive.cart_totals tr.fee td,
.shop_table_responsive.cart_totals tr.shipping td {
    color: #059669;
}

/* Checkout Button */
.wc-proceed-to-checkout {
    margin-top: 1.5rem;
}

.wc-proceed-to-checkout .checkout-button {
    width: 100%;
    background-color: #059669;
    color: #fff;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.wc-proceed-to-checkout .checkout-button:hover {
    background-color: #047857;
    color: #fff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .shop_table tr.cart_item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .product-thumbnail {
        width: 70px;
        height: 70px;
    }

    .product-name {
        min-width: 120px;
        padding-right: 2.5rem;
    }

    .product-remove {
        bottom: 0.75rem;
        right: 0.75rem;
        top: auto;
    }

    .product-remove a {
        font-size: 0.6875rem;
        padding: 0.2rem 0.4rem;
    }

    .product-price {
        font-size: 0.9375rem;
        min-width: 80px;
    }

    .product-quantity,
    .product-subtotal {
        margin-top: 0.5rem;
    }
}