.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: smaller;
    font-style: italic;
}

.truncate-1 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.truncate-3 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.truncate-5 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.lh-1 {
    line-height: 1em !important;
}

.modal-dialog.large {
    width: 80% !important;
    max-width: unset;
}

.modal-dialog.mid-large {
    width: 50% !important;
    max-width: unset;
}

@media (max-width:900px) {
    .modal-dialog.large {
        width: 100% !important;
        max-width: unset;
    }
    .modal-dialog.mid-large {
        width: 100% !important;
        max-width: unset;
    }
    .modal-dialog {
        margin: unset !important;
    }
}

#viewer_modal .btn-close {
    position: absolute;
    z-index: 999999;
    /*right: -4.5em;*/
    background: unset;
    color: white;
    border: unset;
    font-size: 27px;
    top: 0;
}

#viewer_modal .modal-dialog {
    width: 80%;
    max-width: unset;
    height: calc(90%);
    max-height: unset;
}

#viewer_modal .modal-content {
    background: black;
    border: unset;
    height: calc(100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#viewer_modal img,
#viewer_modal video {
    max-height: calc(100%);
    max-width: calc(100%);
}

table.dataTable th,
table.dataTable td {
    padding: 5px !important;
}

.card.d-flex {
    flex-direction: row !important;
}

.card.d-flex>img {
    width: 20% !important;
}

.card.d-flex>.card-body {
    width: 80% !important;
}

span.btn {
    cursor: unset;
}

span.btn:hover {
    background: inherit;
}

#tourCarousel {
    height: 50vh !important;
}

#tourCarousel img {
    object-fit: fill;
}

div.stars {
    width: auto;
    display: inline-block
}

.mt-200 {
    margin-top: 200px
}

input.star {
    display: none
}

label.star {
    float: right;
    /* padding: 10px; */
    font-size: 30px;
    color: #333333;
    transition: all .2s
}

input.star:checked~label.star:before {
    content: '\2605';
    color: #ffc800;
    transition: all .25s
}

input.star-5:checked~label.star:before {
    color: #ffc800;
    /* text-shadow: 0 0 20px #952 */
}

input.star-1:checked~label.star:before {
    color: #F62
}

label.star:hover {
    transform: rotate(-15deg) scale(1.3)
}

label.star:before {
    content: '\2605';
    font-family: FontAwesome
}

.product-img-holder {
    width: 100%;
    height: 20em;
}

.product-img-holder>img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    object-position: center center;
    transition: transform .2s ease-in;
}

.product-item:hover .product-img-holder>img {
    transform: scale(1.3);
}

.brand-img-holder {
    width: 100%;
    height: 20em;
}

.brand-img-holder>img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    object-position: center center;
    transition: transform .2s ease-in;
}

.brand-item:hover .brand-img-holder>img {
    transform: scale(1.3);
}

.price-tag {
    bottom: 1em;
    right: 1em;
}

/* Cải thiện hamburger menu button */
.navbar-toggler,
.nav-link[data-widget="pushmenu"] {
    transition: all 0.2s ease-in-out;
}

.navbar-toggler:hover,
.nav-link[data-widget="pushmenu"]:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 0.25rem;
}

.nav-link[data-widget="pushmenu"]:active {
    transform: scale(0.95);
}

/* Loại bỏ khoảng trắng thừa ở navbar */
.main-header.navbar {
    margin-bottom: 0 !important;
}

.main-header.navbar .navbar-nav {
    margin: 0;
}

.main-header.navbar .navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

/* Ẩn scrollbar native trong toàn bộ sidebar */
.sidebar::-webkit-scrollbar,
.os-viewport::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.sidebar,
.os-viewport {
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE and Edge */
}

/* Cải thiện shadow cho main header */
.main-header {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08) !important;
}

/* Smooth transitions cho sidebar toggle */
body.sidebar-collapse .main-sidebar {
    transition: margin-left 0.3s ease-in-out, left 0.3s ease-in-out;
}

body:not(.sidebar-collapse) .main-sidebar {
    transition: margin-left 0.3s ease-in-out, left 0.3s ease-in-out;
}

/* Cải thiện overlay khi sidebar mở trên mobile và tablet */
@media (max-width: 991.98px) {
    .sidebar-open .main-sidebar {
        box-shadow: 3px 0 15px rgba(0, 0, 0, 0.3);
    }
    
    /* Bỏ margin-left cho tất cả devices < 992px */
    .content-wrapper,
    .main-footer,
    .main-header.navbar,
    body.sidebar-collapse .content-wrapper,
    body.sidebar-collapse .main-footer,
    body:not(.sidebar-collapse) .content-wrapper,
    body:not(.sidebar-collapse) .main-footer {
        margin-left: 0 !important;
    }
}

/* Ẩn tất cả scrollbar không cần thiết trong navigation */
.nav-sidebar {
    overflow: visible !important;
}

/* Cải thiện user dropdown button */
.btn-rounded {
    transition: all 0.2s ease-in-out;
}

.btn-rounded:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */

/* Mobile: Loại bỏ khoảng trắng không cần thiết */
@media (max-width: 767.98px) {
    /* Giảm padding content wrapper */
    .content-wrapper {
        padding-top: 1rem !important;
    }
    
    /* Giảm padding container */
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Giảm margin bottom cho header section */
    .row.mb-4 {
        margin-bottom: 1rem !important;
    }
    
    /* Tinh chỉnh card */
    .card {
        margin-bottom: 0.75rem !important;
    }
    
    .card-body {
        padding: 0.75rem !important;
    }
    
    .card-header {
        padding: 0.75rem !important;
    }
    
    /* Tinh chỉnh heading */
    h1 {
        font-size: 1.5rem !important;
    }
    
    h5.card-title {
        font-size: 1rem !important;
    }
    
    /* Giảm margin cho form elements */
    .mb-3 {
        margin-bottom: 0.75rem !important;
    }
    
    /* Tinh chỉnh button */
    .btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    .btn-sm {
        padding: 0.375rem 0.5rem !important;
        font-size: 0.8125rem !important;
    }
    
    /* Giảm padding cho legend/info section */
    .px-3 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .py-2 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    
    /* Tối ưu table responsive */
    .table-responsive {
        margin-bottom: 0.5rem !important;
    }
    
    /* Form control sizing */
    .form-control-sm {
        font-size: 0.8125rem !important;
        padding: 0.375rem 0.5rem !important;
    }
    
    /* User avatar sizing trên mobile */
    .user-img {
        height: 24px !important;
        width: 24px !important;
        left: -10% !important;
        top: -8% !important;
    }
    
    /* Điều chỉnh dropdown menu */
    .dropdown-menu {
        font-size: 0.875rem !important;
    }
    
    /* Zoom slider trên mobile */
    .custom-range {
        width: 100px !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
    .content-wrapper {
        padding-top: 1.5rem !important;
        margin-left: 0 !important;
    }
    
    .main-footer {
        margin-left: 0 !important;
    }
    
    .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Cải thiện sidebar trên mobile */
@media (max-width: 767.98px) {
    /* Loại bỏ tất cả margin-left */
    .content-wrapper,
    .main-footer,
    body.sidebar-collapse .content-wrapper,
    body.sidebar-collapse .main-footer {
        margin-left: 0 !important;
    }
    
    /* Sidebar full width khi mở */
    .main-sidebar {
        width: 250px !important;
        max-width: 80vw;
    }
    
    /* Brand link compact */
    .brand-link {
        padding: 0.8125rem 0.5rem !important;
        font-size: 0.9rem !important;
    }
    
    .brand-image {
        max-height: 30px !important;
    }
    
    /* Nav items compact */
    .nav-sidebar .nav-link {
        padding: 0.5rem 0.75rem !important;
    }
    
    .nav-sidebar .nav-link p {
        font-size: 0.875rem !important;
    }
}

/* Loại bỏ khoảng trắng thừa global */
body {
    overflow-x: hidden !important;
}

.wrapper {
    overflow-x: hidden !important;
}

/* Tối ưu space cho các component khác */
@media (max-width: 767.98px) {
    /* Icon sizing */
    .fas, .far, .fab {
        font-size: 0.875rem !important;
    }
    
    /* Text muted smaller */
    .text-muted small {
        font-size: 0.75rem !important;
    }
    
    /* Flex adjustments */
    .d-flex.flex-column.flex-md-row {
        gap: 0.5rem;
    }
}