   /* Khung chứa sử dụng Flexbox để chia 2 cột */
.satrafoods-layout {
    display: flex;
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 1px;
    gap: 10px; /* Khoảng cách giữa menu và sản phẩm */
}

/* Kích thước cột trái (Menu) */
.sidebar-menu {
    flex: 0 0 22%; /* Chiếm đúng 22% chiều rộng */
    background-color: #fcfcfc;
    border: 1px solid #e5e5e5;
    padding: 5px;
    border-radius: 4px;
    height: fit-content;
}

.menu-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    color: #e31837; /* Màu đỏ thương hiệu hoặc màu cam tùy chỉnh */
    border-bottom: 2px solid #e31837;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Trạng thái mặc định của các dòng menu */
.menu-list .menu-item {
    border: 2px solid transparent; /* Tạo viền ẩn trước để khi click không bị giật giao diện */
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

/* Định dạng BẮT BUỘC GIỮ MÀU khi danh mục được kích hoạt (Active) */
.menu-list .menu-item.active {
    background-color: #ffffff !important;
    border: 1px solid #f7bc1e !important; /* Tạo viền hộp màu đen bao quanh */
}

/* Ép chữ của danh mục đang active chuyển sang màu đỏ giống như thiết kế gốc của bạn */
.menu-list .menu-item.active .category-menu-item {
    color: #e60000 !important;
    font-weight: bold !important;
}

.menu-item {
    border-bottom: 1px dashed #eee;
}

.menu-item a {
    display: block;
    padding: 7px 5px;
    color: #66cd18;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
}

.menu-item a:hover, .menu-item.active > a {
    display: block;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    color: #e31837;
    padding-left: 10px;
    transition: all 0.2s ease;
}

/* Mặc định ẩn menu cấp 2 */
.sub-menu {
    list-style: none;
    padding-left: 20px;
    background: #fff;
    display: none; /* Ẩn đi khi mới tải trang */
    overflow: hidden;
}

/* Khi item cha có class "open", hiển thị menu con */
.menu-item.open .sub-menu {
    display: block;
}

/* Thêm hiệu ứng con trỏ chuột cho mục có menu con */
.menu-item-has-children > a {
    cursor: pointer;
    position: relative;
}

/* Tùy chọn: Thêm mũi tên nhỏ báo hiệu có menu con */
.menu-item-has-children > a::after {
    content: '▼';
    font-size: 10px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    transition: transform 0.3s;
}

/* Xoay mũi tên khi mở menu */
.menu-item.open > a::after {
    transform: translateY(-50%) rotate(180deg);
}
/* Kích thước cột phải (Sản phẩm) */
.products-content {
    flex: 0 0 75%; /* Chiếm 75% còn lại */
}

.section-title {
    font-size: 20px;
    color: #f58220; /* Màu cam giống hình mẫu của bạn */
    margin-top: 10px;
    margin-bottom: 5px;
}

/* Lưới sản phẩm chia làm 4 cột */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Định dạng chuẩn 3 cột đều nhau */
    gap: 10px;
}

/* Khung chứa toàn bộ 1 sản phẩm */
.product-item {
    position: relative; /* Tạo điểm neo cho icon giỏ hàng */
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
}

/* Khung chứa ảnh sản phẩm */
/*.product-item > a.tooltip {
    display: block;
    position: relative; /* Điểm neo dự phòng nếu muốn đưa icon lên sát ảnh 
    text-align: center;
}
*/
.product-item img.pic {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

/* KHẮC PHỤC CHÍNH: Định vị lại Icon Giỏ Hàng */
.product-item .e-cart.e-cart-btn {
    position: absolute;
    right: 8px;      /* Cách lề phải 15px */
    bottom: 108px;     /* Đẩy lên trên, nằm ngay góc dưới bên phải của ảnh */
    z-index: 10;      /* Luôn nằm nổi lên trên cùng */
    width: 36px;      /* Cố định kích thước icon */
    height: 36px;
    background:#7db701 url('../../images/layout/icon.png') -218px -47px no-repeat; /* Màu xanh lá gốc của bạn */
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.product-item .e-cart.e-cart-btn:hover {
    transform: scale(1.1); /* Hiệu ứng phóng to nhẹ khi di chuột vào */
}

/* Phần thông tin chữ bên dưới */
.product-item .info {
    float: left;
    width: 100%;
    height: 83px;
    background: #f8f8f8;
    position: relative;
    border-top: solid 1px #e0e0e0;
}

.product-item .info h3 {
    color: #232323;
    font-size: 12px;
    text-transform: uppercase;
    line-height: 18px;
    height: 36px; /* Giới hạn 2 dòng tiêu đề tránh lệch khung */
    overflow: hidden;
    margin: 5px 0;
}

/* Khung giá tiền */
.product-item .line-price {
    min-height: 40px; /* Đảm bảo chiều cao bằng nhau dù có giảm giá hay không */
    position: relative;
}

.product-item .price {
    color: #ed1c24;
    font-weight: bold;
    font-size: 18px;
    position: relative;
}
.product-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.product-name {
    font-size: 14px;
    margin: 10px 0;
    height: 40px; /* Giới hạn độ cao để các box đều nhau */
    overflow: hidden;
}

.product-price {
    color: #e31837;
    font-weight: bold;
    margin-bottom: 10px;
}

.sale-price {
    max-width: 70%;
}

/* Chỉ định màu đỏ cho riêng nút sale khi ở trạng thái bình thường */
.category-menu-item[data-id="sale"] {
    color: #e60000;
    font-weight: bold;
}

/* --- ĐÁP ỨNG GIAO DIỆN DI ĐỘNG (RESPONSIVE) --- */
@media (max-width: 768px) {
    .satrafoods-layout {
        flex-direction: column; /* Chuyển thành 1 cột dọc trên điện thoại */
    }
    .sidebar-menu, .products-content {
        flex: 0 0 100%; /* Đẩy full màn hình */
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* Điện thoại hiển thị 2 cột sản phẩm */
    }
}

/* Khung bọc tổng bên ngoài */
.my-custom-carousel-wrapper {
    display: block !important;
    width: 100% !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 6px !important;
    box-sizing: border-box !important;
    margin-bottom: 15px !important;
    overflow: hidden !important;
}

/* Ép dòng chảy marquee nằm thẳng một hàng ngang */
.marquee-products-holder {
    display: inline-block !important;
    white-space: nowrap !important;
}

/* Định dạng từng ô sản phẩm trượt */
.carousel-image-span-item {
    display: inline-block !important; /* Xếp cạnh nhau hàng ngang */
    width: 140px !important;          /* Chiều rộng lý tưởng để hiển thị chữ không bị bó hẹp */
    height: 155px !important;         /* Chiều cao tổng đủ cho cả ảnh và chữ */
    margin-right: 15px !important;    /* Khoảng cách giữa các sản phẩm */
    background: #ffffff !important;
    border: 1px solid #edf2f7 !important;
    border-radius: 6px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
    vertical-align: top !important;   /* Căn hàng chuẩn theo cạnh trên */
}

/* Ép cấu trúc link xếp theo dạng CỘT DỌC (Ảnh trên - Chữ dưới) */
.carousel-image-span-item a {
    display: flex !important;
    flex-direction: column !important; /* Thần chú ép chữ xuống dưới chân ảnh */
    width: 100% !important;
    height: 100% !important;
    text-decoration: none !important;
}

/* Định dạng khu vực hiển thị ảnh vuông vắn */
.marquee-img-box {
    display: flex !important;
    width: 100% !important;
    height: 110px !important;         /* Giữ độ cao ảnh cố định 110px */
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 6px !important;
}

.marquee-img-box img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Định dạng khu vực thông tin chữ bên dưới */
.marquee-info-box {
    display: block !important;
    width: 100% !important;
    text-align: center !important;    /* Căn chữ ra chính giữa */
}

/* Định dạng chữ tên sản phẩm */
.carousel-product-title {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    color: #2d3748 !important;
    line-height: 1.3 !important;
    font-weight: 500 !important;
    
    /* Trả chữ về định dạng block tự xuống dòng khi hết khung 150px */
    display: -webkit-box !important;
    white-space: normal !important; 
    -webkit-line-clamp: 2 !important; /* Giới hạn tối đa hiển thị 2 dòng chữ */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}