/* Custom Sidebar CSS - Đậu Đậu Quán */
.sidebar {
  background-color: #fff;
  width: 250px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 9999 !important;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow-y: auto;
  padding: 20px 0;
}

.sidebar-header {
  text-align: center;
  padding: 20px 15px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 15px;
}

.sidebar-logo img {
  width: 80px;
  height: 80px;
  border-radius: 50% !important;
  object-fit: cover;
  border: 3px solid #f26522;
}

.sidebar-header h3 {
  margin-top: 15px;
  color: #f26522;
  font-size: 1.3rem;
  font-weight: 600;
}

.sidebar-menu {
  flex: 1;
  padding: 0 10px;
}

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

.sidebar-menu li {
  margin-bottom: 8px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #444;
  text-decoration: none;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10000 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

.sidebar-menu a:hover {
  background-color: rgba(242, 101, 34, 0.1);
  color: #f26522;
}

.sidebar-menu a.active {
  background-color: rgba(242, 101, 34, 0.1);
  color: #f26522;
  border-left: 3px solid #f26522;
}

.sidebar-menu a i {
  margin-right: 10px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 20px 15px;
  border-top: 1px solid #f0f0f0;
  margin-top: 15px;
}

.sidebar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background-color: #f8f8f8;
  color: #333;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10000 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

.sidebar-social a:hover {
  background-color: #f26522;
  color: #fff;
}

.sidebar-toggle {
  position: fixed;
  top: 15px;
  left: 15px;
  width: 40px;
  height: 40px;
  background-color: #f26522;
  color: #fff;
  border: none;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 99999 !important;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

.main-content {
  margin-left: 250px;
  transition: all 0.3s ease;
  min-height: 100vh;
}

/* CSS cho sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(0, 0, 0, 0.5) !important;
  z-index: 9998 !important;
  transition: all 0.3s ease;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

.sidebar-overlay.active {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Thêm hiệu ứng transition cho sidebar */
.sidebar {
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
}

body.sidebar-hidden .sidebar {
  transform: translateX(-100%);
}

/* Mobile Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: flex !important;
  }
  
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .dashboard-header {
    padding-left: 60px;
  }
  
  .sidebar-menu a, 
  .sidebar-social a {
    cursor: pointer !important;
    -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
  }

  .sidebar-menu a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 48px;
    min-width: 48px;
    z-index: 1;
  }
}

/* Tablet Responsive */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
  }
  
  .footer-section {
    width: 100%;
    margin-bottom: 20px;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    padding: 15px 10px 15px 60px;
  }
  
  .header-search {
    margin: 10px 0;
    width: 100%;
  }
  
  .header-user {
    margin-top: 10px;
    justify-content: flex-end;
  }
  
  .sidebar.active {
    transform: translateX(0) !important;
  }
  
  body.sidebar-hidden .sidebar {
    transform: translateX(-100%) !important;
  }
  
  body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }

  /* Đảm bảo menu items có kích thước touch phù hợp */
  .sidebar-menu a {
    padding: 16px 20px !important;
    font-size: 16px !important;
    min-height: 56px !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
  }

  .sidebar-social a {
    min-height: 48px !important;
    min-width: 48px !important;
  }
}

/* Small Mobile Responsive */
@media (max-width: 480px) {
  .sidebar {
    width: 85%;
    max-width: 300px;
  }
  
  .sidebar-toggle {
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
  }

  .dashboard-header {
    padding-left: 45px;
  }
  
  .btn-login, 
  .btn-register {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  .blog-card, 
  .products-grid .product-card {
    flex-direction: column;
  }
  
  .blog-thumb, 
  .product-card img {
    width: 100%;
    height: auto;
  }
  
  .products-toolbar {
    flex-direction: column;
  }
  
  .products-sorting,
  .products-view {
    text-align: center;
    margin-bottom: 10px;
  }

  /* Mobile menu optimization */
  .sidebar-menu a {
    padding: 18px 15px !important;
    font-size: 15px !important;
    min-height: 54px !important;
  }
}

/* Cải thiện khả năng hiển thị trên các thiết bị nhỏ hơn */
@media (max-width: 380px) {
  .sidebar {
    width: 90%;
  }
  
  .sidebar-toggle {
    width: 32px;
    height: 32px;
    top: 8px;
    left: 8px;
  }
  
  .dashboard-header {
    padding-left: 40px;
  }
}

/* Force hardware acceleration và ensure clickability */
.sidebar-menu a,
.sidebar-social a,
.sidebar-toggle {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
} 