:root {
    --homi-teal: #0d9488;
    --homi-teal-dark: #0f766e;
    --homi-teal-light: #ccfbf1;
    --homi-orange: #f97316;
    --homi-indigo: #4f46e5;
    --homi-slate-dark: #0f172a;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #0d9488 0%, #4f46e5 100%);
}

.text-gradient {
    background: linear-gradient(135deg, #0d9488 0%, #4f46e5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(13, 148, 136, 0.1);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.hover-lift {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(13, 148, 136, 0.15) !important;
}

.btn-primary {
    background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
    border: none;
    transition: all 0.25s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.btn-homi-orange {
    background: #F97316;
    color: #fff;
    border: none;
    font-weight: 600;
}
.btn-homi-orange:hover {
    background: #EA580C;
    color: #fff;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

/* ===== COMPACT PRODUCT CARD SYSTEM ===== */
.product-card-compact {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    contain: content;
}
.product-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px -4px rgba(13, 148, 136, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.04) !important;
}

.product-img-container {
    height: 145px;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.product-img-compact {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.product-card-compact:hover .product-img-compact {
    transform: scale(1.06);
}

.btn-add-cart-compact {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.3);
    transition: transform 0.2s ease, background-color 0.2s;
    flex-shrink: 0;
}
.btn-add-cart-compact:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
}

/* ===== CATEGORY SIDEBAR ===== */
.category-sidebar {
    width: 220px;
    min-width: 220px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(99,102,241,0.08);
    transition: width 0.3s ease, min-width 0.3s ease;
    overflow: hidden;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Thu nhỏ sidebar (desktop) */
.category-sidebar.sidebar-collapsed {
    width: 60px;
    min-width: 60px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    min-height: 52px;
    flex-shrink: 0;
}

.sidebar-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    white-space: nowrap;
}

.btn-collapse {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.2s;
}
.btn-collapse:hover { background: #e2e8f0; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.sidebar-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 0.875rem;
    color: #475569;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 2px;
}
.sidebar-item:hover { background: #f1f5f9; color: #4f46e5; }
.sidebar-item.active {
    background: linear-gradient(135deg, #ede9fe, #dbeafe);
    color: #4f46e5;
    font-weight: 600;
}

.sidebar-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}
.sidebar-label { flex: 1; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }

.sidebar-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

/* Collapsed: chỉ hiện icon */
.sidebar-collapsed .sidebar-item { justify-content: center; padding: 10px; }
.sidebar-collapsed .sidebar-header { justify-content: center; padding: 14px 0; }

/* Toggle button (mobile) */
.sidebar-toggle-btn {
    position: fixed;
    bottom: 82px;
    left: 16px;
    z-index: 1025;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.sidebar-toggle-btn:hover { transform: scale(1.08); }

/* Overlay mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
    backdrop-filter: blur(2px);
}

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

/* Desktop (≥992px): sidebar luôn hiện, không có overlay */
@media (min-width: 992px) {
    .category-sidebar {
        position: sticky;
        transform: none !important;
        z-index: auto;
    }
}

/* Tablet & Mobile (<992px): sidebar trượt từ trái */
@media (max-width: 991.98px) {
    .category-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1045;
        border-radius: 0 16px 16px 0;
        max-height: 100vh;
        transform: translateX(-100%);
        width: 260px;
        min-width: 260px;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .category-sidebar.sidebar-open {
        transform: translateX(0);
    }
    .sidebar-collapsed {
        width: 260px !important;
        min-width: 260px !important;
    }
}

/* Mobile nhỏ (<576px) */
@media (max-width: 575.98px) {
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
    overflow-x: hidden;
}

.admin-sidebar {
    width: 250px;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 1050;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar .nav-link {
    color: #495057;
    transition: all 0.2s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: #f8f9fa;
    color: #0d6efd !important;
}

.admin-sidebar .nav-link.active {
    background-color: #e9ecef !important;
}

.admin-sidebar .nav-link i {
    width: 24px;
    text-align: center;
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1060;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .admin-sidebar.open {
        left: 0;
    }
}

/* Custom Teal & Helper Utilities */
.text-teal {
    color: #0d9488 !important;
}
.bg-teal {
    background-color: #0d9488 !important;
}
.border-teal {
    border-color: #0d9488 !important;
}
.btn-teal {
    background-color: #0d9488 !important;
    border-color: #0d9488 !important;
    color: #ffffff !important;
}
.btn-teal:hover {
    background-color: #0f766e !important;
    border-color: #0f766e !important;
    color: #ffffff !important;
}
.btn-outline-teal {
    color: #0d9488 !important;
    border-color: #0d9488 !important;
    background-color: transparent !important;
}
.btn-outline-teal:hover {
    background-color: #0d9488 !important;
    color: #ffffff !important;
}

.extra-small {
    font-size: 0.72rem !important;
}

.hover-zoom {
    transition: transform 0.2s ease;
}
.hover-zoom:hover {
    transform: scale(1.03);
}

.scrollbar-hidden::-webkit-scrollbar {
    display: none;
}
.scrollbar-hidden {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Horizontal Filter Tabs for Admin Mobile */
.filter-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    padding-bottom: 4px;
}
.filter-tabs .btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

/* ===== MOBILE STICKY CART BAR & CART MODAL ===== */
.mobile-sticky-cart-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    z-index: 1030;
    background-color: #ffffff !important;
    border-top: 1px solid rgba(13, 148, 136, 0.15);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px)) !important;
}

@media (max-width: 991.98px) {
    body:has(.mobile-sticky-cart-bar) {
        padding-bottom: 70px;
    }
    
    .offcanvas-cart-responsive {
        height: 85vh !important;
        max-height: 85vh !important;
        border-top-left-radius: 24px !important;
        border-top-right-radius: 24px !important;
    }
}

.dropdown-toggle-no-caret::after {
    display: none !important;
}