/*
 * Compact cart (/cart) and checkout order summary (/checkout) tables.
 * Loaded after every theme's CSS via @section('style') on those two pages,
 * so the "body" prefix is only there to outrank theme-12-common.css.
 */

/* ---------- shared ---------- */
body .cart-area .cart-table,
body .checkout-area .table .cart-table {
    min-width: 0;
    width: 100%;
}

body .cart-area .cart-table thead tr th,
body .cart-area .cart-table tbody tr td,
body .checkout-area .table .cart-table thead tr th,
body .checkout-area .table .cart-table tbody tr td {
    width: auto;
    min-width: 0;
    max-width: none;
    vertical-align: middle;
}

body .cart-area .cart-table thead tr th,
body .checkout-area .table .cart-table thead tr th {
    padding: 12px 10px;
    font-size: 16px;
    white-space: nowrap;
}

body .cart-area .cart-table tbody tr td,
body .checkout-area .table .cart-table tbody tr td {
    padding: 14px 10px;
}

body .cart-area .cart-table thead tr th.prod-column,
body .cart-area .cart-table tbody tr td.prod-column,
body .checkout-area .table .cart-table thead tr th.prod-column,
body .checkout-area .table .cart-table tbody tr td.prod-column {
    width: 96px;
    padding-left: 16px;
}

body .cart-area .cart-table .prod-thumb img,
body .checkout-area .table .cart-table .prod-thumb img {
    width: 72px;
    max-width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
}

body .cart-area .cart-table .prod-title,
body .checkout-area .table .cart-table .prod-title {
    margin-bottom: 4px;
}

body .cart-area .cart-table .title p,
body .checkout-area .table .cart-table td p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

/* desices has a dark page but its headings stay black */
body.theme-desices .cart-area .cart-table .prod-title,
body.theme-desices .checkout-area .table .cart-table .prod-title {
    color: #fff;
}

/* ---------- /cart ---------- */
body .cart-area {
    padding-top: 50px;
    padding-bottom: 60px;
}

body .cart-area .cart-table td.cart_price p {
    white-space: nowrap;
}

body .cart-area .cart-table thead tr th:nth-child(3),
body .cart-area .cart-table tbody tr td.qty {
    width: 130px;
}

body .cart-area .cart-table thead tr th.price,
body .cart-area .cart-table tbody tr td.cart_price {
    width: 170px;
}

body .cart-area .cart-table thead tr th:nth-child(5),
body .cart-area .cart-table tbody tr td.sub-total {
    width: 100px;
    white-space: nowrap;
}

body .cart-area .cart-table thead tr th:nth-child(6),
body .cart-area .cart-table tbody tr td:last-child {
    width: 80px;
    text-align: center;
}

body .cart-area .cart-table td.qty .product-quantity {
    width: max-content;
    align-items: stretch;
}

body .cart-area .cart-table td.qty .product-quantity button {
    width: 32px;
    height: 34px;
}

body .cart-area .cart-table td.qty .product-quantity input {
    width: 42px;
    height: 34px;
    padding: 0 4px;
}

body .cart-area .cart-table td.cart_price p {
    font-size: 14px;
}

body .cart-area .cart-table .remove .checkbox {
    display: inline-block;
}

/* ---------- /checkout ---------- */
body .checkout-area .bottom {
    margin-top: 40px;
    padding-top: 40px;
    padding-bottom: 50px;
}

body .checkout-area .table .cart-table thead tr th:nth-child(3),
body .checkout-area .table .cart-table tbody tr td.qty {
    width: 90px;
    text-align: center;
}

body .checkout-area .table .cart-table thead tr th:nth-child(4),
body .checkout-area .table .cart-table tbody tr td.sub-total {
    width: 100px;
    text-align: right;
    padding-right: 16px;
    white-space: nowrap;
}

/* ---------- /checkout form fields ---------- */
body .checkout-area .field-label {
    margin-bottom: 6px;
    font-size: 15px;
}

body .checkout-area .field-input,
body .checkout-area .input-group {
    margin-bottom: 18px;
}

body .checkout-area form .field-input input:not([type="radio"]):not([type="checkbox"]),
body .checkout-area form .field-input select,
body .checkout-area form .input-group input[type="text"],
body .checkout-area form .field-input textarea {
    height: 46px;
    padding: 0 12px;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-radius: 6px;
}

body .checkout-area form .field-input textarea {
    height: 110px;
    padding: 10px 12px;
    margin-bottom: 0;
}

body .checkout-area form .field-input input:not([type="radio"]):not([type="checkbox"]):focus,
body .checkout-area form .field-input select:focus,
body .checkout-area form .input-group input[type="text"]:focus,
body .checkout-area form .field-input textarea:focus {
    border-color: var(--bs-primary);
    outline: none;
}

/* phone: country-code button + number read as one field */
body .checkout-area .input-group {
    flex-wrap: nowrap;
}

body .checkout-area form .input-group > .input-group-prepend > .billing_country_code,
body .checkout-area form .input-group > .input-group-prepend > .dropdown-toggle {
    height: 46px;
    padding: 0 12px;
    border: 1px solid rgba(128, 128, 128, 0.35);
    border-right: 0;
    border-radius: 6px 0 0 6px;
    background: rgba(128, 128, 128, 0.08);
    color: inherit;
    opacity: 1;
}

body .checkout-area form .input-group input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 0 6px 6px 0;
}

/* ---------- phones: one card per item ---------- */
@media (max-width: 767px) {
    body .cart-area {
        padding-top: 24px;
        padding-bottom: 32px;
    }

    body .checkout-area {
        padding-top: 24px;
    }

    body .cart-area .table-outer {
        overflow-x: visible;
    }

    body .cart-area .cart-table thead,
    body .checkout-area .table .cart-table thead {
        display: none;
    }

    body .cart-area .cart-table,
    body .cart-area .cart-table tbody,
    body .checkout-area .table .cart-table,
    body .checkout-area .table .cart-table tbody {
        display: block;
        width: 100%;
    }

    body .cart-area .cart-table tbody tr,
    body .checkout-area .table .cart-table tbody tr {
        display: grid;
        grid-template-columns: 64px 1fr auto;
        column-gap: 12px;
        row-gap: 6px;
        align-items: center;
        padding: 14px 0;
    }

    body .cart-area .cart-table tbody tr td,
    body .checkout-area .table .cart-table tbody tr td {
        display: block;
        width: auto;
        padding: 0;
        text-align: left;
    }

    body .cart-area .cart-table tbody tr td.prod-column,
    body .checkout-area .table .cart-table tbody tr td.prod-column {
        grid-column: 1;
        grid-row: 1 / span 3;
        align-self: start;
        width: 64px;
        padding: 0;
    }

    body .cart-area .cart-table .prod-thumb img,
    body .checkout-area .table .cart-table .prod-thumb img {
        width: 64px;
        max-width: 64px;
        height: 64px;
    }

    body .cart-area .cart-table .prod-title,
    body .checkout-area .table .cart-table .prod-title {
        font-size: 16px;
    }

    /* /cart: title + remove, price breakdown, qty + total */
    body .cart-area .cart-table tbody tr td:nth-of-type(2) {
        grid-column: 2;
        grid-row: 1;
    }

    body .cart-area .cart-table tbody tr td:last-child {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
        width: auto;
        text-align: right;
    }

    body .cart-area .cart-table tbody tr td.cart_price {
        grid-column: 2 / span 2;
        grid-row: 2;
        width: auto;
    }

    body .cart-area .cart-table tbody tr td.cart_price p {
        display: inline;
        margin-right: 10px;
        font-size: 13px;
    }

    body .cart-area .cart-table tbody tr td.qty {
        grid-column: 2;
        grid-row: 3;
        width: auto;
    }

    body .cart-area .cart-table tbody tr td.sub-total {
        grid-column: 3;
        grid-row: 3;
        width: auto;
        text-align: right;
        font-weight: 600;
    }

    /* /checkout: title, then qty + total */
    body .checkout-area .table .cart-table tbody tr td:nth-of-type(2) {
        grid-column: 2 / span 2;
        grid-row: 1;
    }

    body .checkout-area .table .cart-table tbody tr td.qty {
        grid-column: 2;
        grid-row: 2;
        width: auto;
        text-align: left;
    }

    body .checkout-area .table .cart-table tbody tr td.qty::before {
        content: "\00D7\00a0";
    }

    body .checkout-area .table .cart-table tbody tr td.sub-total {
        grid-column: 3;
        grid-row: 2;
        width: auto;
        padding: 0;
        text-align: right;
        font-weight: 600;
    }

    body .checkout-area .bottom {
        margin-top: 24px;
        padding-top: 28px;
        padding-bottom: 36px;
    }
}
