
/* ============================================
   TIO PELON'S — CART PAGE
   Complete consolidated stylesheet
   ============================================ */

/* PAGE */
.tio-cart-layout {
    background: #fff;
    color: #17120f;
}

.tio-cart-layout .wrap {
    max-width: 1240px;
    margin: 0 auto;
}

.tio-cart-layout h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(36px, 4vw, 54px);
    line-height: 1.15;
    color: #17120f;
    margin: 0 0 30px;
}

/* MAIN LAYOUT */
.tio-cart-layout .woocommerce {
    display: block;
}

.tio-cart-layout .woocommerce::after {
    content: "";
    display: block;
    clear: both;
}

.tio-cart-layout .woocommerce > .woocommerce-cart-form,
.tio-cart-layout .woocommerce > .cart-collaterals {
    box-sizing: border-box;
    min-width: 0;
}

.tio-cart-layout .cart-collaterals,
.tio-cart-layout .cart-collaterals .cart_totals {
    float: none !important;
    clear: none !important;
    width: 100% !important;
    margin: 0 !important;
}

/* CREAM CARDS */
.tio-cart-layout .woocommerce > .woocommerce-cart-form,
.tio-cart-layout .cart-collaterals .cart_totals {
    background: #fffaf1;
    border: 1px solid #e6d8c7;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(45, 29, 17, 0.08);
    padding: 24px;
    box-sizing: border-box;
}

/* PRODUCT TABLE RESET */
.tio-cart-layout .woocommerce-cart-form table.shop_table {
    display: table !important;
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tio-cart-layout .woocommerce-cart-form table.shop_table thead {
    display: table-header-group !important;
}

.tio-cart-layout .woocommerce-cart-form table.shop_table tbody {
    display: table-row-group !important;
}

.tio-cart-layout .woocommerce-cart-form table.shop_table tr {
    display: table-row !important;
}

.tio-cart-layout .woocommerce-cart-form table.shop_table th,
.tio-cart-layout .woocommerce-cart-form table.shop_table td {
    display: table-cell !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    max-width: none;
    vertical-align: middle;
    white-space: normal;
    word-break: normal !important;
    overflow-wrap: normal !important;
    text-align: left;
    padding: 14px 10px;
    border-color: #e6d8c7;
    color: #17120f;
}

/* PRODUCT DETAILS */
.tio-cart-layout .woocommerce-cart-form table.shop_table th {
    font-family: 'Playfair Display', Georgia, serif;
}

.tio-cart-layout .woocommerce-cart-form td.product-name,
.tio-cart-layout .woocommerce-cart-form td.product-name a {
    min-width: 150px;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
    letter-spacing: normal;
}

.tio-cart-layout .woocommerce-cart-form td.product-name a {
    color: #17120f;
    font-weight: 700;
    text-decoration: none;
}

.tio-cart-layout .woocommerce-cart-form td.product-name a:hover {
    color: #c9001d;
}

.tio-cart-layout .woocommerce-cart-form td.product-thumbnail {
    min-width: 76px;
}

.tio-cart-layout .woocommerce-cart-form td.product-thumbnail img {
    width: 70px;
    max-width: 70px;
    height: auto;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e6d8c7;
}

.tio-cart-layout .woocommerce-cart-form td.product-quantity {
    min-width: 90px;
}

.tio-cart-layout .woocommerce-cart-form td.product-price,
.tio-cart-layout .woocommerce-cart-form td.product-subtotal {
    white-space: nowrap;
}

.tio-cart-layout .woocommerce-cart-form td.actions {
    text-align: left;
}

.tio-cart-layout .woocommerce-cart-form .quantity {
    display: inline-flex;
}

/* WHITE INPUT FIELDS */
.tio-cart-layout .woocommerce-cart-form .quantity input.qty,
.tio-cart-layout .woocommerce-cart-form input#coupon_code,
.tio-cart-layout .woocommerce-cart-form input.input-text {
    background: #fff !important;
    border: 1px solid #dccbb8 !important;
    border-radius: 11px !important;
    color: #17120f !important;
    min-height: 44px;
    box-sizing: border-box;
}

.tio-cart-layout .woocommerce-cart-form .quantity input.qty {
    width: 72px;
    padding: 8px;
    text-align: center;
}

.tio-cart-layout .woocommerce-cart-form input#coupon_code {
    width: 150px;
    max-width: 100%;
    padding: 8px 12px;
}

.tio-cart-layout .woocommerce-cart-form input:focus {
    outline: 2px solid #087f7a;
    outline-offset: 1px;
}

/* CART BUTTONS */
.tio-cart-layout .woocommerce-cart-form button.button,
.tio-cart-layout .woocommerce-cart-form input.button {
    border: 1px solid #dccbb8 !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #17120f !important;
    padding: 12px 20px !important;
    font-family: Poppins, Arial, sans-serif;
    font-weight: 700;
    min-height: 44px;
}

.tio-cart-layout .woocommerce-cart-form button.button:hover,
.tio-cart-layout .woocommerce-cart-form input.button:hover {
    background: #f8f0e3 !important;
}

/* ============================================
   CART TOTALS — EXPLICIT TABLE RESET
   ============================================ */

.tio-cart-layout .cart-collaterals .cart_totals h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(24px, 2.5vw, 32px);
    color: #17120f;
    margin: 0 0 20px;
}

/* Restore standard table structure */
.tio-cart-layout .cart-collaterals .cart_totals table.shop_table {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    margin: 0 0 20px;
}

.tio-cart-layout .cart-collaterals .cart_totals table tbody {
    display: table-row-group !important;
}

.tio-cart-layout .cart-collaterals .cart_totals table tr {
    display: table-row !important;
}

.tio-cart-layout .cart-collaterals .cart_totals table tr th,
.tio-cart-layout .cart-collaterals .cart_totals table tr td {
    display: table-cell !important;
    position: static !important;
    float: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    box-sizing: border-box !important;
    vertical-align: top !important;
    padding: 16px 8px !important;
    border-color: #e6d8c7 !important;
    color: #17120f !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    writing-mode: horizontal-tb !important;
}

/* All totals labels */
.tio-cart-layout .cart_totals table tr th {
    width: 40% !important;
    max-width: none !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-family: 'Spectral', Georgia, serif;
}

/* All totals amounts */
.tio-cart-layout .cart_totals table tr td {
    width: 60% !important;
    max-width: none !important;
    text-align: right !important;
}

/* Explicitly restore Subtotal */
.tio-cart-layout .cart_totals table tr.cart-subtotal th {
    display: table-cell !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: #17120f !important;
    text-indent: 0 !important;
    font-weight: 700 !important;
}

/* Restore Subtotal amount */
.tio-cart-layout .cart_totals table tr.cart-subtotal td {
    display: table-cell !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: #17120f !important;
}

/* Shipping row */
.tio-cart-layout .cart_totals table tr.shipping th {
    text-align: left !important;
}

.tio-cart-layout .cart_totals table tr.shipping td {
    text-align: right !important;
}

/* Hide destination and address calculator */
.tio-cart-layout .cart_totals
.woocommerce-shipping-destination,
.tio-cart-layout .cart_totals
.woocommerce-shipping-calculator {
    display: none !important;
}

/* Keep actual WooCommerce shipping rate visible */
.tio-cart-layout .cart_totals .woocommerce-shipping-methods {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.tio-cart-layout .cart_totals .woocommerce-shipping-methods li {
    margin: 0 !important;
    padding: 0 !important;
}

/* Total row */
.tio-cart-layout .cart_totals table tr.order-total th,
.tio-cart-layout .cart_totals table tr.order-total td {
    font-size: 19px !important;
    font-weight: 800 !important;
}

/* CHECKOUT BUTTON */
.tio-cart-layout .cart-collaterals
.wc-proceed-to-checkout a.checkout-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background: #c9001d !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 16px 20px !important;
    min-height: 52px;
    text-align: center;
    font-family: Poppins, Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(201, 0, 29, 0.14);
}

.tio-cart-layout .cart-collaterals
.wc-proceed-to-checkout a.checkout-button:hover {
    background: #aa0019 !important;
}

/* ============================================
   DESKTOP LAYOUT
   ============================================ */
@media (min-width: 1100px) {
    .tio-cart-layout .woocommerce {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(320px, 370px) !important;
        gap: 32px;
        align-items: start !important;
    }

    .tio-cart-layout .woocommerce > .woocommerce-cart-form {
        grid-column: 1;
        width: 100% !important;
        min-width: 0;
        overflow-x: auto;
        margin: 0;
    }

    .tio-cart-layout .woocommerce > .cart-collaterals {
        grid-column: 2;
        width: 100% !important;
        min-width: 0;
        align-self: start !important;
        margin: 0;
    }

    .tio-cart-layout .woocommerce > .woocommerce-notices-wrapper,
    .tio-cart-layout .woocommerce > .woocommerce-message,
    .tio-cart-layout .woocommerce > .woocommerce-error,
    .tio-cart-layout .woocommerce > .woocommerce-info {
        grid-column: 1 / -1;
    }
}

/* TABLET */
@media (max-width: 1099px) {
    .tio-cart-layout .woocommerce {
        display: block !important;
    }

    .tio-cart-layout .woocommerce > .woocommerce-cart-form {
        width: 100% !important;
        overflow-x: auto;
        margin-bottom: 32px;
    }

    .tio-cart-layout .woocommerce > .cart-collaterals {
        width: 100% !important;
    }
}

/* MOBILE */
@media (max-width: 767px) {
    .tio-cart-layout .woocommerce > .woocommerce-cart-form,
    .tio-cart-layout .cart-collaterals .cart_totals {
        padding: 16px;
        border-radius: 16px;
    }

    /* Mobile product table */
    .tio-cart-layout .woocommerce-cart-form table.shop_table,
    .tio-cart-layout .woocommerce-cart-form table.shop_table tbody,
    .tio-cart-layout .woocommerce-cart-form table.shop_table tr,
    .tio-cart-layout .woocommerce-cart-form table.shop_table td {
        display: block !important;
    }

    .tio-cart-layout .woocommerce-cart-form table.shop_table thead {
        display: none !important;
    }

    .tio-cart-layout .woocommerce-cart-form table.shop_table td {
        width: 100% !important;
        text-align: right;
        border-color: #e6d8c7;
    }

    .tio-cart-layout .woocommerce-cart-form table.shop_table td::after {
        content: "";
        display: block;
        clear: both;
    }

    .tio-cart-layout .woocommerce-cart-form table.shop_table td.product-name {
        min-width: 0;
    }

    .tio-cart-layout .woocommerce-cart-form table.shop_table td.actions {
        text-align: left;
    }

    .tio-cart-layout .woocommerce-cart-form td.actions .coupon {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .tio-cart-layout .woocommerce-cart-form
    td.actions .coupon input#coupon_code {
        flex: 1 1 120px;
    }

    /* Keep Cart totals as a proper two-column table */
    .tio-cart-layout .cart_totals table.shop_table,
    .tio-cart-layout .cart_totals table.shop_table tbody {
        display: table !important;
        width: 100% !important;
    }

    .tio-cart-layout .cart_totals table.shop_table tr {
        display: table-row !important;
    }

    .tio-cart-layout .cart_totals table.shop_table tr th,
    .tio-cart-layout .cart_totals table.shop_table tr td {
        display: table-cell !important;
    }
}


/* FIX: Missing Cart totals Subtotal label */

.tio-cart-layout .cart_totals
tr.cart-subtotal::before {
    content: "Subtotal";
    display: table-cell;
    width: 40%;
    padding: 16px 8px;
    text-align: left;
    vertical-align: middle;
    font-family: 'Spectral', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #17120f;
}

/* Keep the subtotal amount aligned */
.tio-cart-layout .cart_totals
tr.cart-subtotal > .woocommerce-Price-amount {
    display: table-cell;
    width: 60%;
    padding: 16px 8px;
    text-align: right;
}
