/* 
 * Sidebar Styles - Componente condiviso per tutte le pagine
 * Include stili base, stati attivi, hover e responsive design
 */

/* Aggiustamento del body per fare spazio alla sidebar */
body {
  margin-left: 60px; /* Spazio per la sidebar */
}

/* Stili base della sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 4.5%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 0 !important;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* Stili degli elementi della sidebar */
.sidebar-item {
  width: 60%;
  height: 5%;
  margin-left: 7%;
  margin-right: 7%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  transform: scale(1.1);
}

.sidebar-item.active,
.sidebar-item-active {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  transform: scale(1.05);
}

.sidebar-item svg {
  transition: all 0.3s ease;
}

/* Badge per contatori numerici (carrello e preferiti) */
.sidebar-item {
  position: relative;
}

.sidebar-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  line-height: 1;
  z-index: 10;
  min-width: 18px;
  padding: 0 2px;
  box-sizing: border-box;
  transform: scale(0);
  transition: all 0.3s ease;
}

.sidebar-badge.visible {
  transform: scale(1);
}

.sidebar-badge:empty {
  display: none;
}

/* Responsive design per dispositivi mobili */
@media (max-width: 1000px) {
  .sidebar-item {
    width: 40px;
    height: 40px;
    margin-left: 0;
    margin-right: 0;
  }

  body {
    margin-left: 0;
    margin-bottom: 60px; /* Spazio per la sidebar in basso */
  }

  .sidebar {
    width: 100%;
    height: 60px;
    top: auto;
    bottom: 0;
    flex-direction: row;
    justify-content: center;
    padding: 0;
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar-content {
    flex-direction: row;
    gap: 2rem;
    width: auto;
    height: 100%;
  }
}

/* Media query per schermi molto piccoli */
@media (max-width: 480px) {
  .sidebar-content {
    gap: 1.5rem;
  }

  .sidebar-item {
    width: 35px;
    height: 35px;
  }

  .sidebar-item svg,
  .sidebar-item img {
    width: 20px !important;
    height: 20px !important;
  }

  .sidebar-badge {
    width: 16px;
    height: 16px;
    font-size: 9px;
    top: -3px;
    right: -3px;
  }
}