/*
|--------------------------------------------------------------------------
| Markets Center Main Style
|--------------------------------------------------------------------------
| Ecommerce Marketplace Style
| Header
| Sidebar
| Product Grid
| Cart
| Footer
|--------------------------------------------------------------------------
*/


/* Reset */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Arial,sans-serif;
    background:#f5f5f5;
    color:#333;
}

a{
    text-decoration:none;
    color:inherit;
}

ul{
    list-style:none;
}

img{
    max-width:100%;
    display:block;
}



/* Container */

.site-container{
    width:100%;
    min-height:100vh;
}



/* Header */

.header{

    background:#fff;

    box-shadow:0 2px 8px rgba(0,0,0,.1);

    position:sticky;

    top:0;

    z-index:999;

}


.header-container{

    max-width:1400px;

    margin:auto;

    display:flex;

    align-items:center;

    justify-content:space-between;

    padding:15px 20px;

}


.logo-area a{

    font-size:28px;

    font-weight:bold;

    color:#ff6600;

}


.search-area{

    flex:1;

    margin:0 30px;

}


.search-area form{

    display:flex;

}


.search-area input{

    width:100%;

    padding:12px;

    border:1px solid #ddd;

    border-radius:8px 0 0 8px;

}


.search-area button{

    padding:12px 20px;

    border:none;

    background:#ff6600;

    color:#fff;

    cursor:pointer;

    border-radius:0 8px 8px 0;

}


.header-right{

    display:flex;

    gap:20px;

}


.menu-link,
.cart-link{

    position:relative;

    font-weight:600;

}


.cart-badge{

    position:absolute;

    top:-8px;

    right:-12px;

    background:red;

    color:#fff;

    font-size:11px;

    width:20px;

    height:20px;

    border-radius:50%;

    display:flex;

    justify-content:center;

    align-items:center;

}



/* Main Menu */

.main-menu{

    background:#fff;

    border-top:1px solid #eee;

}


.main-menu ul{

    max-width:1400px;

    margin:auto;

    display:flex;

    overflow:auto;

}


.main-menu li a{

    display:block;

    padding:15px;

    white-space:nowrap;

}


.main-menu li a:hover{

    color:#ff6600;

}



/* Main Layout */

.main-wrapper{

    max-width:1400px;

    margin:20px auto;

    display:flex;

    gap:20px;

    padding:0 15px;

}



/* Sidebar */

.sidebar{

    width:260px;

}


.sidebar-box{

    background:#fff;

    border-radius:10px;

    margin-bottom:20px;

    padding:20px;

}


.sidebar-title{

    margin-bottom:15px;

}


.sidebar-menu li{

    margin-bottom:10px;

}


.sidebar-menu a{

    display:block;

    padding:10px;

    border-radius:8px;

}


.sidebar-menu a:hover,
.sidebar-menu a.active{

    background:#ff6600;

    color:#fff;

}



/* Content */

.content-area{

    flex:1;

}







/* Product */

.section-area{

    margin-bottom:30px;

}


.section-header{

    margin-bottom:20px;

}


.product-grid{

    display:grid;

    grid-template-columns:
    repeat(
        auto-fill,
        minmax(
            240px,
            1fr
        )
    );

    gap:20px;

}


.product-card{

    background:#fff;

    border-radius:10px;

    overflow:hidden;

    transition:.3s;

}


.product-card:hover{

    transform:translateY(-5px);

}


.product-image{

    height:250px;

    overflow:hidden;

}


.product-image img{

    width:100%;

    height:100%;

    object-fit:cover;

}


.product-body{

    padding:15px;

}


.product-category{

    font-size:12px;

    color:#888;

}


.product-price{

    color:#ff6600;

    font-size:22px;

    font-weight:bold;

    margin-top:10px;

}


.product-action{

    padding:15px;

}


.addCartBtn{

    width:100%;

    padding:12px;

    border:none;

    background:#ff6600;

    color:#fff;

    cursor:pointer;

    border-radius:8px;

}



/* Product Detail */

.product-detail{

    background:#fff;

    border-radius:10px;

    padding:30px;

    display:flex;

    gap:30px;

}


.product-detail-image{

    width:45%;

}


.product-detail-info{

    flex:1;

}


.large{

    font-size:36px;

}


.product-stock{

    margin:15px 0;

}


.product-description{

    margin-top:20px;

    line-height:1.7;

}


.product-detail-action{

    display:flex;

    gap:15px;

    margin-top:25px;

}


.buy-now-btn{

    padding:12px 25px;

    background:#444;

    color:#fff;

    border-radius:8px;

}



/* Cart */

.cart-layout{

    display:flex;

    gap:20px;

}


.cart-items{

    flex:1;

}


.cart-item{

    display:flex;

    gap:20px;

    align-items:center;

    background:#fff;

    padding:20px;

    border-radius:10px;

    margin-bottom:15px;

}


.cart-image{

    width:100px;

}


.cart-image img{

    width:100px;

    height:100px;

    object-fit:cover;

}


.cart-info{

    flex:1;

}


.cart-qty{

    display:flex;

    align-items:center;

    gap:10px;

}


.cart-qty button{

    width:35px;

    height:35px;

}


.cart-summary{

    width:350px;

    background:#fff;

    border-radius:10px;

    padding:20px;

    height:fit-content;

}


.summary-row,
.summary-total{

    display:flex;

    justify-content:space-between;

    margin:15px 0;

}


.checkout-btn,
.continue-shopping-btn{

    display:block;

    text-align:center;

    margin-top:15px;

    padding:14px;

    border-radius:8px;

}


.checkout-btn{

    background:#ff6600;

    color:#fff;

}


.continue-shopping-btn{

    background:#eee;

}



/* Footer */

.footer{

    background:#222;

    color:#fff;

    margin-top:50px;

}


.footer-container{

    max-width:1400px;

    margin:auto;

    display:grid;

    grid-template-columns:
    repeat(
        auto-fit,
        minmax(
            220px,
            1fr
        )
    );

    gap:30px;

    padding:50px 20px;

}


.footer-column h4{

    margin-bottom:15px;

}


.footer-column ul li{

    margin-bottom:10px;

}


.footer-bottom{

    border-top:1px solid rgba(
        255,
        255,
        255,
        .2
    );

    text-align:center;

    padding:20px;

}



/* Empty */

.empty-product{

    background:#fff;

    padding:50px;

    text-align:center;

    border-radius:10px;

}



/* Responsive */

@media(max-width:992px){

    .main-wrapper{

        flex-direction:column;

    }

    .sidebar{

        width:100%;

    }

    .product-detail{

        flex-direction:column;

    }

    .cart-layout{

        flex-direction:column;

    }

    .cart-summary{

        width:100%;

    }

}


@media(max-width:768px){

    .header-container{

        flex-direction:column;

        gap:15px;

    }

    .search-area{

        width:100%;

        margin:0;

    }

}

/* ================================
   CART COMPLETE OVERRIDE
================================ */

.cart-page,
.checkout-page {
    width: 100%;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: flex-start;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 145px 140px;
    gap: 18px;
    align-items: center;
    background: #fff;
    padding: 18px;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.07);
}

.cart-image {
    width: 110px;
    height: 110px;
    border-radius: 14px;
    overflow: hidden;
    background: #f2f2f2;
}

.cart-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-info h4 {
    font-size: 17px;
    line-height: 1.4;
    color: #222;
    margin-bottom: 8px;
}

.cart-price {
    color: #ff6600;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
}

.cart-qty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cart-qty button,
.qtyBtn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: #ff6600;
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.cart-qty button:hover,
.qtyBtn:hover {
    background: #e65c00;
    transform: scale(1.05);
}

.cart-qty input {
    width: 56px;
    height: 38px;
    border: 1px solid #ddd;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
    background: #fafafa;
}

.cart-subtotal {
    text-align: right;
    font-size: 20px;
    font-weight: 900;
    color: #222;
}

.removeCartBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 92px;
    padding: 9px 14px;
    border: none;
    border-radius: 999px;
    background: #fff0f0;
    color: #d93025;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.removeCartBtn:hover {
    background: #d93025;
    color: #fff;
}

.addCartBtn {
    width: 100%;
    min-height: 42px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff6600, #ff8a00);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
    box-shadow: 0 6px 16px rgba(255,102,0,.25);
}

.addCartBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255,102,0,.35);
}

.addCartBtn:disabled,
.qtyBtn:disabled,
.removeCartBtn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.cart-summary {
    width: 100%;
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    position: sticky;
    top: 145px;
}

.cart-summary h3 {
    font-size: 22px;
    margin-bottom: 18px;
}

.summary-row,
.summary-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
}

.summary-total {
    border-bottom: none;
    font-size: 20px;
    font-weight: 900;
}

.summary-total strong {
    color: #ff6600;
    font-size: 24px;
}

.checkout-btn,
.continue-shopping-btn,
.buy-now-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    border-radius: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: .2s;
}

.checkout-btn {
    background: linear-gradient(135deg, #ff6600, #ff8a00);
    color: #fff;
    margin-top: 18px;
}

.continue-shopping-btn {
    background: #f1f1f1;
    color: #333;
    margin-top: 12px;
}

.checkout-btn:hover,
.continue-shopping-btn:hover,
.buy-now-btn:hover {
    transform: translateY(-2px);
}

.empty-product {
    background: #fff;
    padding: 55px 30px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

/* Mobile Cart */
@media (max-width: 1100px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 90px 1fr;
        gap: 14px;
    }

    .cart-image {
        width: 90px;
        height: 90px;
    }

    .cart-qty,
    .cart-subtotal {
        grid-column: 1 / 3;
        justify-content: flex-start;
        text-align: left;
    }

    .cart-subtotal {
        font-size: 18px;
    }
}

/* ==========================
   Global Price Typography
========================== */

:root{

    --price-font:
    Arial,
    Helvetica,
    sans-serif;

}


/* ราคาทุกหน้า */

.product-price,
.cart-price,
.cart-subtotal,
.summary-total strong,
.product-detail .large,
.price,
.total-price {

    font-family:
        var(--price-font);

    font-size:24px;

    font-weight:800;

    line-height:1.2;

    letter-spacing:-0.5px;

    color:#ff6600;

    font-variant-numeric:
        tabular-nums;

}


/* ราคาในตะกร้ารวม */

.summary-total{

    font-size:20px;
    font-weight:700;

}


/* ราคาย่อย */

.summary-row strong{

    font-family:
        var(--price-font);

    font-size:18px;

    font-weight:700;

    font-variant-numeric:
        tabular-nums;

}


/* ราคาใน Product Detail */

.product-detail .large{

    font-size:34px;

}


/* ราคาใน Product Card */

.product-card .product-price{

    font-size:22px;

}


/* จำนวนสินค้า */

.cart-qty input{

    font-family:
        var(--price-font);

    font-size:16px;

    font-weight:700;

}


/* Badge ตะกร้า */

.cart-badge{

    font-family:
        var(--price-font);

    font-weight:700;

}

/* ==========================
   Checkout Page
========================== */

.checkout-page {
    width: 100%;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: flex-start;
}

.checkout-form-box {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,.07);
}

.checkout-form-box h3 {
    font-size: 24px;
    margin-bottom: 22px;
    color: #222;
}

.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.checkout-form label {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.checkout-form input,
.checkout-form textarea,
.checkout-form select {
    width: 100%;
    border: 1px solid #ddd;
    background: #fafafa;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    color: #222;
    outline: none;
    transition: .2s;
}

.checkout-form textarea {
    resize: vertical;
    min-height: 130px;
}

.checkout-form input:focus,
.checkout-form textarea:focus,
.checkout-form select:focus {
    border-color: #ff6600;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,102,0,.12);
}

.checkout-form select {
    cursor: pointer;
}

.checkout-page .cart-summary {
    background: #fff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    position: sticky;
    top: 145px;
}

.checkout-page .summary-row span {
    color: #555;
    line-height: 1.4;
}

.checkout-page .summary-row strong {
    white-space: nowrap;
}

.checkout-page .summary-total {
    margin-top: 14px;
    padding-top: 18px;
    border-top: 2px solid #f0f0f0;
}

@media (max-width: 1100px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .checkout-page .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .checkout-form-box {
        padding: 20px;
    }

    .checkout-form-box h3 {
        font-size: 21px;
    }

    .checkout-form input,
    .checkout-form textarea,
    .checkout-form select {
        font-size: 15px;
    }
}

/* ==========================
   Mobile Responsive Fix
========================== */

@media (max-width: 992px) {



    .header {
        position: sticky;
        top: 0;
    }

    .header-container {
        flex-direction: column;
        gap: 12px;
        padding: 14px;
    }

    .logo-area a {
        font-size: 24px;
    }

    .search-area {
        width: 100%;
        margin: 0;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
        background: #fafafa;
        padding: 10px 14px;
        border-radius: 12px;
    }

    .main-menu ul {
        overflow-x: auto;
        padding: 0 10px;
        scrollbar-width: none;
    }

    .main-menu ul::-webkit-scrollbar {
        display: none;
    }

    .main-menu li a {
        padding: 13px 12px;
        font-size: 14px;
    }

    .main-wrapper {
        flex-direction: column;
        margin: 12px auto;
        padding: 0 12px;
        gap: 12px;
    }

    .sidebar {
        width: 100%;
    }

    .sidebar-box {
        padding: 14px;
        margin-bottom: 12px;
    }

    .sidebar-menu {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sidebar-menu::-webkit-scrollbar {
        display: none;
    }

    .sidebar-menu li {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .sidebar-menu a {
        white-space: nowrap;
        padding: 10px 14px;
        background: #f5f5f5;
    }

    .hero-banner {
        height: 190px;
        border-radius: 16px;
        margin-bottom: 18px;
    }

    .hero-content h1 {
        font-size: 32px;
    }

    .hero-content p {
        font-size: 15px;
        padding: 0 20px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-image {
        height: 160px;
    }

    .product-body {
        padding: 12px;
    }

    .product-body h4 {
        font-size: 14px;
        line-height: 1.4;
        min-height: 40px;
    }

    .product-card .product-price {
        font-size: 18px;
    }

    .product-action {
        padding: 12px;
    }

    .addCartBtn {
        font-size: 14px;
        min-height: 40px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        padding: 30px 18px;
        gap: 22px;
    }
}

@media (max-width: 768px) {

    .section-header {
        margin-bottom: 14px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    .product-detail {
        padding: 18px;
        flex-direction: column;
        gap: 18px;
    }

    .product-detail-image {
        width: 100%;
    }

    .product-detail-info h1 {
        font-size: 24px;
        line-height: 1.35;
    }

    .product-detail .large {
        font-size: 28px;
    }

    .product-detail-action {
        flex-direction: column;
    }

    .cart-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cart-item {
        grid-template-columns: 86px minmax(0, 1fr);
        padding: 14px;
        gap: 12px;
    }

    .cart-image {
        width: 86px;
        height: 86px;
    }

    .cart-info h4 {
        font-size: 15px;
    }

    .cart-price {
        font-size: 18px;
    }

    .removeCartBtn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .cart-qty,
    .cart-subtotal {
        grid-column: 1 / 3;
        justify-content: space-between;
        text-align: left;
    }

    .cart-subtotal {
        padding-top: 8px;
        border-top: 1px solid #eee;
    }

    .cart-summary {
        position: static;
        padding: 18px;
    }

    .checkout-form-box {
        padding: 18px;
    }

    .checkout-form input,
    .checkout-form textarea,
    .checkout-form select {
        padding: 13px 14px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {

    .header-container {
        padding: 12px;
    }

    .logo-area a {
        font-size: 22px;
    }

    .search-area input {
        padding: 11px;
        font-size: 14px;
    }

    .search-area button {
        padding: 11px 14px;
    }

    .header-right {
        font-size: 14px;
    }

    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .product-image {
        height: 135px;
    }

    .product-body h4 {
        font-size: 13px;
    }

    .product-card .product-price {
        font-size: 16px;
    }

    .addCartBtn {
        font-size: 13px;
        padding: 10px;
    }

    .hero-banner {
        height: 160px;
    }

    .hero-content h1 {
        font-size: 26px;
    }

    .cart-item {
        border-radius: 14px;
    }

    .cart-qty button,
    .qtyBtn {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }

    .cart-qty input {
        width: 48px;
        height: 34px;
    }

    .summary-total strong {
        font-size: 21px;
    }
}


/* =====================================
   CUSTOMER ACCOUNT
===================================== */

.auth-page,
.profile-page {
    width:100%;
}

.auth-page{
    display:flex;
    justify-content:center;
    padding:40px 20px;
}

.auth-card{

    width:100%;
    max-width:520px;

    background:#fff;

    padding:35px;

    border-radius:24px;

    box-shadow:
    0 10px 35px rgba(
        0,0,0,.08
    );

}

.auth-card h2{

    font-size:30px;

    margin-bottom:10px;

    color:#222;

    font-weight:800;

}

.auth-subtitle{

    color:#666;

    margin-bottom:25px;

    line-height:1.6;

}

.auth-form{

    display:flex;

    flex-direction:column;

    gap:14px;

}

.auth-form label{

    font-size:14px;

    color:#444;

    font-weight:700;

}

.auth-form input,
.auth-form textarea,
.auth-form select{

    width:100%;

    border:1px solid #ddd;

    background:#fafafa;

    border-radius:14px;

    padding:14px 16px;

    font-size:15px;

    transition:.25s;

}

.auth-form input:focus,
.auth-form textarea:focus,
.auth-form select:focus{

    border-color:#ff6600;

    background:#fff;

    box-shadow:
    0 0 0 4px
    rgba(
        255,
        102,
        0,
        .12
    );

    outline:none;

}

.auth-btn{

    border:none;

    border-radius:14px;

    padding:14px;

    cursor:pointer;

    background:
    linear-gradient(
        135deg,
        #ff6600,
        #ff8900
    );

    color:#fff;

    font-size:16px;

    font-weight:800;

    margin-top:8px;

    transition:.25s;

}

.auth-btn:hover{

    transform:
    translateY(-2px);

}

.auth-footer{

    text-align:center;

    margin-top:20px;

    color:#666;

}

.auth-footer a{

    color:#ff6600;

    font-weight:700;

    text-decoration:none;

}

.auth-footer a:hover{

    text-decoration:underline;

}


.auth-message{

    display:none;

    padding:14px;

    border-radius:12px;

    font-size:14px;

    margin-top:5px;

}

.auth-message.success{

    display:block;

    background:#ecfff2;

    color:#008a34;

    border:1px solid #bdeccc;

}

.auth-message.error{

    display:block;

    background:#fff2f2;

    color:#d83f3f;

    border:1px solid #ffc7c7;

}


/* ==============================
   PROFILE
============================== */

.profile-card{

    background:#fff;

    border-radius:22px;

    padding:35px;

    box-shadow:
    0 10px 30px
    rgba(
        0,
        0,
        0,
        .06
    );

}

.profile-card h3{

    font-size:28px;

    margin-bottom:10px;

}

.profile-card p{

    color:#666;

    margin-bottom:25px;

}


.profile-menu{

    display:grid;

    grid-template-columns:
    repeat(
        2,
        minmax(
            0,
            1fr
        )
    );

    gap:14px;

}


.profile-menu a,
.profile-menu button{

    display:flex;

    align-items:center;

    justify-content:center;

    text-decoration:none;

    min-height:70px;

    background:#fafafa;

    border-radius:16px;

    border:none;

    color:#222;

    font-weight:700;

    cursor:pointer;

    transition:.25s;

}

.profile-menu a:hover,
.profile-menu button:hover{

    background:#ff6600;

    color:#fff;

    transform:
    translateY(
        -3px
    );

}


/* ==============================
   Mobile
============================== */

@media(max-width:768px){

.auth-card{

padding:25px;

border-radius:18px;

}

.auth-card h2{

font-size:25px;

}

.profile-card{

padding:25px;

}

.profile-menu{

grid-template-columns:
1fr;

}

.profile-menu a,
.profile-menu button{

min-height:60px;

font-size:14px;

}

}


@media(max-width:480px){

.auth-page{

padding:20px 10px;

}

.auth-card{

padding:20px;

}

.auth-form input{

font-size:14px;

padding:12px;

}

.auth-btn{

font-size:14px;

padding:12px;

}

}

/* =====================================
   CART FIX FOR TABLET / IPAD LANDSCAPE
===================================== */

@media (min-width: 769px) and (max-width: 1180px) {

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
        width: 100%;
    }

    .cart-item {
        grid-template-columns: 120px minmax(0, 1fr);
        grid-template-areas:
            "image info"
            "image qty"
            "subtotal subtotal";
        align-items: start;
    }

    .cart-image {
        grid-area: image;
    }

    .cart-info {
        grid-area: info;
        min-width: 0;
    }

    .cart-info h4 {
        font-size: 17px;
        line-height: 1.45;
        word-break: break-word;
    }

    .cart-qty {
        grid-area: qty;
        justify-content: flex-start;
        margin-top: 10px;
    }

    .cart-subtotal {
        grid-area: subtotal;
        text-align: right;
        padding-top: 14px;
        border-top: 1px solid #eee;
        font-size: 22px;
        white-space: nowrap;
    }

    .removeCartBtn {
        margin-top: 8px;
    }
}


/* =====================================
   CART DESKTOP / COMPRESSED SCREEN FIX
   แก้ราคาทับกันตอนจอคอมถูกบีบ
===================================== */

.cart-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.cart-items {
    min-width: 0;
}

.cart-item {
    grid-template-columns: 105px minmax(0, 1fr) auto;
    grid-template-areas:
        "image info subtotal"
        "image qty subtotal";
    align-items: center;
}

.cart-image {
    grid-area: image;
}

.cart-info {
    grid-area: info;
    min-width: 0;
}

.cart-info h4 {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cart-qty {
    grid-area: qty;
    justify-content: flex-start;
}

.cart-subtotal {
    grid-area: subtotal;
    min-width: 130px;
    text-align: right;
    white-space: nowrap;
    font-size: 20px;
}

.cart-summary {
    min-width: 0;
}

/* จอคอมที่ถูกบีบ / Notebook / iPad แนวนอน */

@media (max-width: 1280px) {

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
        width: 100%;
    }

}

/* จอแคบลงอีก */

@media (max-width: 900px) {

    .cart-item {
        grid-template-columns: 90px minmax(0, 1fr);
        grid-template-areas:
            "image info"
            "image qty"
            "subtotal subtotal";
    }

    .cart-subtotal {
        text-align: left;
        border-top: 1px solid #eee;
        padding-top: 12px;
        min-width: 0;
        font-size: 19px;
    }

}

.checkout-address-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-address-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
}

.checkout-address-card input {
    width: auto;
    margin-top: 5px;
}

.checkout-address-card strong {
    display: inline-block;
    margin-bottom: 6px;
}

.checkout-address-card p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 6px;
}


/* ==========================
   CHAT FLOAT STYLE
========================== */

.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 0;
    z-index: 99999;
}

.chat-bubble-text {
    position: absolute;
    right: 10px;
    bottom: 72px;
    width: 285px;
    background: #fff;
    color: #111;
    padding: 18px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    font-size: 14px;
    line-height: 1.7;
}

.chat-bubble-text p {
    margin: 0;
}

.chat-bubble-text::after {
    content: "";
    position: absolute;
    right: 36px;
    bottom: -10px;
    border-width: 10px 8px 0 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.chat-online-btn {
    position: relative;
    min-width: 170px;
    height: 48px;
    border: none;
    background: #008bd2;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,.16);
}

.chat-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #e60012;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-box {
    position: absolute;
    right: 0;
    bottom: 55px;
    width: 340px;
    height: 460px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,.22);
}

.chat-box.active {
    display: flex;
}

.chat-box.active ~ .chat-bubble-text,
.chat-widget.open .chat-bubble-text {
    display: none;
}

/* =========================
   CHAT WIDGET FINAL
========================= */

.chat-widget {
    position: fixed;
    right: 22px;
    bottom: 0;
    z-index: 99999;
}

.chat-bubble-text {
    position: absolute;
    right: 8px;
    bottom: 66px;
    width: 285px;
    background: #fff;
    color: #111;
    padding: 16px 18px;
    border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    font-size: 14px;
    line-height: 1.7;
}

.chat-bubble-text p {
    margin: 0;
}

.chat-bubble-text::after {
    content: "";
    position: absolute;
    right: 36px;
    bottom: -10px;
    border-width: 10px 8px 0 8px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.chat-online-btn {
    position: relative;
    min-width: 180px;
    height: 48px;
    border: none;
    background: #008bd2;
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,.18);
}

.chat-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 22px;
    height: 22px;
    background: #e60012;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-box {
    position: fixed;
    right: 20px;
    bottom: 0;
    width: 360px;
    height: 560px;
    background: #f5f5f5;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,.28);
}

.chat-widget.open .chat-box {
    display: flex;
    animation: chatSlideUp .25s ease;
}

.chat-widget.open .chat-bubble-text,
.chat-widget.open .chat-online-btn {
    display: none;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    height: 62px;
    background: #008bd2;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-title strong {
    font-size: 20px;
}

.chat-header-actions {
    display: flex;
    gap: 12px;
}

.chat-menu,
.chat-close {
    border: none;
    background: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.chat-message-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-message {
    max-width: 250px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
}

.chat-message.bot {
    background: #003b77;
    color: #fff;
    border-radius: 12px 12px 12px 0;
}

.chat-message.user {
    align-self: flex-end;
    background: #008bd2;
    color: #fff;
    border-radius: 12px 12px 0 12px;
}

.chat-form {
    height: 68px;
    background: #fff;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
}

.chat-form input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
}

.chat-form button {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #008bd2;
    color: #fff;
    cursor: pointer;
}

@media (max-width: 768px) {
    .chat-widget {
        right: 12px;
    }

    .chat-bubble-text {
        width: 250px;
    }

    .chat-box {
        right: 0;
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* ======================
   CHAT INPUT OVERRIDE
====================== */

.chat-form{

    display:flex !important;

    align-items:center !important;

    gap:8px !important;

    padding:10px 12px !important;

    background:#fff !important;

    border-top:1px solid #ddd !important;
}


.chat-form input[type="text"]{

    flex:1 !important;

    border:none !important;

    outline:none !important;

    font-size:15px !important;

    min-width:0 !important;
}


/* ปุ่มแนบไฟล์ */

.chat-attach-btn{

    width:40px !important;

    height:40px !important;

    min-width:40px !important;

    display:flex !important;

    align-items:center !important;

    justify-content:center !important;

    cursor:pointer !important;

    border-radius:50% !important;

    color:#555 !important;

    transition:.2s !important;
}


.chat-attach-btn:hover{

    background:#f2f2f2 !important;

    color:#008bd2 !important;

}


.chat-attach-btn svg{

    width:22px !important;

    height:22px !important;

    display:block !important;
}


/* ปุ่มส่ง */

.chat-send-btn{

    width:40px !important;

    height:40px !important;

    min-width:40px !important;

    border:none !important;

    border-radius:50% !important;

    background:#008bd2 !important;

    color:#fff !important;

    cursor:pointer !important;

    font-size:18px !important;
}

/* ==========================
   CHAT BOX SIZE
========================== */

.chat-box{

    position:fixed;

    right:15px;
    bottom:0;

    width:360px;

    height:520px;

    max-width:calc(
        100vw - 20px
    );

    max-height:calc(
        100vh - 20px
    );

    background:#f4f6f9;

    border-radius:
    16px
    16px
    0
    0;

    overflow:hidden;

    display:none;

    flex-direction:column;

    box-shadow:
    0 10px 35px rgba(
        0,
        0,
        0,
        .22
    );
}


/* tablet */

@media(
max-width:992px
){

.chat-box{

    width:340px;

    height:480px;

}

}


/* mobile */

@media(
max-width:768px
){

.chat-box{

    width:100vw;

    height:85vh;

    right:0;

    bottom:0;

    border-radius:
    16px
    16px
    0
    0;

}

}


/* จอเล็กมาก */

@media(
max-width:380px
){

.chat-box{

    height:75vh;

}

}

/* FOOTER MOBILE FIX */

@media (max-width: 992px) {

    body {
        padding-bottom: 0 !important;
    }

    .footer {
        position: static !important;
        margin-bottom: 0 !important;
    }

}

/* Hero Banner Slider */

.hero-banner-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 1;
    min-height: 160px;
    max-height: 360px;
    overflow: hidden;
    border-radius: 18px;
    margin-bottom: 24px;
    background: #f3f3f3;
}

.hero-slides,
.hero-slide {
    width: 100%;
    height: 100%;
}

.hero-slide {
    display: none;
    position: relative;
}

.hero-slide.active {
    display: flex;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-placeholder {
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 18px;
    color: #666;
    text-align: center;
}

.banner-placeholder h2 {
    margin: 0 0 8px;
    font-size: 28px;
}

.banner-placeholder p {
    margin: 0;
    font-size: 14px;
    color: #999;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.65);
    cursor: pointer;
}

.hero-dot.active {
    width: 26px;
    border-radius: 999px;
    background: #fff;
}

/* Tablet */
@media (max-width: 1024px) {
    .hero-banner-slider {
        aspect-ratio: 3 / 1;
        min-height: 180px;
        border-radius: 16px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .hero-banner-slider {
        aspect-ratio: 16 / 9;
        min-height: 180px;
        border-radius: 14px;
        margin-bottom: 18px;
    }

    .banner-placeholder h2 {
        font-size: 22px;
    }

    .banner-placeholder p {
        font-size: 12px;
    }

    .hero-dot {
        width: 8px;
        height: 8px;
    }

    .hero-dot.active {
        width: 22px;
    }
}

/* Flash Sale Discount */

.product-card {
    position: relative;
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ff3d00;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.product-price-wrap {
    margin-top: 8px;
}

.product-old-price {
    color: #999;
    font-size: 13px;
    text-decoration: line-through;
    margin-bottom: 3px;
}

.product-price.sale-price {
    color: #ff3d00;
    font-size: 22px;
    font-weight: 900;
}

@media (max-width: 600px) {
    .discount-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .product-price.sale-price {
        font-size: 18px;
    }
}
/* Product Card Equal Height */

.product-grid {
    align-items: stretch;
}

.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card a {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-image {
    height: 280px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-body h4 {
    min-height: 44px;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price-wrap {
    min-height: 52px;
    margin-top: auto;
}

.product-action {
    margin-top: auto;
}

/* Tablet */

@media (max-width:1024px){

    .product-image{
        height:240px;
    }

}

/* Mobile */

@media (max-width:600px){

    .product-image{
        height:200px;
    }

    .product-body h4{
        min-height:40px;
    }

    .product-price-wrap{
        min-height:48px;
    }

}