/* MINGYM WooCommerce Cart & Checkout Styles */

/* ── Cart page: flex side by side, top aligned ── */
.woocommerce-cart-form-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 24px !important;
    align-items: flex-start !important;
    width: 100% !important;
}

.woocommerce-cart-form-wrapper .woocommerce-cart-form {
    flex: 1 !important;
    min-width: 0 !important;
}

.woocommerce-cart-form-wrapper .cart-collaterals {
    flex: 0 0 auto !important;
    width: 380px !important;
}

/* ── Force desktop table layout ── */
.woocommerce-cart-form table.shop_table,
.woocommerce-cart-form table.shop_table.shop_table_responsive {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    border: 2px solid #000 !important;
    margin-bottom: 24px !important;
    font-family: 'Montserrat', sans-serif !important;
    table-layout: fixed !important;
}

.woocommerce-cart-form table.shop_table thead,
.woocommerce-cart-form table.shop_table thead tr,
.woocommerce-cart-form table.shop_table tbody,
.woocommerce-cart-form table.shop_table tbody tr {
    display: table-row !important;
}

.woocommerce-cart-form table.shop_table th,
.woocommerce-cart-form table.shop_table td {
    display: table-cell !important;
}

/* ── Table columns - fixed widths to match header with content ── */
.woocommerce-cart-form table.shop_table td.product-remove { width: 50px !important; }
.woocommerce-cart-form table.shop_table td.product-thumbnail { width: 70px !important; }
.woocommerce-cart-form table.shop_table td.product-name { width: auto !important; }
.woocommerce-cart-form table.shop_table td.product-price { width: 110px !important; }
.woocommerce-cart-form table.shop_table td.product-quantity { width: 100px !important; }
.woocommerce-cart-form table.shop_table td.product-subtotal { width: 110px !important; }

.woocommerce-cart-form table.shop_table thead th.product-remove { width: 50px !important; }
.woocommerce-cart-form table.shop_table thead th.product-thumbnail { width: 70px !important; }
.woocommerce-cart-form table.shop_table thead th.product-name { width: auto !important; }
.woocommerce-cart-form table.shop_table thead th.product-price { width: 110px !important; }
.woocommerce-cart-form table.shop_table thead th.product-quantity { width: 100px !important; }
.woocommerce-cart-form table.shop_table thead th.product-subtotal { width: 110px !important; }

/* ── Table header ── */
.woocommerce-cart-form table.shop_table thead th {
    background: #fff !important;
    color: #000 !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.75rem !important;
    padding: 12px 8px !important;
    border-bottom: 2px solid #000 !important;
}

/* Header alignment to match content */
.woocommerce-cart-form table.shop_table thead th.product-remove,
.woocommerce-cart-form table.shop_table thead th.product-thumbnail,
.woocommerce-cart-form table.shop_table thead th.product-name {
    text-align: left !important;
}

.woocommerce-cart-form table.shop_table thead th.product-price,
.woocommerce-cart-form table.shop_table thead th.product-subtotal {
    text-align: right !important;
}

.woocommerce-cart-form table.shop_table thead th.product-quantity {
    text-align: center !important;
}

/* ── Table cells ── */
.woocommerce-cart-form table.shop_table tbody td {
    padding: 14px 8px !important;
    border-bottom: 1px solid #e0e0e0 !important;
    vertical-align: middle !important;
    font-size: 0.875rem !important;
}

/* TD alignment to match TH */
.woocommerce-cart-form table.shop_table tbody td.product-remove,
.woocommerce-cart-form table.shop_table tbody td.product-thumbnail,
.woocommerce-cart-form table.shop_table tbody td.product-name {
    text-align: left !important;
}

.woocommerce-cart-form table.shop_table tbody td.product-price,
.woocommerce-cart-form table.shop_table tbody td.product-subtotal {
    text-align: right !important;
}

.woocommerce-cart-form table.shop_table tbody td.product-quantity {
    text-align: center !important;
}

/* Hide responsive labels */
.woocommerce-cart-form table.shop_table td::before,
.woocommerce-cart-form table.shop_table td[data-title]::before {
    display: none !important;
}

/* ── Product remove ── */
.woocommerce-cart-form table.shop_table td.product-remove a.remove {
    color: #ccc !important;
    font-size: 1.25rem !important;
    text-decoration: none !important;
    font-weight: 700 !important;
}

.woocommerce-cart-form table.shop_table td.product-remove a.remove:hover {
    color: #ff4b1f !important;
}

/* ── Product thumbnail ── */
.woocommerce-cart-form table.shop_table td.product-thumbnail img {
    width: 55px !important;
    height: 55px !important;
    object-fit: cover !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
}

/* ── Product name/price ── */
.woocommerce-cart-form table.shop_table td.product-name {
    font-weight: 600 !important;
}

.woocommerce-cart-form table.shop_table td.product-name a {
    color: #000 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.woocommerce-cart-form table.shop_table td.product-price,
.woocommerce-cart-form table.shop_table td.product-subtotal {
    font-weight: 700 !important;
}

/* ── Quantity ── */
.woocommerce-cart-form table.shop_table td.product-quantity input[type="number"] {
    width: 60px !important;
    padding: 8px !important;
    border: 1.5px solid #000 !important;
    text-align: center !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 600 !important;
    border-radius: 0 !important;
    margin: 0 auto !important;
    display: block !important;
}

/* ── Cart Actions ── */
.woocommerce-cart-form .actions {
    padding: 16px 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.woocommerce-cart-form .coupon {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
}

.woocommerce-cart-form .coupon input[type="text"] {
    padding: 10px 12px !important;
    border: 1.5px solid #000 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.875rem !important;
    width: 200px !important;
    border-radius: 0 !important;
}

.woocommerce-cart-form .coupon button[type="submit"],
.woocommerce-cart-form .coupon input[type="submit"] {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    padding: 10px 20px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    cursor: pointer !important;
    font-family: 'Montserrat', sans-serif !important;
    border-radius: 0 !important;
}

.woocommerce-cart-form .coupon button[type="submit"]:hover,
.woocommerce-cart-form .coupon input[type="submit"]:hover {
    background: #000 !important;
    color: #fff !important;
}

/* ── Update Cart button ── */
.woocommerce-cart-form button[name="update_cart"],
.woocommerce-cart-form input[name="update_cart"] {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
    padding: 10px 20px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    cursor: pointer !important;
    font-family: 'Montserrat', sans-serif !important;
    border-radius: 0 !important;
}

.woocommerce-cart-form button[name="update_cart"]:hover,
.woocommerce-cart-form input[name="update_cart"]:hover {
    background: #000 !important;
    color: #fff !important;
}

/* ── Cart Totals ── */
.cart_totals,
.cart_totals-inner {
    width: 100% !important;
    border: 2px solid #000 !important;
    padding: 0 !important;
}

.cart_totals h2 {
    font-size: 1.125rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 16px !important;
    border-bottom: 2px solid #000 !important;
    margin: 0 !important;
    background: #fff !important;
}

.cart_totals table.shop_table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    table-layout: fixed !important;
}

/* Align with product table columns: remove(50) + thumbnail(70) + name(auto) + price(110) + quantity(100) = 330px before subtotal */
/* Subtotal column starts at ~330px from left, width 110px */
.cart_totals table.shop_table th {
    text-align: left !important;
    padding: 12px 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.8125rem !important;
    border-bottom: 1px solid #e0e0e0 !important;
    width: 110px !important;  /* Match product-subtotal width */
}

.cart_totals table.shop_table td {
    padding: 12px 8px !important;
    text-align: right !important;
    border-bottom: 1px solid #e0e0e0 !important;
    font-weight: 600 !important;
    width: auto !important;
}

/* ── Proceed to Checkout button ── */
.cart_totals .wc-proceed-to-checkout {
    padding: 16px !important;
    background: #fafafa !important;
}

.cart_totals .wc-proceed-to-checkout a.checkout-button {
    display: block !important;
    width: 100% !important;
    background: #000 !important;
    color: #fff !important;
    padding: 14px 32px !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    border: 2px solid #000 !important;
    cursor: pointer !important;
    font-family: 'Montserrat', sans-serif !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

.cart_totals .wc-proceed-to-checkout a.checkout-button:hover {
    background: #fff !important;
    color: #000 !important;
}

/* ── Checkout Page ── */
.woocommerce-checkout {
    font-family: 'Montserrat', sans-serif !important;
}

.woocommerce-checkout .col2-set {
    display: flex !important;
    gap: 32px !important;
    margin-bottom: 40px !important;
}

.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    flex: 1 !important;
}

.woocommerce-checkout h3 {
    font-size: 1.125rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #000 !important;
}

.woocommerce-checkout .form-row {
    padding: 8px 0 !important;
    margin-bottom: 12px !important;
}

.woocommerce-checkout .form-row label {
    display: block !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 8px !important;
    color: #000 !important;
}

.woocommerce-checkout .form-row label .required {
    color: #ff4b1f !important;
    text-decoration: none !important;
}

.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row textarea,
.woocommerce-checkout .form-row select {
    width: 100% !important;
    padding: 12px !important;
    border: 1.5px solid #000 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.9375rem !important;
    background: #fff !important;
    border-radius: 0 !important;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    /* Stack on tablet/mobile */
    .woocommerce-cart-form-wrapper {
        flex-direction: column !important;
    }

    .woocommerce-cart-form-wrapper .woocommerce-cart-form,
    .woocommerce-cart-form-wrapper .cart-collaterals {
        width: 100% !important;
        flex: none !important;
    }

    /* Cart table - stack layout on mobile */
    .woocommerce-cart-form table.shop_table {
        display: block !important;
        table-layout: auto !important;
    }

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

    .woocommerce-cart-form table.shop_table tbody {
        display: block !important;
    }

    .woocommerce-cart-form table.shop_table tbody tr {
        display: grid !important;
        grid-template-columns: 1fr auto auto auto !important;
        gap: 10px !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid #e0e0e0 !important;
        align-items: center !important;
    }

    .woocommerce-cart-form table.shop_table td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        font-size: 0.8125rem !important;
        width: auto !important;
    }

    .woocommerce-cart-form table.shop_table td::before {
        display: none !important;
    }

    .woocommerce-cart-form table.shop_table td.product-remove {
        grid-row: 1 !important;
        grid-column: 4 !important;
    }

    .woocommerce-cart-form table.shop_table td.product-thumbnail {
        display: none !important;
    }

    .woocommerce-cart-form table.shop_table td.product-name {
        grid-row: 1 !important;
        grid-column: 1 !important;
        font-weight: 600 !important;
    }

    .woocommerce-cart-form table.shop_table td.product-name a {
        display: block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 180px !important;
    }

    .woocommerce-cart-form table.shop_table td.product-price,
    .woocommerce-cart-form table.shop_table td.product-quantity,
    .woocommerce-cart-form table.shop_table td.product-subtotal {
        grid-row: 1 !important;
        font-weight: 700 !important;
        white-space: nowrap !important;
    }

    .woocommerce-cart-form table.shop_table td.product-quantity input[type="number"] {
        width: 44px !important;
        padding: 6px !important;
        font-size: 0.8125rem !important;
    }

    .woocommerce-cart-form .actions {
        padding: 12px 0 !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .woocommerce-cart-form .coupon {
        width: 100% !important;
        flex-wrap: wrap !important;
    }

    .woocommerce-cart-form .coupon input[type="text"] {
        width: 120px !important;
        flex: 1 !important;
        font-size: 0.75rem !important;
        padding: 8px 10px !important;
    }

    .woocommerce-cart-form button[name="update_cart"] {
        padding: 8px 12px !important;
        font-size: 0.6875rem !important;
    }

    .woocommerce-checkout .col2-set {
        flex-direction: column !important;
    }
}

@media (max-width: 480px) {
    .wc-page-wrapper {
        padding: 20px 0 !important;
    }

    .wc-page-inner {
        padding: 0 12px !important;
    }

    .woocommerce-cart-form table.shop_table tbody tr {
        grid-template-columns: 1fr auto auto !important;
        gap: 6px !important;
    }

    .woocommerce-cart-form table.shop_table td.product-price,
    .woocommerce-cart-form table.shop_table td.product-quantity {
        font-size: 0.75rem !important;
    }

    .woocommerce-cart-form table.shop_table td.product-name a {
        max-width: 120px !important;
    }

    .woocommerce-cart-form table.shop_table td.product-subtotal {
        display: none !important;
    }

    .cart_totals .wc-proceed-to-checkout a.checkout-button {
        font-size: 0.6875rem !important;
        letter-spacing: 0.05em !important;
        padding: 12px 16px !important;
    }
}

/* ── Logo image protection (override global img{max-width:100%}) ── */
header .site-logo img,
header .mobile-nav-logo img {
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    flex-shrink: 0 !important;
}
