
/* Base Layout */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
}

/* Flex Layout for Footer */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wrapper {
    flex: 1 0 auto;
}

footer {
    flex-shrink: 0;
    background: #f0f0f0;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    color: #333;
    height: 100px;
}

/* Header */
header {
    background: #022751;
    /* background: #0070f3; */
    color: white;
    padding: 10px 20px;
    text-align: center;
}

/* Main Content */
.container {
    max-width: 1200px;
    margin: auto;
    padding: 40px 20px;
    text-align: center;
}

h1,
h2,
p {
    color: #022751;
}

/* Cart Table */
#cart-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th,
td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

th {
    background: #0070f3;
    color: white;
    text-align: left;
}

#cart-table td {
    text-align: left;
}

tbody tr:nth-child(even) {
    background: #f0f8ff;
}

#cart-table td input[type="number"] {
    width: 70px;
    padding: 5px;
    font-size: 16px;
}

/* Mobile Responsive Table */
@media (max-width: 768px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tbody tr {
        margin-bottom: 15px;
        background: #f9f9f9;
        padding: 10px;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    }

    td {
        text-align: right;
        /* Mobile = Right aligned */
        position: relative;
        padding-left: 50%;
    }

    td::before {
        position: absolute;
        top: 50%;
        left: 15px;
        transform: translateY(-50%);
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
    }

    td:nth-child(1)::before {
        content: "Quantity";
    }

    td:nth-child(2)::before {
        content: "Product";
    }

    td:nth-child(3)::before {
        content: "Price";
    }

    td:nth-child(4)::before {
        content: "Total";
    }

    td:nth-child(5)::before {
        content: "Remove";
    }
}

/* Grand Total */
#grand-total {
    font-size: 24px;
    font-weight: bold;
    color: #0070f3;
    text-align: right;
    /*margin-top: 20px;*/
    margin-bottom: 20px;
}

/* Buttons */
.checkout-btn,
.add-btn,
.remove-btn,
.btn-home {
    font-size: 16px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.checkout-btn,
.btn-home {
    background: #0070f3;
    color: white;
    padding: 15px 30px;
    font-size: 18px;
    display: inline-block;
    text-decoration: none;
}

.checkout-btn:hover,
.btn-home:hover {
    background: #022751;
}

.add-btn {
    background: #28a745;
    color: white;
}

.add-btn:hover {
    background: #022751;
}

.remove-btn {
    background: none;
    color: #ff0000;
    font-size: 24px;
}

.remove-btn:hover {
    color: #022751;
}

/* Other Section */
.other-section {
    background: #eef6ff;
    padding: 40px 20px;
    margin-top: 50px;
    border-radius: 15px;
}

/* Product Cards */
.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.card {
    background: white;
    border: none;
    border-radius: 10px;
    width: 200px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.card img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 8px;
}

.card h4 {
    margin: 10px 0;
    font-size: 18px;
}

.card p {
    font-size: 16px;
    color: #222;
    font-weight: bold;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0070f3;
    color: white;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: none;
    z-index: 1000;
}

#back-to-top:hover {
    background: #022751;
}

address {
    font-style: normal;
    margin: 0;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.cart-flex-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-top: 20px;
    margin-bottom: 20px;
}
.cart-table-col {
    flex: 2;
    min-width: 0;
}
.cart-summary-col {
    flex: 1;
    background: #f8fafd;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px 24px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 260px;
    max-width: 350px;
    margin: 0 auto;
}
@media (min-width: 992px) {
    .cart-flex-container {
        flex-direction: row;
        align-items: flex-start;
    }
    .cart-table-col {
        margin-right: 32px;
    }
    .cart-summary-col {
        margin: 0;
    }
}
@media (max-width: 991px) {
    .cart-summary-col {
        max-width: 100%;
    }
}
@media (max-width: 768px) {
    .cart-flex-container {
        flex-direction: column;
    }
    .cart-table-col, .cart-summary-col {
        /*margin-right: 0;*/
        max-width: 100%;
    }
    .cart-summary-col {
        margin-top: 24px;
    }
}