/* === NỀN CHUNG ĐỒNG BỘ TRANG CHÍNH LA CÀ COFFEE === */
body {
    font-family: 'Be Vietnam Pro', Arial, sans-serif;
    background-color: #f6efe6;
    color: #2f1e18;
    margin: 0;
    padding: 20px;
}

/* === 1. TRANG THỰC ĐƠN & GIỎ HÀNG === */
.container {
    margin: 0 auto;
    max-width: 1120px;
    width: 100%;
    box-sizing: border-box;
    background-color: #fffaf4;
    padding: 26px;
    box-shadow: 0 8px 24px rgba(47, 30, 24, 0.08);
    position: relative;
    border-radius: 14px;
    border: 1px solid #e6d7c6;
}

.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background-color: #f2e5d5;
    padding: 12px 20px;
    border-radius: 10px;
    margin-bottom: 18px;
    border: 1px solid #dec9b2;
}

.user-bar span {
    font-weight: 600;
    color: #3d271f;
}

.btn-home,
.btn-logout {
    background-color: #3d271f;
    color: #fffaf4;
    text-decoration: none;
    border: none;
    padding: 7px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.btn-home:hover,
.btn-logout:hover {
    background-color: #8c4a27;
}

header {
    height: 360px;
    background-color: #3d271f;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2cbb4;
}

#img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
}

.top-right {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    background: #fffaf4;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(47, 30, 24, 0.28);
    transition: transform 0.2s ease;
}

.top-right:hover {
    transform: scale(1.08);
}

.top-right img {
    width: 36px;
    height: 36px;
    display: block;
}

h2 {
    color: #2f1e18;
    margin-top: 26px;
    border-bottom: 2px solid #e6d7c6;
    padding-bottom: 10px;
    font-weight: 700;
}

/* Lưới sản phẩm 4 cột đều nhau */
#showsanpham {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 20px;
}

.sanpham {
    padding: 16px 14px;
    border-radius: 14px;
    background-color: #fffdf9;
    border: 1px solid #ead9c6;
    box-shadow: 0 4px 12px rgba(47, 30, 24, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.sanpham:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(47, 30, 24, 0.12);
    border-color: #c89d7c;
}

.sanpham.is-soldout {
    opacity: 0.78;
    background-color: #f9f4ee;
}

.sanpham .img-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}

.sanpham .img-wrap img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.ma-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(47, 30, 24, 0.78);
    color: #fffaf4;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.3px;
}

.sanpham .ten-mon {
    margin: 2px 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #2f1e18;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.sanpham .gia {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: #a44a1e;
}

/* Tình trạng tồn kho */
.stock-info {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    min-height: 18px;
}

.stock-ok {
    color: #2e7d32;
}

.stock-low {
    color: #d35400;
}

.stock-out {
    color: #c0392b;
}

/* Chọn Size M / L dạng viên thuốc */
.size-pills {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 30px;
}

.size-pill {
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid #d5be9e;
    background-color: #f6efe6;
    color: #4e342e;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
}

.size-pill:hover {
    border-color: #8c4a27;
    background-color: #efe2d1;
}

.size-pill.active {
    background-color: #3d271f;
    color: #fffaf4;
    border-color: #3d271f;
    box-shadow: 0 2px 6px rgba(61, 39, 31, 0.25);
}

.single-size-tag {
    font-size: 12px;
    font-weight: 600;
    color: #7c5c4c;
    background-color: #f3e8da;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px dashed #d5be9e;
}

/* Cụm tăng giảm số lượng - 1 + */
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d5be9e;
    border-radius: 8px;
    background-color: #fffaf4;
    overflow: hidden;
    margin-bottom: 12px;
}

.qty-stepper button.qty-btn {
    width: 30px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none;
    background-color: #f2e5d5;
    color: #3d271f;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.qty-stepper button.qty-btn:hover:not(:disabled) {
    background-color: #e2cfb8;
}

.qty-stepper button.qty-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qty-stepper input[name="soluong"] {
    width: 36px;
    height: 28px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 13.5px;
    color: #2f1e18;
    padding: 0;
    -moz-appearance: textfield;
}

.qty-stepper input[name="soluong"]::-webkit-outer-spin-button,
.qty-stepper input[name="soluong"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Nút Chọn Mua */
.sanpham button.btn-buy {
    margin-top: auto;
    width: 100%;
    background-color: #3d271f;
    color: #fffaf4;
    border: none;
    padding: 9px 14px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0.2px;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.sanpham button.btn-buy:hover:not(:disabled) {
    background-color: #8c4a27;
}

.sanpham button.btn-buy:active:not(:disabled) {
    transform: scale(0.98);
}

.sanpham button.btn-buy:disabled {
    background-color: #bcaaa4;
    color: #fffaf4;
    cursor: not-allowed;
}


/* === KHU VỰC GIỎ HÀNG THU NHỎ GÓC TRÊN BÊN PHẢI === */
#showgiohang {
    position: fixed;
    top: 84px;
    right: 18px;
    width: 365px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    z-index: 9990;
    background-color: #fffdf9;
    box-shadow: 0 12px 30px rgba(47, 30, 24, 0.22);
    margin-top: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid #d5be9e;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#showgiohang.is-collapsed {
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 10px 14px;
    border-radius: 999px;
}

#showgiohang.is-collapsed .mini-cart-body {
    display: none;
}

.mini-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ead9c6;
}

#showgiohang.is-collapsed .mini-cart-header {
    padding-bottom: 0;
    border-bottom: none;
    gap: 10px;
}

#showgiohang h3 {
    margin: 0;
    color: #2f1e18;
    border-bottom: none;
    padding-bottom: 0;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.mini-cart-badge {
    background-color: #8c4a27;
    color: #fffaf4;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.mini-cart-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-cart-toggle {
    border: 1px solid #d5be9e;
    background-color: #f2e5d5;
    color: #3d271f;
    border-radius: 7px;
    padding: 4px 8px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
}

.mini-cart-toggle:hover {
    background-color: #3d271f;
    color: #fffaf4;
}

#showgiohang .table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

#showgiohang table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0;
    font-size: 12px;
}

#showgiohang th {
    background-color: #f2e5d5;
    color: #2f1e18;
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #e2cbb4;
    font-weight: 700;
    font-size: 11px;
}

#showgiohang td {
    padding: 6px 4px;
    font-size: 11.5px;
    border: 1px solid #efe1d1;
    text-align: center;
    vertical-align: middle;
    color: #2f1e18;
}

#showgiohang .cart-thumb {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    border: 1px solid #e2cbb4;
}

#showgiohang .cart-qty-btn {
    padding: 2px 7px;
    font-size: 12px;
    border: 1px solid #d5be9e;
    background-color: #f6efe6;
    color: #2f1e18;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#showgiohang .cart-qty-btn:hover {
    background-color: #e6d3bc;
}

#showgiohang .cart-qty-num {
    display: inline-block;
    min-width: 20px;
    font-size: 12px;
    font-weight: 700;
}

#showgiohang .cart-item-subtotal {
    color: #a44a1e;
    font-weight: 700;
    white-space: nowrap;
}

#showgiohang .btn-del-item {
    padding: 4px 8px;
    font-size: 11px;
    background-color: #c0392b;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    transition: background-color 0.15s ease;
}

#showgiohang .btn-del-item:hover {
    background-color: #a93226;
}

#showgiohang .cart-total-label {
    text-align: right;
    font-weight: 700;
    font-size: 12.5px;
    padding-right: 8px;
}

#showgiohang .cart-total-value {
    color: #a44a1e;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

#showgiohang .cart-checkout-cell {
    padding-top: 10px !important;
}

#showgiohang .cart-empty {
    color: #7c5c4c;
    font-size: 12.5px;
    padding: 16px 8px !important;
}

#showgiohang .btn-checkout-bottom {
    width: 100%;
    background-color: #8c4a27;
    color: #fffaf4;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(140, 74, 39, 0.25);
    transition: background-color 0.2s ease;
}

#showgiohang .btn-checkout-bottom:hover {
    background-color: #3d271f;
}

/* === BỘ LỌC DANH MỤC & TÌM KIẾM MENU === */
.banner-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background-color: #8c4a27;
    color: #fffaf4;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(47, 30, 24, 0.28);
}

.menu-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-tab {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid #d5be9e;
    background-color: #f6efe6;
    color: #3d271f;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.cat-tab:hover {
    border-color: #8c4a27;
    background-color: #efe2d1;
}

.cat-tab.active {
    background-color: #3d271f;
    color: #fffaf4;
    border-color: #3d271f;
}

.menu-search {
    padding: 8px 13px;
    border: 1px solid #d5be9e;
    border-radius: 9px;
    background-color: #fffdf9;
    color: #2f1e18;
    font-family: inherit;
    font-size: 13.5px;
    min-width: 220px;
    outline: none;
}

.menu-search:focus {
    border-color: #8c4a27;
    background-color: #fff;
}

@media (max-width: 640px) {
    #showgiohang {
        top: 66px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    #showsanpham {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    #showsanpham {
        grid-template-columns: 1fr;
    }
}
/* === NHẬN DIỆN MÓN MỚI NỔI BẬT === */
.sanpham.is-new-item {
    border: 2px solid #d97706;
    background: linear-gradient(180deg, #fffbeb 0%, #fffdf9 42%);
    box-shadow: 0 8px 22px rgba(217, 119, 6, 0.18);
}

.sanpham.is-new-item:hover {
    border-color: #b45309;
    box-shadow: 0 12px 26px rgba(180, 83, 9, 0.25);
}

.badge-mon-moi {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ea580c, #d97706);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.4px;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
    z-index: 2;
}
