/* ============================================================
   DAMPI — Sidebar de categorías + desplegables
============================================================ */

/* ── Layout global con sidebar ───────────────────────────── */
.page-layout {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - 88px);
}

.page-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.cat-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 88px;
  height: calc(100vh - 88px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--bg3) transparent;
  z-index: 50;
  transition: transform 0.3s var(--ease);
}
.cat-sidebar::-webkit-scrollbar { width: 3px; }
.cat-sidebar::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

.cat-sidebar__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.cat-sidebar__nav { padding: 6px 0 16px; }

/* ── Item de categoría ───────────────────────────────────── */
.sidebar-item { position: relative; }

.sidebar-item__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 12px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  color: var(--text2);
  border-left: 2px solid transparent;
  user-select: none;
}
.sidebar-item__link:hover {
  background: var(--bg2);
  color: var(--text);
}
.sidebar-item.active > .sidebar-item__link,
.sidebar-item__link.active {
  background: var(--cyan-bg);
  color: var(--cyan-dark);
  border-left-color: var(--cyan);
  font-weight: 600;
}

.sidebar-item__icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.sidebar-item__link:hover .sidebar-item__icon { transform: scale(1.08); }

.sidebar-item__name {
  flex: 1;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item__arrow {
  color: var(--text3);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}
.sidebar-item.open > .sidebar-item__link .sidebar-item__arrow {
  transform: rotate(90deg);
  color: var(--cyan);
}

/* ── Próximamente ────────────────────────────────────────── */
.sidebar-item--soon .sidebar-item__link {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.sidebar-item__soon {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg3);
  border-radius: 4px;
  padding: 2px 5px;
  flex-shrink: 0;
}

/* ── Divisor ─────────────────────────────────────────────── */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

/* ── Submenú desplegable ─────────────────────────────────── */
.sidebar-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.32s var(--ease), opacity 0.25s ease;
  opacity: 0;
  background: var(--bg);
  border-left: 2px solid var(--cyan);
  margin-left: 40px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.sidebar-item.open > .sidebar-submenu {
  max-height: 400px;
  opacity: 1;
}

.sidebar-submenu__item {
  display: block;
  padding: 7px 14px 7px 12px;
  font-size: 12.5px;
  color: var(--text2);
  font-weight: 400;
  transition: color var(--transition), background var(--transition), padding-left var(--transition);
  text-decoration: none;
  border-radius: 0;
}
.sidebar-submenu__item:hover {
  color: var(--cyan);
  background: var(--cyan-bg);
  padding-left: 16px;
}
.sidebar-submenu__item.active {
  color: var(--cyan-dark);
  font-weight: 600;
}

/* ── Botón móvil ─────────────────────────────────────────── */
.btn-sidebar-mobile {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  margin: 12px 16px 0;
  background: var(--surface);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-sidebar-mobile:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── Overlay móvil ───────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 49;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .page-layout {
    display: block !important;
    width: 100% !important;
  }
  .cat-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .cat-sidebar.mobile-open {
    display: block;
    transform: translateX(0);
  }
  .btn-sidebar-mobile { display: flex; }
  .page-content {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }
}
