* {
    box-sizing: border-box;
    font-family: 'Anuphan', 'Open Sans', sans-serif;
}

html, body {
    padding: 0;
    margin: 0;
}

nav {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#cartSummary {
    display: none;
    position: absolute;
    top: 72px;
    right: 16px;
    background: #ffffff;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    width: min(92vw, 520px);
    box-shadow: 0 10px 30px rgba(0,0,0,.10);

    table {
        width: 100%;
        border-collapse: collapse;

        th {
            font-weight: 700;
        }

        th, td {
            min-width: 100px;
            text-align: center;
            padding: 8px 10px;
        }
    }
}

#productList {
    display: grid;
    max-width: 1240px;
    margin: 4em auto;
    padding: 0 1.5em;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5em;
}

.productCard {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
    transition: transform .15s ease, box-shadow .15s ease;
}
.productCard:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.productThumbnail {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.productBottomSheet {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.productName {
    display: block;
    margin-top: 2px;
    font-weight: 700;
    font-size: 1.05rem;
}

button {
    background-color: #2563eb;
    border-radius: 10px;
    border: none;
    color: #ffffff;
    padding: 0.6em 1.1em;
    font-size: 16px;
    line-height: 1;
    transition: transform .12s ease, box-shadow .12s ease, background-color .2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);

    &:hover {
        cursor: pointer;
        transform: translateY(-1px);
        box-shadow: 0 6px 12px rgba(0,0,0,.12);
    }

    &:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(0,0,0,.08);
    }
}

.badge {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: #ef4444;
    color: #ffffff;
    margin-left: 8px;
}

.cartActions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

/* เน้นปุ่มสั่งซื้อให้เด่นขึ้นเล็กน้อย */
#checkoutBtn {
    font-weight: 700;
    min-width: 160px;
}

@media (max-width: 600px) {
    .cartActions {
        justify-content: stretch;
    }
    .cartActions button {
        flex: 1;
    }

    #cartSummary {
        right: 8px;
        left: 8px;
        width: auto;
    }

    #productList {
        margin: 2em auto;
        gap: 1em;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}
